Runs the agentic RAG pipeline for a given query. Returns the result as a JSON string.
(query: str)
| 262 | print("✅ Indexing complete.") |
| 263 | |
| 264 | def run_chat(query: str): |
| 265 | """ |
| 266 | Runs the agentic RAG pipeline for a given query. |
| 267 | Returns the result as a JSON string. |
| 268 | """ |
| 269 | try: |
| 270 | validate_model_config() |
| 271 | ollama_client = OllamaClient(OLLAMA_CONFIG["host"]) |
| 272 | except ConnectionError as e: |
| 273 | print(e) |
| 274 | return json.dumps({"error": str(e)}, indent=2) |
| 275 | except ValueError as e: |
| 276 | print(f"Configuration Error: {e}") |
| 277 | return json.dumps({"error": f"Configuration Error: {e}"}, indent=2) |
| 278 | |
| 279 | agent = Agent(PIPELINE_CONFIGS['default'], ollama_client, OLLAMA_CONFIG) |
| 280 | result = agent.run(query) |
| 281 | return json.dumps(result, indent=2, ensure_ascii=False) |
| 282 | |
| 283 | def show_graph(): |
| 284 | """ |
no test coverage detected