mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-05 12:21:52 +00:00
add tool for bing search
This commit is contained in:
parent
741310f78e
commit
640c5f8ab9
5 changed files with 79 additions and 10 deletions
|
@ -18,6 +18,7 @@ from llama_toolchain.tools.builtin import (
|
|||
BraveSearchTool,
|
||||
CodeInterpreterTool,
|
||||
PhotogenTool,
|
||||
RemoteSearchTool,
|
||||
WolframAlphaTool,
|
||||
)
|
||||
from llama_toolchain.tools.safety import with_safety
|
||||
|
@ -63,10 +64,13 @@ class MetaReferenceAgenticSystemImpl(AgenticSystem):
|
|||
raise ValueError("Wolfram API key not defined in config")
|
||||
tool = WolframAlphaTool(key)
|
||||
elif isinstance(tool_defn, BraveSearchToolDefinition):
|
||||
key = self.config.brave_search_api_key
|
||||
if not key:
|
||||
raise ValueError("Brave API key not defined in config")
|
||||
tool = BraveSearchTool(key)
|
||||
if tool_defn.remote_execution is not None:
|
||||
tool = RemoteSearchTool(tool_defn.remote_execution)
|
||||
else:
|
||||
key = self.config.brave_search_api_key
|
||||
if not key:
|
||||
raise ValueError("Brave API key not defined in config")
|
||||
tool = BraveSearchTool(key)
|
||||
elif isinstance(tool_defn, CodeInterpreterToolDefinition):
|
||||
tool = CodeInterpreterTool()
|
||||
elif isinstance(tool_defn, PhotogenToolDefinition):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue