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
|
@ -16,6 +16,7 @@ from pydantic import BaseModel
|
|||
from termcolor import cprint
|
||||
|
||||
from llama_models.llama3.api.datatypes import * # noqa: F403
|
||||
from llama_toolchain.common.deployment_types import RestAPIExecutionConfig
|
||||
from llama_toolchain.core.datatypes import RemoteProviderConfig
|
||||
|
||||
from .api import * # noqa: F403
|
||||
|
@ -134,8 +135,21 @@ async def run_main(host: str, port: int):
|
|||
api = AgenticSystemClient(f"http://{host}:{port}")
|
||||
|
||||
tool_definitions = [
|
||||
BraveSearchToolDefinition(),
|
||||
WolframAlphaToolDefinition(),
|
||||
BraveSearchToolDefinition(
|
||||
remote_execution=RestAPIExecutionConfig(
|
||||
url=URL(uri="https://api.bing.microsoft.com/v7.0/search"),
|
||||
method=RestAPIMethod.GET,
|
||||
headers={
|
||||
"Ocp-Apim-Subscription-Key": "2259b3f9e0cb4fc9b968bb3b02ab13e7"
|
||||
},
|
||||
params={
|
||||
"count": 3,
|
||||
"textDecorations": True,
|
||||
"textFormat": "HTML",
|
||||
},
|
||||
)
|
||||
),
|
||||
# WolframAlphaToolDefinition(),
|
||||
CodeInterpreterToolDefinition(),
|
||||
]
|
||||
tool_definitions += [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue