mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-04 02:03:44 +00:00
formatting changes
This commit is contained in:
parent
c563d8ad80
commit
2295a1aad5
2 changed files with 2 additions and 13 deletions
|
|
@ -403,11 +403,7 @@ class OpenAIResponseText(BaseModel):
|
||||||
|
|
||||||
|
|
||||||
# Must match type Literals of OpenAIResponseInputToolWebSearch below
|
# Must match type Literals of OpenAIResponseInputToolWebSearch below
|
||||||
WebSearchToolTypes = [
|
WebSearchToolTypes = ["web_search", "web_search_preview", "web_search_preview_2025_03_11"]
|
||||||
"web_search",
|
|
||||||
"web_search_preview",
|
|
||||||
"web_search_preview_2025_03_11",
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
@json_schema_type
|
@json_schema_type
|
||||||
|
|
@ -500,7 +496,6 @@ class OpenAIResponseInputToolMCP(BaseModel):
|
||||||
server_label: str
|
server_label: str
|
||||||
server_url: str
|
server_url: str
|
||||||
headers: dict[str, Any] | None = None
|
headers: dict[str, Any] | None = None
|
||||||
# Authorization is excluded from serialization for security (never returned in responses)
|
|
||||||
authorization: str | None = Field(default=None, exclude=True)
|
authorization: str | None = Field(default=None, exclude=True)
|
||||||
|
|
||||||
require_approval: Literal["always"] | Literal["never"] | ApprovalFilter = "never"
|
require_approval: Literal["always"] | Literal["never"] | ApprovalFilter = "never"
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,6 @@ from pydantic import BaseModel
|
||||||
class MCPProviderDataValidator(BaseModel):
|
class MCPProviderDataValidator(BaseModel):
|
||||||
"""
|
"""
|
||||||
Validator for MCP provider-specific data passed via request headers.
|
Validator for MCP provider-specific data passed via request headers.
|
||||||
|
|
||||||
This data structure is passed in the X-LlamaStack-Provider-Data header
|
|
||||||
to provide MCP endpoint-specific configuration.
|
|
||||||
|
|
||||||
Example usage:
|
Example usage:
|
||||||
HTTP Request Headers:
|
HTTP Request Headers:
|
||||||
X-LlamaStack-Provider-Data: {
|
X-LlamaStack-Provider-Data: {
|
||||||
|
|
@ -29,18 +25,16 @@ class MCPProviderDataValidator(BaseModel):
|
||||||
"http://weather-mcp.com": "weather_api_token_xyz"
|
"http://weather-mcp.com": "weather_api_token_xyz"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Security Note:
|
Security Note:
|
||||||
- Authorization header MUST NOT be placed in mcp_headers
|
- Authorization header MUST NOT be placed in mcp_headers
|
||||||
- Use the dedicated mcp_authorization field instead
|
- Use the dedicated mcp_authorization field instead
|
||||||
- Each MCP endpoint can have its own separate token
|
- Each MCP endpoint can have its own separate token
|
||||||
- Tokens are provided WITHOUT the "Bearer " prefix (added automatically)
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# mcp_endpoint => dict of headers to send (excluding Authorization)
|
# mcp_endpoint => dict of headers to send (excluding Authorization)
|
||||||
mcp_headers: dict[str, dict[str, str]] | None = None
|
mcp_headers: dict[str, dict[str, str]] | None = None
|
||||||
|
|
||||||
# mcp_endpoint => authorization token (without "Bearer " prefix)
|
# mcp_endpoint => authorization token
|
||||||
# Example: {"http://server.com": "token123"}
|
# Example: {"http://server.com": "token123"}
|
||||||
mcp_authorization: dict[str, str] | None = None
|
mcp_authorization: dict[str, str] | None = None
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue