mirror of
https://github.com/katanemo/plano.git
synced 2026-04-26 17:26:26 +02:00
Add function calling support using bolt-fc-1b (#35)
This commit is contained in:
parent
fdfad87347
commit
7b5203a2ce
39 changed files with 1763 additions and 416 deletions
5
function_resolver/test/test.sh
Normal file
5
function_resolver/test/test.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
PORT="${PORT:-8001}"
|
||||
|
||||
echo localhost:$PORT/v1/chat/completions
|
||||
|
||||
curl -H "content-type: application/json" -XPOST localhost:$PORT/v1/chat/completions -d @test_payload.json
|
||||
5
function_resolver/test/test_envoy_cluster.sh
Normal file
5
function_resolver/test/test_envoy_cluster.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
PORT="${PORT:-8001}"
|
||||
|
||||
echo localhost:$PORT/bolt_fc_1b/v1/chat/completions
|
||||
|
||||
curl -v -H "content-type: application/json" -XPOST localhost:$PORT/bolt_fc_1b/v1/chat/completions -d @test_payload.json
|
||||
1
function_resolver/test/test_missing_param.sh
Normal file
1
function_resolver/test/test_missing_param.sh
Normal file
|
|
@ -0,0 +1 @@
|
|||
curl -H "content-type: application/json" -XPOST localhost:8001/v1/chat/completions -d @test_payload_missing_param.json
|
||||
33
function_resolver/test/test_payload.json
Normal file
33
function_resolver/test/test_payload.json
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Find the area of a triangle with a base of 10 units and height of 5 units."
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"name": "calculate_triangle_area",
|
||||
"description": "Calculate the area of a triangle given its base and height.",
|
||||
"parameters": {
|
||||
"type": "dict",
|
||||
"properties": {
|
||||
"base": {
|
||||
"type": "integer",
|
||||
"description": "The base of the triangle.",
|
||||
"required": true
|
||||
},
|
||||
"height": {
|
||||
"type": "integer",
|
||||
"description": "The height of the triangle.",
|
||||
"required": true
|
||||
},
|
||||
"unit": {
|
||||
"type": "string",
|
||||
"description": "The unit of measure (defaults to 'units' if not specified)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
32
function_resolver/test/test_payload_missing_param.json
Normal file
32
function_resolver/test/test_payload_missing_param.json
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Find the area of a triangle"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"name": "calculate_triangle_area",
|
||||
"description": "Calculate the area of a triangle given its base and height.",
|
||||
"parameters": {
|
||||
"type": "dict",
|
||||
"properties": {
|
||||
"base": {
|
||||
"type": "integer",
|
||||
"description": "The base of the triangle."
|
||||
},
|
||||
"height": {
|
||||
"type": "integer",
|
||||
"description": "The height of the triangle."
|
||||
},
|
||||
"unit": {
|
||||
"type": "string",
|
||||
"description": "The unit of measure (defaults to 'units' if not specified)"
|
||||
}
|
||||
},
|
||||
"required": ["base", "height"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
29
function_resolver/test/test_weather.json
Normal file
29
function_resolver/test/test_weather.json
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "how is the weather in San Francisco for next 5 days?"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"name": "weather_forecast",
|
||||
"description": "This function resolver provides weather forecast information for a given city.",
|
||||
"parameters": {
|
||||
"type": "dict",
|
||||
"properties": {
|
||||
"days": {
|
||||
"description": "The number of days for which the weather forecast is requested."
|
||||
},
|
||||
"units": {
|
||||
"description": "The units in which the weather forecast is requested."
|
||||
},
|
||||
"city": {
|
||||
"description": "The city for which the weather forecast is requested.",
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue