-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gml 1824 regression test with cypher support and no hallucination and usefulness check #248
Changes from 46 commits
19c51f2
762073a
37607e4
bde5495
b1ae116
5df8c5d
15f6d26
98b1ca2
8d4a14d
73f747d
1ef9edf
1bbafd4
c967fd4
f617e36
acca996
476f7e2
7625adb
5a511c5
3f216ba
7e1604d
7cde6ba
891e20a
7a5061e
82fc405
23fcb8f
d5b9445
fc1ec3b
2e2c801
25c3fac
fe5c156
d1730b3
aade42f
9f01ff0
0ec4d73
3654479
4d0d975
00e0a94
5b9af2c
e21fd6a
a636417
cc0a9ba
a609fe7
2cbef47
0cdb1c9
da3cdbb
21e2876
3f29937
bd35e71
7061aef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import logging | ||
import json | ||
import time | ||
from typing import Dict, List | ||
|
||
|
@@ -90,7 +91,7 @@ def __init__( | |
self.embedding_store, | ||
self.mq2s, | ||
self.gen_func, | ||
cypher_gen_tool=self.cypher_tool, | ||
# cypher_gen_tool=self.cypher_tool, | ||
q=self.q, | ||
supportai_retriever=supportai_retriever | ||
).create_graph() | ||
|
@@ -119,20 +120,28 @@ def question_for_agent( | |
|
||
input_data = {} | ||
input_data["input"] = question | ||
logger.info(f"conversation: {conversation}") | ||
|
||
if conversation is not None: | ||
input_data["conversation"] = [ | ||
{"query": chat["query"], "response": chat["response"]} | ||
for chat in conversation | ||
] | ||
|
||
else: | ||
# Handle the case where conversation is None or empty | ||
input_data["conversation"] = [] | ||
logger.info(f"input_data: {input_data}") | ||
|
||
for output in self.agent.stream({"question": str(input_data)}): | ||
# Validate and convert input_data to JSON string | ||
try: | ||
input_data_str = json.dumps(input_data) | ||
except (TypeError, ValueError) as e: | ||
logger.error(f"Failed to serialize input_data to JSON: {e}") | ||
raise ValueError("Invalid input data format. Unable to convert to JSON.") | ||
|
||
for output in self.agent.stream({"question": input_data["input"], "conversation": input_data["conversation"]}): | ||
|
||
for key, value in output.items(): | ||
logger.info(f"testing steps {key}: {value}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed this line. Do we need to log all the questions and generated answer? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can comment it out. It was trying to understand which step went wrong during testing. I will remove it in next PR. |
||
LogWriter.info(f"request_id={req_id_cv.get()} executed node {key}") | ||
|
||
LogWriter.info(f"request_id={req_id_cv.get()} EXIT question_for_agent") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just double check, is cypher support still available and optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch. just added it back. should be good to go.