MCPcopy Create free account
hub / github.com/nlweb-ai/NLWeb / run_query_tests

Function run_query_tests

AskAgent/python/testing/test_with_clean_db.py:92–119  ·  view source on GitHub ↗

Run standard query tests

()

Source from the content-addressed store, hash-verified

90
91
92async def run_query_tests():
93 """Run standard query tests"""
94 print("\n" + "="*60)
95 print("RUNNING QUERY TESTS")
96 print("="*60)
97
98 retriever = get_vector_db_client()
99
100 queries = [
101 ("machine learning", "all"),
102 ("artificial intelligence", "all"),
103 ("python programming", "all"),
104 ("spicy crunchy snacks", "seriouseats"),
105 ("latest technology news", "all")
106 ]
107
108 results_summary = []
109
110 for query, site in queries:
111 try:
112 results = await retriever.search(query, site, num_results=50)
113 summary = await analyze_query_results(query, site, results)
114 results_summary.append(summary)
115 await asyncio.sleep(0.5)
116 except Exception as e:
117 print(f"\nError with query '{query}': {e}")
118
119 return results_summary
120
121
122async def load_rss_feed(url, site_name):

Callers 1

mainFunction · 0.70

Calls 3

get_vector_db_clientFunction · 0.90
analyze_query_resultsFunction · 0.85
searchMethod · 0.45

Tested by

no test coverage detected