A simple CLI tool to store, retrieve, and clear conversation contexts. Contexts are saved as JSON, keyed by channel/user/thread IDs. This is a utility library, not an auto-integration plugin.
Store a conversation:
python3 scripts/context_manager.py store --channel "telegram-123" --user "user-456" --message "Hello" --response "Hi there"
Retrieve context:
python3 scripts/context_manager.py retrieve --channel "telegram-123" --user "user-456"
Clear context:
python3 scripts/context_manager.py clear --channel "telegram-123"
List all contexts:
python3 scripts/context_manager.py list
Store:
python3 scripts/context_manager.py store --channel "discord-general" --user "john" --message "What is AI?" --response "AI is artificial intelligence."
Retrieve:
python3 scripts/context_manager.py retrieve --channel "discord-general" --user "john"
Output:
{
"channel_id": "discord-general",
"user_id": "john",
"history": [{"message": "What is AI?", "response": "AI is artificial intelligence."}]
}
共 1 个版本