|
19 | 19 | from .._run_context import RunContext |
20 | 20 | from .._thinking_part import split_content_into_text_and_thinking |
21 | 21 | from .._utils import guard_tool_call_id as _guard_tool_call_id, now_utc as _now_utc, number_to_datetime |
22 | | -from ..builtin_tools import CodeExecutionTool, ImageGenerationTool, MCPServerTool, WebSearchTool |
| 22 | +from ..builtin_tools import AbstractBuiltinTool, CodeExecutionTool, ImageGenerationTool, MCPServerTool, WebSearchTool |
23 | 23 | from ..exceptions import UserError |
24 | 24 | from ..messages import ( |
25 | 25 | AudioUrl, |
@@ -425,9 +425,9 @@ def system(self) -> str: |
425 | 425 | return self._provider.name |
426 | 426 |
|
427 | 427 | @classmethod |
428 | | - def supported_builtin_tools(cls) -> frozenset[str]: |
429 | | - """Return the set of builtin tool IDs this model class can handle.""" |
430 | | - return frozenset({'web_search'}) |
| 428 | + def supported_builtin_tools(cls) -> frozenset[type[AbstractBuiltinTool]]: |
| 429 | + """Return the set of builtin tool types this model class can handle.""" |
| 430 | + return frozenset({WebSearchTool}) |
431 | 431 |
|
432 | 432 | @property |
433 | 433 | @deprecated('Set the `system_prompt_role` in the `OpenAIModelProfile` instead.') |
@@ -1097,9 +1097,9 @@ def system(self) -> str: |
1097 | 1097 | return self._provider.name |
1098 | 1098 |
|
1099 | 1099 | @classmethod |
1100 | | - def supported_builtin_tools(cls) -> frozenset[str]: |
1101 | | - """Return the set of builtin tool IDs this model class can handle.""" |
1102 | | - return frozenset({'web_search', 'code_execution', 'mcp_server', 'image_generation'}) |
| 1100 | + def supported_builtin_tools(cls) -> frozenset[type[AbstractBuiltinTool]]: |
| 1101 | + """Return the set of builtin tool types this model class can handle.""" |
| 1102 | + return frozenset({WebSearchTool, CodeExecutionTool, MCPServerTool, ImageGenerationTool}) |
1103 | 1103 |
|
1104 | 1104 | async def request( |
1105 | 1105 | self, |
|
0 commit comments