mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-03 09:21:45 +00:00
fix list tools method name
This commit is contained in:
parent
87068278ac
commit
6632d7e410
12 changed files with 84 additions and 12 deletions
|
@ -1752,6 +1752,54 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"/alpha/tool-runtime/list-tools": {
|
||||
"post": {
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/jsonl": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ToolDef"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"ToolRuntime"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "tool_group_id",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "X-LlamaStack-ProviderData",
|
||||
"in": "header",
|
||||
"description": "JSON-encoded provider data which will be made available to the adapter servicing the API",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ListRuntimeToolsRequest"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"/alpha/scoring-functions/list": {
|
||||
"get": {
|
||||
"responses": {
|
||||
|
@ -1858,7 +1906,7 @@
|
|||
}
|
||||
},
|
||||
"tags": [
|
||||
"ToolRuntime"
|
||||
"ToolGroups"
|
||||
],
|
||||
"summary": "List tools with optional tool group",
|
||||
"parameters": [
|
||||
|
@ -6207,6 +6255,15 @@
|
|||
"provider_types"
|
||||
]
|
||||
},
|
||||
"ListRuntimeToolsRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"mcp_endpoint": {
|
||||
"$ref": "#/components/schemas/URL"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"LogSeverity": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
@ -8189,6 +8246,10 @@
|
|||
"name": "LLMAsJudgeScoringFnParams",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/LLMAsJudgeScoringFnParams\" />"
|
||||
},
|
||||
{
|
||||
"name": "ListRuntimeToolsRequest",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ListRuntimeToolsRequest\" />"
|
||||
},
|
||||
{
|
||||
"name": "LogEventRequest",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/LogEventRequest\" />"
|
||||
|
@ -8706,6 +8767,7 @@
|
|||
"KeywordMemoryBank",
|
||||
"KeywordMemoryBankParams",
|
||||
"LLMAsJudgeScoringFnParams",
|
||||
"ListRuntimeToolsRequest",
|
||||
"LogEventRequest",
|
||||
"LogSeverity",
|
||||
"LoraFinetuningConfig",
|
||||
|
|
|
@ -1122,6 +1122,12 @@ components:
|
|||
- type
|
||||
- judge_model
|
||||
type: object
|
||||
ListRuntimeToolsRequest:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
mcp_endpoint:
|
||||
$ref: '#/components/schemas/URL'
|
||||
type: object
|
||||
LogEventRequest:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
|
@ -4919,6 +4925,9 @@ tags:
|
|||
- description: <SchemaDefinition schemaRef="#/components/schemas/LLMAsJudgeScoringFnParams"
|
||||
/>
|
||||
name: LLMAsJudgeScoringFnParams
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/ListRuntimeToolsRequest"
|
||||
/>
|
||||
name: ListRuntimeToolsRequest
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/LogEventRequest"
|
||||
/>
|
||||
name: LogEventRequest
|
||||
|
@ -5290,6 +5299,7 @@ x-tagGroups:
|
|||
- KeywordMemoryBank
|
||||
- KeywordMemoryBankParams
|
||||
- LLMAsJudgeScoringFnParams
|
||||
- ListRuntimeToolsRequest
|
||||
- LogEventRequest
|
||||
- LogSeverity
|
||||
- LoraFinetuningConfig
|
||||
|
|
|
@ -130,8 +130,8 @@ class ToolGroups(Protocol):
|
|||
class ToolRuntime(Protocol):
|
||||
tool_store: ToolStore
|
||||
|
||||
@webmethod(route="/tool-runtime/list-tools", method="POST")
|
||||
async def list_tools(
|
||||
@webmethod(route="/tool-runtime/list-tools", method="GET")
|
||||
async def list_runtime_tools(
|
||||
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||
) -> List[ToolDef]: ...
|
||||
|
||||
|
|
|
@ -417,7 +417,7 @@ class ToolRuntimeRouter(ToolRuntime):
|
|||
args=args,
|
||||
)
|
||||
|
||||
async def list_tools(
|
||||
async def list_runtime_tools(
|
||||
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||
) -> List[ToolDef]:
|
||||
return await self.routing_table.get_provider_impl(tool_group_id).list_tools(
|
||||
|
|
|
@ -508,7 +508,7 @@ class ToolGroupsRoutingTable(CommonRoutingTableImpl, ToolGroups):
|
|||
args: Optional[Dict[str, Any]] = None,
|
||||
) -> None:
|
||||
tools = []
|
||||
tool_defs = await self.impls_by_provider_id[provider_id].list_tools(
|
||||
tool_defs = await self.impls_by_provider_id[provider_id].list_runtime_tools(
|
||||
toolgroup_id, mcp_endpoint
|
||||
)
|
||||
tool_host = (
|
||||
|
|
|
@ -44,7 +44,7 @@ class CodeInterpreterToolRuntimeImpl(ToolsProtocolPrivate, ToolRuntime):
|
|||
async def unregister_tool(self, tool_id: str) -> None:
|
||||
return
|
||||
|
||||
async def list_tools(
|
||||
async def list_runtime_tools(
|
||||
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||
) -> List[ToolDef]:
|
||||
return [
|
||||
|
|
|
@ -51,7 +51,7 @@ class MemoryToolRuntimeImpl(ToolsProtocolPrivate, ToolRuntime):
|
|||
async def initialize(self):
|
||||
pass
|
||||
|
||||
async def list_tools(
|
||||
async def list_runtime_tools(
|
||||
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||
) -> List[ToolDef]:
|
||||
return [
|
||||
|
|
|
@ -51,7 +51,7 @@ class BingSearchToolRuntimeImpl(
|
|||
)
|
||||
return provider_data.api_key
|
||||
|
||||
async def list_tools(
|
||||
async def list_runtime_tools(
|
||||
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||
) -> List[ToolDef]:
|
||||
return [
|
||||
|
|
|
@ -49,7 +49,7 @@ class BraveSearchToolRuntimeImpl(
|
|||
)
|
||||
return provider_data.api_key
|
||||
|
||||
async def list_tools(
|
||||
async def list_runtime_tools(
|
||||
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||
) -> List[ToolDef]:
|
||||
return [
|
||||
|
|
|
@ -29,7 +29,7 @@ class ModelContextProtocolToolRuntimeImpl(ToolsProtocolPrivate, ToolRuntime):
|
|||
async def initialize(self):
|
||||
pass
|
||||
|
||||
async def list_tools(
|
||||
async def list_runtime_tools(
|
||||
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||
) -> List[ToolDef]:
|
||||
if mcp_endpoint is None:
|
||||
|
|
|
@ -50,7 +50,7 @@ class TavilySearchToolRuntimeImpl(
|
|||
)
|
||||
return provider_data.api_key
|
||||
|
||||
async def list_tools(
|
||||
async def list_runtime_tools(
|
||||
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||
) -> List[ToolDef]:
|
||||
return [
|
||||
|
|
|
@ -51,7 +51,7 @@ class WolframAlphaToolRuntimeImpl(
|
|||
)
|
||||
return provider_data.api_key
|
||||
|
||||
async def list_tools(
|
||||
async def list_runtime_tools(
|
||||
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||
) -> List[ToolDef]:
|
||||
return [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue