Skip to content

bryanlan/multichatplayground

Repository files navigation

Multichatplayground is a cool wrapper for Gradio that makes it super easy to build chatbot demos that use multiple local and remote models concurrently.

image image image

The user can enter in a prompt once and it will concurerntly execute on all models, using langchain to maintain appropriate conversational content. For non-local models, API keys will be required, and local models use ollama to execute. More models can easily be added by adding to the modelindex.py function. In addition, conversations can be saved, loaded and removed by changing the name of the active chat. image

Further, this building tool has playground like functionality where the user can go back and edit a previous response of the agent and have that updated context be used for the next prompt. For example:

image

The sample code can be found at gradiosample.py.

After setting up the UI code according to preference, the only additional code required for this multi-chatbox functionality is:

  ThreadText = ChatBot(full_path = "savedChats.json", json_object = {},full_json_object = {}, name_text_box=activeThread,
                         dropdown = thread_choice, clear_button= clear_chat, save_button = save_button, remove_button = remove_button,
                         primary_chatbot=chatbot,secondary_chatbots=model_chatbots, model_specs = model_specs, model_choice=model_choice, 
                         temp_slider=temp_slider, msg = msg,sys_msg_text= "System: You are a helpful assistant")
  ThreadText.bind_event_handlers()
  ThreadText.initialize()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages