Spaces:
Sleeping
Sleeping
cececerece
commited on
Commit
•
91eccb2
1
Parent(s):
0da93dc
Delete comm.py
Browse files
comm.py
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
def run(query):
|
2 |
-
from langchain.callbacks import get_openai_callback
|
3 |
-
|
4 |
-
with get_openai_callback() as cb:
|
5 |
-
response = (agent.run(query))
|
6 |
-
costs = (f"Total Cost (USD): ${cb.total_cost}")
|
7 |
-
output = f'{response} \n {costs}'
|
8 |
-
return output
|
9 |
-
|
10 |
-
def respond(message, chat_history):
|
11 |
-
import time
|
12 |
-
|
13 |
-
bot_message = run(message)
|
14 |
-
chat_history.append((message, bot_message))
|
15 |
-
time.sleep(0.5)
|
16 |
-
return "", chat_history
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|