MCPcopy Create free account
hub / github.com/BerriAI/litellm / async_set_cache_sadd

Method async_set_cache_sadd

litellm/caching/in_memory_cache.py:185–194  ·  view source on GitHub ↗

Add value to set

(self, key, value: List, ttl: Optional[float])

Source from the content-addressed store, hash-verified

183 self.set_cache(key=cache_key, value=cache_value)
184
185 async def async_set_cache_sadd(self, key, value: List, ttl: Optional[float]):
186 """
187 Add value to set
188 """
189 # get the value
190 init_value = self.get_cache(key=key) or set()
191 for val in value:
192 init_value.add(val)
193 self.set_cache(key, init_value, ttl=ttl)
194 return value
195
196 def evict_element_if_expired(self, key: str) -> bool:
197 """

Callers

nothing calls this directly

Calls 4

get_cacheMethod · 0.95
set_cacheMethod · 0.95
setFunction · 0.50
addMethod · 0.45

Tested by

no test coverage detected