pub struct LarkBitableLlmCache { /* private fields */ }Expand description
A team-shared LLM response cache stored in a Feishu Bitable table.
Each row represents one cached response, keyed by cache_key. Hit counts
are tracked in a hit_count field and are visible directly in the Feishu
spreadsheet, making cache utilisation observable without additional tooling.
§Bitable table schema
| Field name | Type | Notes |
|---|---|---|
cache_key | Text | Unique cache key |
response_json | Text | Serialised ChatResponse |
hit_count | Text | Number of cache hits (string) |
created_at | Text | Unix timestamp (seconds) |
Implementations§
Trait Implementations§
Source§impl LlmCache for LarkBitableLlmCache
impl LlmCache for LarkBitableLlmCache
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ChatResponse>, SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ChatResponse>, SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up a cached response by cache key.
Source§fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
response: &'life2 ChatResponse,
) -> Pin<Box<dyn Future<Output = Result<(), SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
response: &'life2 ChatResponse,
) -> Pin<Box<dyn Future<Output = Result<(), SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store a response in the cache.
Auto Trait Implementations§
impl Freeze for LarkBitableLlmCache
impl !RefUnwindSafe for LarkBitableLlmCache
impl Send for LarkBitableLlmCache
impl Sync for LarkBitableLlmCache
impl Unpin for LarkBitableLlmCache
impl UnsafeUnpin for LarkBitableLlmCache
impl !UnwindSafe for LarkBitableLlmCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more