diff --git a/ping_server.py b/ping_server.py index a22227e..e22c9d3 100644 --- a/ping_server.py +++ b/ping_server.py @@ -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}')] @@ -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}") diff --git a/search_agent_bq.py b/search_agent_bq.py index 511e9f3..7cb021b 100644 --- a/search_agent_bq.py +++ b/search_agent_bq.py @@ -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 @@ -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