Skip to content

Quick script that gives your instance of GPT4 on discord a memory instead of just calling the API every time.

License

Notifications You must be signed in to change notification settings

masonthemaker/GPT4-Discord-Memory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

GPT4-Discord-Memory

A general script that keeps the history of a conversation. This script creates a dictionary that maps channel IDs to conversation histories. A conversation history consists of a list of message objects, which include the role (either 'user' or 'assistant') and the content of the message.

This is a simple version and there are many ways you might wish to modify it, including handling edge cases, error situations, and managing the length of the conversation history to not exceed OpenAI's token limit. The conversation_histories dictionary stores the history of conversations for each channel. Each time a message is received, the conversation history is updated with the user's message. The conversation history is then passed to GPT-4, and the assistant's response is added to the conversation history. The conversation history for each channel is persisted as long as the bot is running, allowing for ongoing conversations in each channel.

About

Quick script that gives your instance of GPT4 on discord a memory instead of just calling the API every time.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages