mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-05 18:22:41 +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": {
|
"/alpha/scoring-functions/list": {
|
||||||
"get": {
|
"get": {
|
||||||
"responses": {
|
"responses": {
|
||||||
|
@ -1858,7 +1906,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"ToolRuntime"
|
"ToolGroups"
|
||||||
],
|
],
|
||||||
"summary": "List tools with optional tool group",
|
"summary": "List tools with optional tool group",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
@ -6207,6 +6255,15 @@
|
||||||
"provider_types"
|
"provider_types"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"ListRuntimeToolsRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"mcp_endpoint": {
|
||||||
|
"$ref": "#/components/schemas/URL"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"LogSeverity": {
|
"LogSeverity": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
@ -8189,6 +8246,10 @@
|
||||||
"name": "LLMAsJudgeScoringFnParams",
|
"name": "LLMAsJudgeScoringFnParams",
|
||||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/LLMAsJudgeScoringFnParams\" />"
|
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/LLMAsJudgeScoringFnParams\" />"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "ListRuntimeToolsRequest",
|
||||||
|
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ListRuntimeToolsRequest\" />"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "LogEventRequest",
|
"name": "LogEventRequest",
|
||||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/LogEventRequest\" />"
|
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/LogEventRequest\" />"
|
||||||
|
@ -8706,6 +8767,7 @@
|
||||||
"KeywordMemoryBank",
|
"KeywordMemoryBank",
|
||||||
"KeywordMemoryBankParams",
|
"KeywordMemoryBankParams",
|
||||||
"LLMAsJudgeScoringFnParams",
|
"LLMAsJudgeScoringFnParams",
|
||||||
|
"ListRuntimeToolsRequest",
|
||||||
"LogEventRequest",
|
"LogEventRequest",
|
||||||
"LogSeverity",
|
"LogSeverity",
|
||||||
"LoraFinetuningConfig",
|
"LoraFinetuningConfig",
|
||||||
|
|
|
@ -1122,6 +1122,12 @@ components:
|
||||||
- type
|
- type
|
||||||
- judge_model
|
- judge_model
|
||||||
type: object
|
type: object
|
||||||
|
ListRuntimeToolsRequest:
|
||||||
|
additionalProperties: false
|
||||||
|
properties:
|
||||||
|
mcp_endpoint:
|
||||||
|
$ref: '#/components/schemas/URL'
|
||||||
|
type: object
|
||||||
LogEventRequest:
|
LogEventRequest:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
properties:
|
properties:
|
||||||
|
@ -4919,6 +4925,9 @@ tags:
|
||||||
- description: <SchemaDefinition schemaRef="#/components/schemas/LLMAsJudgeScoringFnParams"
|
- description: <SchemaDefinition schemaRef="#/components/schemas/LLMAsJudgeScoringFnParams"
|
||||||
/>
|
/>
|
||||||
name: LLMAsJudgeScoringFnParams
|
name: LLMAsJudgeScoringFnParams
|
||||||
|
- description: <SchemaDefinition schemaRef="#/components/schemas/ListRuntimeToolsRequest"
|
||||||
|
/>
|
||||||
|
name: ListRuntimeToolsRequest
|
||||||
- description: <SchemaDefinition schemaRef="#/components/schemas/LogEventRequest"
|
- description: <SchemaDefinition schemaRef="#/components/schemas/LogEventRequest"
|
||||||
/>
|
/>
|
||||||
name: LogEventRequest
|
name: LogEventRequest
|
||||||
|
@ -5290,6 +5299,7 @@ x-tagGroups:
|
||||||
- KeywordMemoryBank
|
- KeywordMemoryBank
|
||||||
- KeywordMemoryBankParams
|
- KeywordMemoryBankParams
|
||||||
- LLMAsJudgeScoringFnParams
|
- LLMAsJudgeScoringFnParams
|
||||||
|
- ListRuntimeToolsRequest
|
||||||
- LogEventRequest
|
- LogEventRequest
|
||||||
- LogSeverity
|
- LogSeverity
|
||||||
- LoraFinetuningConfig
|
- LoraFinetuningConfig
|
||||||
|
|
|
@ -130,8 +130,8 @@ class ToolGroups(Protocol):
|
||||||
class ToolRuntime(Protocol):
|
class ToolRuntime(Protocol):
|
||||||
tool_store: ToolStore
|
tool_store: ToolStore
|
||||||
|
|
||||||
@webmethod(route="/tool-runtime/list-tools", method="POST")
|
@webmethod(route="/tool-runtime/list-tools", method="GET")
|
||||||
async def list_tools(
|
async def list_runtime_tools(
|
||||||
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||||
) -> List[ToolDef]: ...
|
) -> List[ToolDef]: ...
|
||||||
|
|
||||||
|
|
|
@ -417,7 +417,7 @@ class ToolRuntimeRouter(ToolRuntime):
|
||||||
args=args,
|
args=args,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def list_tools(
|
async def list_runtime_tools(
|
||||||
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||||
) -> List[ToolDef]:
|
) -> List[ToolDef]:
|
||||||
return await self.routing_table.get_provider_impl(tool_group_id).list_tools(
|
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,
|
args: Optional[Dict[str, Any]] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
tools = []
|
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
|
toolgroup_id, mcp_endpoint
|
||||||
)
|
)
|
||||||
tool_host = (
|
tool_host = (
|
||||||
|
|
|
@ -44,7 +44,7 @@ class CodeInterpreterToolRuntimeImpl(ToolsProtocolPrivate, ToolRuntime):
|
||||||
async def unregister_tool(self, tool_id: str) -> None:
|
async def unregister_tool(self, tool_id: str) -> None:
|
||||||
return
|
return
|
||||||
|
|
||||||
async def list_tools(
|
async def list_runtime_tools(
|
||||||
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||||
) -> List[ToolDef]:
|
) -> List[ToolDef]:
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -51,7 +51,7 @@ class MemoryToolRuntimeImpl(ToolsProtocolPrivate, ToolRuntime):
|
||||||
async def initialize(self):
|
async def initialize(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def list_tools(
|
async def list_runtime_tools(
|
||||||
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||||
) -> List[ToolDef]:
|
) -> List[ToolDef]:
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -51,7 +51,7 @@ class BingSearchToolRuntimeImpl(
|
||||||
)
|
)
|
||||||
return provider_data.api_key
|
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
|
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||||
) -> List[ToolDef]:
|
) -> List[ToolDef]:
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -49,7 +49,7 @@ class BraveSearchToolRuntimeImpl(
|
||||||
)
|
)
|
||||||
return provider_data.api_key
|
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
|
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||||
) -> List[ToolDef]:
|
) -> List[ToolDef]:
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -29,7 +29,7 @@ class ModelContextProtocolToolRuntimeImpl(ToolsProtocolPrivate, ToolRuntime):
|
||||||
async def initialize(self):
|
async def initialize(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def list_tools(
|
async def list_runtime_tools(
|
||||||
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||||
) -> List[ToolDef]:
|
) -> List[ToolDef]:
|
||||||
if mcp_endpoint is None:
|
if mcp_endpoint is None:
|
||||||
|
|
|
@ -50,7 +50,7 @@ class TavilySearchToolRuntimeImpl(
|
||||||
)
|
)
|
||||||
return provider_data.api_key
|
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
|
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||||
) -> List[ToolDef]:
|
) -> List[ToolDef]:
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -51,7 +51,7 @@ class WolframAlphaToolRuntimeImpl(
|
||||||
)
|
)
|
||||||
return provider_data.api_key
|
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
|
self, tool_group_id: Optional[str] = None, mcp_endpoint: Optional[URL] = None
|
||||||
) -> List[ToolDef]:
|
) -> List[ToolDef]:
|
||||||
return [
|
return [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue