llama-stack-apps
llama-stack-apps copied to clipboard
Tool Calling Not Working
I am trying the tool calling function with Brave Search engine by following the simple instructions at https://github.com/meta-llama/llama-agentic-system#add-api-keys-for-tools.
Basically, I saved the api key inside an .env file by BRAVE_SEARCH_API_KEY=xxxxx
run that at the CLI terminal. However, with the command mesop app/main.py
, the search engine did not seem to work, giving the message like the knowledge is up to Dec. 2023.
Also tried PYTHONPATH=. mesop app/chat_with_custom_tools.py
, didn't work either, it gave the following info:
INFO: 127.0.0.1:57624 - "POST /agentic_system/create HTTP/1.1" 200 OK
INFO: 127.0.0.1:57626 - "POST /agentic_system/session/create HTTP/1.1" 200 OK
INFO: 127.0.0.1:42830 - "POST /agentic_system/turn/create HTTP/1.1" 200 OK
role='user' content='Which team won NBA championship in 2024?'
role='assistant' content='' stop_reason=<StopReason.end_of_turn: 'end_of_turn'> tool_calls=[ToolCall(call_id='6ea013e3-8fa3-4758-aea8-d344d6051d5d', tool_name=<BuiltinTool.brave_search: 'brave_search'>, arguments={'query': 'NBA championship 2024 winner'})]
role='ipython' call_id='6ea013e3-8fa3-4758-aea8-d344d6051d5d' tool_name=<BuiltinTool.brave_search: 'brave_search'> content='{"query": null, "top_k": []}'
Assistant: The search results do not provide the answer to the question. I will try to search again with a different query.
INFO: 127.0.0.1:50940 - "POST /agentic_system/turn/create HTTP/1.1" 200 OK
role='user' content='What are the big news in 2024'
role='assistant' content='' stop_reason=<StopReason.end_of_turn: 'end_of_turn'> tool_calls=[ToolCall(call_id='8c19d850-fb20-4d17-b9be-ddeec447cc3f', tool_name=<BuiltinTool.brave_search: 'brave_search'>, arguments={'query': 'big news 2024'})]
role='ipython' call_id='8c19d850-fb20-4d17-b9be-ddeec447cc3f' tool_name=<BuiltinTool.brave_search: 'brave_search'> content='{"query": null, "top_k": []}'
Assistant: The search results do not provide the answer to the question. I will try to search again with a different query.
INFO: 127.0.0.1:54344 - "POST /agentic_system/turn/create HTTP/1.1" 200 OK
role='user' content='What are the big news in 2024'
role='assistant' content='' stop_reason=<StopReason.end_of_turn: 'end_of_turn'> tool_calls=[ToolCall(call_id='815ac2e6-f9aa-4fde-b1f7-16d08e140f36', tool_name=<BuiltinTool.brave_search: 'brave_search'>, arguments={'query': '2024 news'})]
role='ipython' call_id='815ac2e6-f9aa-4fde-b1f7-16d08e140f36' tool_name=<BuiltinTool.brave_search: 'brave_search'> content='{"query": null, "top_k": []}'
Assistant: The search results do not provide the answer to the question. I will try to search again with a different query.
Unfortunately, I am unable to provide any information on the news in 2024 as the search results do not provide any relevant information.
Do we have more docs on how to enable this?