feat: add MCP tool integration

This commit is contained in:
Xin Wang
2026-07-18 00:00:06 +08:00
parent bdf3d3dd9c
commit e39bb48ba8
21 changed files with 1641 additions and 62 deletions

View File

@@ -15,6 +15,18 @@ from pydantic import BaseModel, Field
RuntimeMode = Literal["pipeline", "realtime"]
class RuntimeMcpServer(BaseModel):
"""Resolved MCP connection containing secrets for one runtime session."""
id: str
name: str = ""
transport: str = "streamable_http"
url: str
timeout_seconds: int = 30
headers: dict[str, str] = Field(default_factory=dict)
secret_headers: dict[str, str] = Field(default_factory=dict)
class RuntimeTool(BaseModel):
"""Tool data resolved from an assistant binding for one runtime session."""
@@ -25,6 +37,7 @@ class RuntimeTool(BaseModel):
description: str = ""
definition: dict = Field(default_factory=dict)
secrets: dict = Field(default_factory=dict)
mcp_server: RuntimeMcpServer | None = None
class RuntimeModelResource(BaseModel):