Elfe commited on
Commit
d663feb
1 Parent(s): cc2a765

update with baixing api

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -1,7 +1,12 @@
1
  import gradio as gr
 
2
 
3
- def chat(p, qid, uid):
4
- return ["text", f"我听到你刚说:{p}"]
 
 
 
 
5
 
6
  iface = gr.Interface(fn=chat,
7
  inputs=["text", "text", "text"],
 
1
  import gradio as gr
2
+ import requests
3
 
4
+ key = os.getenv("baixing_key")
5
+ url = "https://gpt.baixing.com/"
6
+
7
+ def chat(p, qid, uid):
8
+ result = requests.get(url, params={"p": p, "k": key}).json()['data']
9
+ return ["text", result]
10
 
11
  iface = gr.Interface(fn=chat,
12
  inputs=["text", "text", "text"],