Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -45,9 +45,9 @@ def stream_chat_with_rag(
|
|
45 |
question = message
|
46 |
#answer = client.predict(question=question, api_name="/run_graph")
|
47 |
answer = client.predict(
|
48 |
-
|
49 |
-
context="
|
50 |
-
election_year=
|
51 |
api_name="/process_query"
|
52 |
)
|
53 |
|
@@ -55,14 +55,14 @@ def stream_chat_with_rag(
|
|
55 |
print("Raw answer from API:")
|
56 |
print(answer)
|
57 |
|
58 |
-
# Format the assistant's answer and the relevant documents separately
|
59 |
-
formatted_answer = format_answer_string(answer)
|
60 |
|
61 |
-
# Update the conversation history with the new message and answer
|
62 |
-
history.append((message, formatted_answer))
|
63 |
|
64 |
# Return the formatted answer
|
65 |
-
return
|
66 |
|
67 |
|
68 |
def format_answer_string(answer: str):
|
|
|
45 |
question = message
|
46 |
#answer = client.predict(question=question, api_name="/run_graph")
|
47 |
answer = client.predict(
|
48 |
+
query= message,
|
49 |
+
context="",
|
50 |
+
election_year=client_name,
|
51 |
api_name="/process_query"
|
52 |
)
|
53 |
|
|
|
55 |
print("Raw answer from API:")
|
56 |
print(answer)
|
57 |
|
58 |
+
# # Format the assistant's answer and the relevant documents separately
|
59 |
+
# formatted_answer = format_answer_string(answer)
|
60 |
|
61 |
+
# # Update the conversation history with the new message and answer
|
62 |
+
# history.append((message, formatted_answer))
|
63 |
|
64 |
# Return the formatted answer
|
65 |
+
return answer
|
66 |
|
67 |
|
68 |
def format_answer_string(answer: str):
|