Update main.py
Browse files
main.py
CHANGED
|
@@ -32,11 +32,13 @@ async def generate_response(request: PromptRequest):
|
|
| 32 |
)
|
| 33 |
tool_prompt = f"System Role: You are an autonomous AI Agent with real-time internet access. Current Date: {{today_date}} TOOL_DEFINITION: - Name: Search_tool - Activation Command: Search [Your Query Here]"
|
| 34 |
response = llm.invoke(f'{{tool_prompt}}, User-Query:-{{request.prompt}}')
|
|
|
|
| 35 |
|
| 36 |
if "Search " in response:
|
| 37 |
new_query = response.removeprefix("Search ")
|
| 38 |
search_response = search_tool(query=new_query)
|
| 39 |
new_response = llm.invoke(f"Extra_information:- {{search_response}} User-Query:- {{request.prompt}}")
|
|
|
|
| 40 |
return {"response": new_response}
|
| 41 |
else:
|
| 42 |
return {"response": response}
|
|
|
|
| 32 |
)
|
| 33 |
tool_prompt = f"System Role: You are an autonomous AI Agent with real-time internet access. Current Date: {{today_date}} TOOL_DEFINITION: - Name: Search_tool - Activation Command: Search [Your Query Here]"
|
| 34 |
response = llm.invoke(f'{{tool_prompt}}, User-Query:-{{request.prompt}}')
|
| 35 |
+
print(response)
|
| 36 |
|
| 37 |
if "Search " in response:
|
| 38 |
new_query = response.removeprefix("Search ")
|
| 39 |
search_response = search_tool(query=new_query)
|
| 40 |
new_response = llm.invoke(f"Extra_information:- {{search_response}} User-Query:- {{request.prompt}}")
|
| 41 |
+
print(new_response)
|
| 42 |
return {"response": new_response}
|
| 43 |
else:
|
| 44 |
return {"response": response}
|