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

Chat history in notebook magics for Chat model providers #392

Open
3coins opened this issue Sep 22, 2023 · 1 comment
Open

Chat history in notebook magics for Chat model providers #392

3coins opened this issue Sep 22, 2023 · 1 comment
Labels
bug Something isn't working priority

Comments

@3coins
Copy link
Collaborator

3coins commented Sep 22, 2023

Problem

The current magics implementation is using an artificial list of chat message history to keep track of exchanges between 2 or more cells when openai-chat model is used. Although, this might have the appearance of working as expected for OpenAI, this is not translatable and scalable to other chat model providers, for example ChatAnthropic.

Solution

Create a conversation chain and memory to generate messages for providers that support BaseChatModel. Using the memory class in an LLM chain automatically keeps track of message history and avoid manual tracking of exchanges. This also helps in future proofing the magics implementation for new chat providers that will be introduced in future.

@3coins 3coins added the bug Something isn't working label Sep 22, 2023
@JasonWeill
Copy link
Collaborator

The OpenAI chat model history was removed in #551, when we upgraded to a newer version of the OpenAI provider. If we reintroduce this feature, we should make it work with as many model providers as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority
Projects
None yet
Development

No branches or pull requests

3 participants