added a fix

This commit is contained in:
Omar Abdelwahab 2025-11-03 16:55:13 -08:00
parent c49fef8087
commit 1143db0f64
6 changed files with 81 additions and 71 deletions

View file

@ -403,7 +403,11 @@ class OpenAIResponseText(BaseModel):
# Must match type Literals of OpenAIResponseInputToolWebSearch below
WebSearchToolTypes = ["web_search", "web_search_preview", "web_search_preview_2025_03_11"]
WebSearchToolTypes = [
"web_search",
"web_search_preview",
"web_search_preview_2025_03_11",
]
@json_schema_type
@ -480,14 +484,14 @@ class AllowedToolsFilter(BaseModel):
@json_schema_type
class MCPAuthentication(BaseModel):
"""Authentication configuration for MCP servers.
class MCPAuthorization(BaseModel):
"""Authorization configuration for MCP servers.
:param type: Authentication type ("bearer", "basic", or "api_key")
:param token: Bearer token for bearer authentication
:param username: Username for basic authentication
:param password: Password for basic authentication
:param api_key: API key for api_key authentication
:param type: Authorization type ("bearer", "basic", or "api_key")
:param token: Bearer token for bearer authorization
:param username: Username for basic authorization
:param password: Password for basic authorization
:param api_key: API key for api_key authorization
:param header_name: Custom header name for API key (default: "X-API-Key")
"""
@ -507,7 +511,7 @@ class OpenAIResponseInputToolMCP(BaseModel):
:param server_label: Label to identify this MCP server
:param server_url: URL endpoint of the MCP server
:param headers: (Optional) HTTP headers to include when connecting to the server
:param authentication: (Optional) Authentication configuration for the MCP server
:param authorization: (Optional) Authorization configuration for the MCP server
:param require_approval: Approval requirement for tool calls ("always", "never", or filter)
:param allowed_tools: (Optional) Restriction on which tools can be used from this server
"""
@ -516,7 +520,7 @@ class OpenAIResponseInputToolMCP(BaseModel):
server_label: str
server_url: str
headers: dict[str, Any] | None = None
authentication: MCPAuthentication | None = None
authorization: MCPAuthorization | None = None
require_approval: Literal["always"] | Literal["never"] | ApprovalFilter = "never"
allowed_tools: list[str] | AllowedToolsFilter | None = None