test999999 / app.py
gugebing's picture
Update app.py
70f667a
raw
history blame contribute delete
603 Bytes
import poe
import logging
import sys
import gradio as gr
# Initialize the chatbot client
token ="iNgEtszY-dWacyyqFrsSqw%3D%3D"
client = poe.Client(token)
# Define the chatbot function
def chatbot(message):
# Send the user's message to the chatbot
# respond=""
# for chunk in client.send_message("chinchilla", message):
# response += chunk["text_new"]
# return response
return client.send_message("chinchilla", message)
# Create the Gradio interface
iface = gr.Interface(fn=chatbot, inputs="text", outputs="text", title="Chatbot")
# Run the interface
iface.launch()