Skip to content

Commit

Permalink
Change return value to json
Browse files Browse the repository at this point in the history
  • Loading branch information
hsauve-scottlogic committed Sep 5, 2024
1 parent 75c95f2 commit d2d15fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion backend/src/agents/datastore_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ async def get_semantic_layer_cache(graph_schema):
except Exception as e:
logger.error(f"Error during data retrieval: {e}")
raise
return str(db_response)
response = {
"content": db_response,
"ignore_validation": "false"
}
return json.dumps(response, indent=4)

@tool(
name="generate cypher query",
Expand Down
6 changes: 5 additions & 1 deletion backend/src/agents/web_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ async def web_general_search_core(search_query, llm, model) -> str:
if not summary:
continue
if await is_valid_answer(summary, search_query):
return summary
response = {
"content": summary,
"ignore_validation": "true"
}
return json.dumps(response, indent=4)
return "No relevant information found on the internet for the given query."
except Exception as e:
logger.error(f"Error in web_general_search_core: {e}")
Expand Down

0 comments on commit d2d15fb

Please sign in to comment.