Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Session Management Feat. #170

Closed
ajac-zero opened this issue Jun 22, 2024 · 4 comments · Fixed by #141
Closed

Add Session Management Feat. #170

ajac-zero opened this issue Jun 22, 2024 · 4 comments · Fixed by #141
Assignees

Comments

@ajac-zero
Copy link
Contributor

Has progress begun on llm session management? It would be an awesome feature.

Currently, our apps pull past conversation messages straight from our db upon each request, identified by a conversation id.

However, saving on-going conversations in-cache would be much faster and off-load some work from the db.

Is there an idea on how this would be implemented? Or should I pr something from scratch?

@justin-cechmanek
Copy link
Collaborator

It's under development and should be available soon.

@justin-cechmanek justin-cechmanek self-assigned this Jun 24, 2024
@tylerhutcherson
Copy link
Collaborator

@ajac-zero work is available on this branch/PR
#141
Your feedback is welcomed.

@ajac-zero
Copy link
Contributor Author

Awesome! The semantic session manager is really interesting.

I noticed each exchange is expected to be a pair of strings, would this limit the use of tool messages? Due to most providers returning tool/function calls as dicts. I suppose the simplest solution would be to stringify the response dicts before storing them, although this might require additional parsing. Alternatively using json mode would work fine already if available.

Also, there are situations where a single exchange could involve more than 2 messages. Like when a llm uses tools before generating a response.

user query message -> assistant tool call message -> tool result message -> assistant response message

For cases like these it could be useful to provide the option to store messages individually to allow greater flexibility.

@justin-cechmanek justin-cechmanek linked a pull request Jun 25, 2024 that will close this issue
@justin-cechmanek
Copy link
Collaborator

Hi @ajac-zero. The session managers do have a convenience store method to add a prompt and response texts in one call. This is meant for typical prompt->response->prompt->... chats. You can also call add_message to add messages individually in the form of dicts and these include tool call messages. Can you let us know if that meets your needs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants