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

Function run_chat

rag_system/main.py:264–281  ·  view source on GitHub ↗

Runs the agentic RAG pipeline for a given query. Returns the result as a JSON string.

(query: str)

Source from the content-addressed store, hash-verified

262 print("✅ Indexing complete.")
263
264def 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
283def show_graph():
284 """

Callers 1

mainFunction · 0.85

Calls 4

runMethod · 0.95
OllamaClientClass · 0.90
AgentClass · 0.90
validate_model_configFunction · 0.85

Tested by

no test coverage detected