llama-stack
llama-stack copied to clipboard
Tools api with a stub provider impl
This PR adds a new Tools api and does all the plumbing needed to implement the tools api in distribution and changes needed to route the tool runtime calls to the provider.
Test plan:
curl -X POST "http://localhost:5000/alpha/tools/register" \
-H "Content-Type: application/json" \
-d '{
"tool_id": "example-tool",
"name": "Example Tool",
"description": "This is an example tool",
"parameters": [
{
"name": "param1",
"type_hint": "string",
"description": "First parameter description",
"required": true
}
],
"returns": {
"type_hint": "string",
"description": "Description of what the tool returns"
},
"provider_metadata": {},
"tool_prompt_format": "json"
}'
curl -X GET http://localhost:5000/alpha/tools/list | jq .
{
"identifier": "example-tool",
"provider_resource_id": "example-tool",
"provider_id": "meta-reference",
"type": "tool",
"name": "Example Tool",
"description": "This is an example tool",
"parameters": [
{
"name": "param1",
"type_hint": "string",
"description": "First parameter description",
"required": true,
"default": null
}
],
"returns": {
"type_hint": "string",
"description": "Description of what the tool returns"
},
"provider_metadata": {},
"tool_prompt_format": "json"
}
]