Skip to content

Commit

Permalink
adding testcases, fixing the harm filter,
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-dhanwant-yral committed Oct 9, 2024
1 parent fd9dd7b commit 72eeeb8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions ping_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def run():

with grpc.secure_channel(server, credentials=grpc.ssl_channel_credentials()) as channel:
stub = search_rec_pb2_grpc.SearchServiceStub(channel)
request = search_rec_pb2.SearchRequest(input_query="fire")
request = search_rec_pb2.SearchRequest(input_query="dog tokens")

# Create metadata with the token
# metadata = [('authorization', f'Bearer {token}')]
Expand All @@ -26,7 +26,7 @@ def run():
print("Search service is up and running!")
print("Received response:")
print(f"Answer: {response.answer}")
for item in response.items:
for item in response.items[:3]:
print(f"Canister ID: {item.canister_id}")
print(f"Description: {item.description}")
print(f"Host: {item.host}")
Expand Down
20 changes: 10 additions & 10 deletions search_agent_bq.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,8 @@ def calculate_fuzzy_match_ratio(word1, word2):
ndf = duckdb.sql(select_statement).to_df()

answer = ""
if True:
yaml_data = yaml.dump(ndf[self.rag_columns].head(10).to_dict(orient='records'))
answer = self.qna_llm.qna(qna_prompt.replace('__user_query__', user_query).replace('__yaml_data__', yaml_data))
yaml_data = yaml.dump(ndf[self.rag_columns].head(10).to_dict(orient='records'))
answer = self.qna_llm.qna(qna_prompt.replace('__user_query__', user_query).replace('__yaml_data__', yaml_data))
ndf['created_at'] = ndf.created_at.astype(str)
return ndf, answer

Expand Down Expand Up @@ -296,14 +295,15 @@ def run_queries_and_save_results(queries, search_agent, output_file='test_case_r

# List of queries to run
queries = [
"Show tokens like test sorted by created_at descending. What are the top 5 tokens talking about here?",
# "Show tokens like test sorted by created_at descending. What are the top 5 tokens talking about here?",
"fire",
"Show me tokens like test created last month",
"Tokens related to animals",
"Tokens related to dogs, what are the top 5 tokens talking about here?",
"Tokens created last month",
"Tokens with controversial opinions",
"Tokens with revolutionary ideas"
# "dog token",
# "Show me tokens like test created last month",
# "Tokens related to animals",
# "Tokens related to dogs, what are the top 5 tokens talking about here?",
# "Tokens created last month",
# "Tokens with controversial opinions",
# "Tokens with revolutionary ideas"
]

# Run the queries and save the results
Expand Down

0 comments on commit 72eeeb8

Please sign in to comment.