mirror of
https://github.com/katanemo/plano.git
synced 2026-06-20 15:28:07 +02:00
add support for format
This commit is contained in:
parent
5bf9a80283
commit
0ef9d62565
8 changed files with 83 additions and 19 deletions
|
|
@ -28,12 +28,6 @@ Content-Type: application/json
|
|||
"description": "The location to get the weather for",
|
||||
"format": "City, State"
|
||||
},
|
||||
"unit": {
|
||||
"type": "str",
|
||||
"description": "The unit to return the weather in.",
|
||||
"enum": ["celsius", "fahrenheit"],
|
||||
"default": "celsius"
|
||||
},
|
||||
"days": {
|
||||
"type": "str",
|
||||
"description": "the number of days for the request."
|
||||
|
|
@ -236,7 +230,6 @@ Content-Type: application/json
|
|||
}
|
||||
|
||||
|
||||
|
||||
### archgw to model_server 2
|
||||
POST {{model_server_endpoint}}/function_calling HTTP/1.1
|
||||
Content-Type: application/json
|
||||
|
|
@ -292,3 +285,66 @@ Content-Type: application/json
|
|||
],
|
||||
"stream": false
|
||||
}
|
||||
|
||||
|
||||
### archgw to model_server 3
|
||||
POST {{model_server_endpoint}}/function_calling HTTP/1.1
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"model": "--",
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "how is the weather in seattle"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "Of course, I can help with that. Could you please specify the days you want the weather forecast for?",
|
||||
"model": "Arch-Function"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "for 2 days please"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"id": "weather-112",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "get_current_weather",
|
||||
"description": "Get current weather at a location.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"location": {
|
||||
"type": "str",
|
||||
"description": "The location to get the weather for",
|
||||
"format": "City, State"
|
||||
},
|
||||
"days": {
|
||||
"type": "str",
|
||||
"description": "the number of days for the request"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"days", "location"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "default_target",
|
||||
"description": "This is the default target for all unmatched prompts.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"stream": true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,15 +73,6 @@ Content-Type: application/json
|
|||
{
|
||||
"role": "user",
|
||||
"content": "for next 10 days"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "Could you tell me what units you want the weather in? (For example: Celsius or Fahrenheit)",
|
||||
"model": "Arch-Function-1.5b"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Fahrenheit"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ def test_prompt_gateway_param_gathering(stream):
|
|||
def test_prompt_gateway_param_tool_call(stream):
|
||||
expected_tool_call = {
|
||||
"name": "get_current_weather",
|
||||
"arguments": {"location": "seattle", "days": "2"},
|
||||
"arguments": {"location": "seattle, wa", "days": "2"},
|
||||
}
|
||||
|
||||
body = {
|
||||
|
|
@ -181,11 +181,11 @@ def test_prompt_gateway_param_tool_call(stream):
|
|||
{
|
||||
"role": "assistant",
|
||||
"content": "Of course, I can help with that. Could you please specify the days you want the weather forecast for?",
|
||||
"model": "Arch-Function-1.5B",
|
||||
"model": "Arch-Function",
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "2 days",
|
||||
"content": "for 2 days please",
|
||||
},
|
||||
],
|
||||
"stream": stream,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue