MCPcopy Index your code
hub / github.com/abetlen/llama-cpp-python / _cached_tool_schema_map

Method _cached_tool_schema_map

examples/server/server.py:5210–5222  ·  view source on GitHub ↗
(
        cls,
        tools: Optional[List[ChatTemplateTool]],
    )

Source from the content-addressed store, hash-verified

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

Callers 1

__init__Method · 0.95

Calls 1

_tool_schema_mapMethod · 0.80

Tested by

no test coverage detected