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

Allow gr.Chatbot to accept messages in the openai format #7118

Closed
abidlabs opened this issue Jan 23, 2024 · 2 comments · Fixed by #8422
Closed

Allow gr.Chatbot to accept messages in the openai format #7118

abidlabs opened this issue Jan 23, 2024 · 2 comments · Fixed by #8422
Assignees
Labels
💬 Chatbot Related to the Chatbot component enhancement New feature or request

Comments

@abidlabs
Copy link
Member

The openai spec for chatbots has become the standard for llms, we should support messages in that format (which is essentially a list of dictionaries) for the gr.Chatbot.

@abidlabs abidlabs added the enhancement New feature or request label Jan 23, 2024
@abidlabs
Copy link
Member Author

I realized that this is actually not as advantageous as I thought. The main bottleneck when using gr.ChatInterface is that the history needs to be converted from the format it is stored by the gr.Chatbot to a format that is acceptable by openai/langchain. We could make the switch but then we'd be pretty vendor-specific and it would not be backwards-compatible.

See code examples here: https://www.gradio.app/guides/creating-a-chatbot-fast#a-langchain-example

Let's close this issue as I don't see a way to do a closer integration in a backwards-compatible way.

@abidlabs
Copy link
Member Author

abidlabs commented Apr 9, 2024

Reopening to see if there's any way we could support both: cc @dawoodkhan82 @pngwn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬 Chatbot Related to the Chatbot component enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants