Test the created index with a sample query.
(self, index_id: str)
| 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.""" |
no test coverage detected