diff --git a/ai_core.py b/ai_core.py index 453a78b..a4b0eea 100644 --- a/ai_core.py +++ b/ai_core.py @@ -1049,14 +1049,9 @@ async def initialize_global_index() -> bool: # Add a source_nodes property that routes.py will look for tool_output = ToolOutput( content=final_answer, - tool_name="GraphRAG", + tool_name="GraphRAG", raw_output=NodeWrapper(vector_nodes), - raw_input={"query": query_str}, - metadata={ - 'source': 'graphrag', - 'retrieval_stats': log_message, - 'original_result': modified_raw_output # Store the original result too - } + raw_input={"query": query_str, "source": "graphrag", "retrieval_stats": log_message} ) log_structured('debug', 'GraphRAG Tool: Including image metadata in response', @@ -1071,7 +1066,7 @@ async def initialize_global_index() -> bool: tool_name="GraphRAG", raw_input={"query": query_str}, raw_output={"error": str(graphrag_err)}, - metadata={'error': str(graphrag_err)} + is_error=True ) async def acall(self, input: str) -> ToolOutput: