You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from fastapi import FastAPI
import gradio as gr
import os
from dotenv import load_dotenv
from openai import OpenAI
import os
import requests
import json
from typing import List
from dotenv import load_dotenv
from bs4 import BeautifulSoup
from IPython.display import Markdown, display, update_display
from openai import OpenAI
from kubernetes import client, config
from fastapi import FastAPI
import gradio as gr
CUSTOM_PATH = "/gradio"
app = FastAPI()
@app.get("/")
def read_main():
def greet(name, history):
return "Hello " + name + "!"
io = gr.ChatInterface(fn=greet, type="messages", chatbot=gr.Chatbot(value=[(None, "Welcome 👋. I am an assistant")],),)
app = gr.mount_gradio_app(app, io, path=CUSTOM_PATH)
Above code is not working. On the UI there is no error and continuously loading and loading. I opened console logs in the browser and I saw below error.
Uncaught (in promise) TypeError: right-hand side of 'in' should be an object, got undefined
importgradioasgrdefgreet(name, history):
return"Hello "+name+"!"gr.ChatInterface(fn=greet, type="messages", chatbot=gr.Chatbot(value=[(None, "Welcome 👋. I am an assistant")],),)
Hi @hassanbsee2071 you are mixing up the format of the messages. You have specified type="messages" but you are supplying the Chatbot value as "tuples". Please see the chatbot docs:
Describe the bug
Hi Team,
I used below code to add welcome message.
Above code is not working. On the UI there is no error and continuously loading and loading. I opened console logs in the browser and I saw below error.
I tried with same code here
https://stackoverflow.com/questions/76416674/welcome-message-in-python-chatbot-using-gradio-and-openai-api
and here
#7925
but still getting the same result.
Have you searched existing issues? 🔎
Reproduction
Screenshot
No response
Logs
System Info
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered: