convcache

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2024 License: ISC Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL