MCPcopy
hub / github.com/PromtEngineer/localGPT / test_index

Method test_index

create_index_script.py:239–258  ·  view source on GitHub ↗

Test the created index with a sample query.

(self, index_id: str)

Source from the content-addressed store, hash-verified

237 traceback.print_exc()
238
239 def test_index(self, index_id: str) -> None:
240 """Test the created index with a sample query."""
241 try:
242 print("\n🧪 Testing Index")
243 print("=" * 50)
244
245 # Get agent for testing
246 agent = get_agent("default")
247
248 # Test query
249 test_query = self.get_user_input("Enter a test query", "What is this document about?")
250
251 print(f"\nProcessing query: {test_query}")
252 response = agent.run(test_query, table_name=f"text_pages_{index_id}")
253
254 print(f"\n🤖 Response:")
255 print(response)
256
257 except Exception as e:
258 print(f"❌ Error testing index: {e}")
259
260 def batch_create_from_config(self, config_file: str) -> None:
261 """Create index from batch configuration file."""

Callers 1

Calls 3

get_user_inputMethod · 0.95
get_agentFunction · 0.90
runMethod · 0.45

Tested by

no test coverage detected