(
cls,
tools: Optional[List[ChatTemplateTool]],
)
| 5208 | |
| 5209 | @classmethod |
| 5210 | def _cached_tool_schema_map( |
| 5211 | cls, |
| 5212 | tools: Optional[List[ChatTemplateTool]], |
| 5213 | ) -> Dict[str, Dict[str, Any]]: |
| 5214 | if tools is None: |
| 5215 | return {} |
| 5216 | cache_key = id(tools) |
| 5217 | cached = cls._TOOL_SCHEMA_CACHE.get(cache_key) |
| 5218 | if cached is not None and cached[0] is tools: |
| 5219 | return cached[1] |
| 5220 | mapping = cls._tool_schema_map(tools) |
| 5221 | cls._TOOL_SCHEMA_CACHE[cache_key] = (tools, mapping) |
| 5222 | return mapping |
| 5223 | |
| 5224 | def _parameter_schema_for_tool( |
| 5225 | self, tool_name: str, parameter_name: str |
no test coverage detected