File size: 702 Bytes
0e3ca79 5fc21ba 0e3ca79 2923bfa 5fc21ba a259889 0e3ca79 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
import gradio as gr
import g4f
from g4f.Provider import (
Ails,
You,
Bing,
Yqcloud,
Theb,
Aichat,
Lockchat,
Liaobots,
H2o,
ChatgptLogin,
DeepAi,
GetGpt
)
def chatbot_interaction(input_text):
response = g4f.ChatCompletion.create(model='gpt-3.5-turbo', provider=Aichat , messages=[
{"role": "user", "content": input_text }], stream=False)
print(response)
return response
iface = gr.Interface(
fn=chatbot_interaction,
inputs="text",
outputs="text",
layout="vertical",
title="Chatbot",
description="Interact with a chatbot based on GPT-3.5 Turbo."
)
iface.launch()
|