MCPcopy Create free account
hub / github.com/nlweb-ai/NLWeb / _warm_cache

Method _warm_cache

AskAgent/python/core/router.py:225–230  ·  view source on GitHub ↗

Warm the cache for common types.

(self)

Source from the content-addressed store, hash-verified

223 return _load_tools_from_file(tools_xml_path, site_id)
224
225 def _warm_cache(self):
226 """Warm the cache for common types."""
227 logger.info("Warming tools cache for common types")
228 for schema_type in self.PRE_CACHE_TYPES:
229 tools = self.get_tools_by_type(schema_type)
230 logger.info(f"Cached {len(tools)} tools for type: {schema_type}")
231
232 async def _evaluate_tools_with_early_termination(self, query: str, tools: list[Tool], threshold: int = 79) -> list[dict]:
233 """Evaluate tools asynchronously with early termination for high-scoring results.

Callers 1

__init__Method · 0.95

Calls 2

get_tools_by_typeMethod · 0.95
infoMethod · 0.45

Tested by

no test coverage detected