File size: 1,457 Bytes
b7adcb8
35ac490
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""gradio implementaion"""
# import gradio as gr
# import requests
# import json
# from gradio.components import Textbox, Number
#
# DEFAULT_UUID = "c40a09075d11940f"
#
#
# def gradio_send_notification(uuid: str, query: str):
#     url = "http://localhost:7860/sendNotification"
#     data = {
#         "confs": {
#             "openai_key": "",
#             "pinecone_key": "",
#             "pinecone_env": "",
#             "firebase_key": "",
#             "settings": {"temperature": 0.6},
#             "token": "eSyP3i7ITZuq8hWn2qutTl:APA91bH1FtWkaTSJwuX4WKWAl3Q-ZFyrOw4UtMP4IfwuvNrHOThH7EvEGIhtguilLRyQNlLiXatEN0xntHAc8bbKobSGjge3wxIHlspbIWY_855CzONqaVdl3y3zOmgKZNnuhYi4gwbh",
#             "uuid": uuid,
#         },
#         "message": query,
#     }
#
#     response = requests.post(
#         url, data=json.dumps(data), headers={"Content-Type": "application/json"}
#     )
#     response = response.json()
#     return json.dumps(response["result"]), response["status_code"]
#
#
# debug_send_notification = gr.Interface(
#     fn=gradio_send_notification,
#     inputs=[
#         Textbox(
#             label="UUID",
#             placeholder="Please input your UUID.",
#             value="c40a09075d11940f",
#         ),
#         Textbox(label="query", placeholder="Please input your prompt."),
#     ],
#     outputs=[
#         Textbox(label="Result"),
#         Number(label="Status Code"),
#     ],
#     allow_flagging="never",
# )