mirror of
https://github.com/meta-llama/llama-stack.git
synced 2026-01-02 12:00:00 +00:00
fix(api): don't return list for runtime tools
Use Response object instead. Enforce no GET endpoints return lists. Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
This commit is contained in:
parent
b440a1dc42
commit
508381a81d
13 changed files with 167 additions and 105 deletions
|
|
@ -88,6 +88,10 @@ class ListToolsResponse(BaseModel):
|
|||
data: List[Tool]
|
||||
|
||||
|
||||
class ListToolDefsResponse(BaseModel):
|
||||
data: list[ToolDef]
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
@trace_protocol
|
||||
class ToolGroups(Protocol):
|
||||
|
|
@ -148,7 +152,7 @@ class ToolRuntime(Protocol):
|
|||
@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]: ...
|
||||
) -> ListToolDefsResponse: ...
|
||||
|
||||
@webmethod(route="/tool-runtime/invoke", method="POST")
|
||||
async def invoke_tool(self, tool_name: str, kwargs: Dict[str, Any]) -> ToolInvocationResult:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue