MCPcopy Create free account
hub / github.com/NVIDIA-NeMo/Switchyard / get

Method get

switchyard/lib/session_cache.py:29–35  ·  view source on GitHub ↗

Return a cached value and mark it as most recently used.

(self, key: str)

Source from the content-addressed store, hash-verified

27 return self._max_sessions
28
29 def get(self, key: str) -> _V | None:
30 """Return a cached value and mark it as most recently used."""
31 value = self._values.get(key, _MISSING)
32 if value is _MISSING:
33 return None
34 self._values.move_to_end(key)
35 return cast(_V, value)
36
37 def put(self, key: str, value: _V) -> None:
38 """Insert a value and evict the least recently used entry if needed."""

Callers 15

_is_opted_outFunction · 0.45
_nonempty_headerFunction · 0.45
extract_caller_api_keyFunction · 0.45
aresponsesMethod · 0.45
estimate_model_costFunction · 0.45
estimate_costFunction · 0.45
format_cost_reportFunction · 0.45
conversation_turn_numberFunction · 0.45
_count_responses_turnFunction · 0.45
resolve_session_keyFunction · 0.45
pinnedMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected