Documentation ¶
Overview ¶
Package convcache implements a Starlark module for caching conversations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Module ¶
func Module(ttl time.Duration) *starlarkstruct.Module
Module returns a Starlark module that exposes conversation caching functionality.
This module provides three functions:
- get(chat_id: int) -> list: Retrieves the conversation history for the given chat ID.
- append(chat_id: int, message: str): Appends a new message to the conversation history.
- reset(chat_id: int): Clears the conversation history for the given chat ID.
The chat ID is an integer representing a unique conversation identifier.
The ttl argument specifies the time-to-live duration after which a cache entry will expire.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.