-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed as not planned
Labels
Description
Question
Can gpt-oss use builtin tools such as WebSearchTool? As a minimal example, would the following work? My understanding is no, at least as of right now.
import asyncio
from openai import AsyncOpenAI
from agents import Agent, Runner, OpenAIResponsesModel, set_tracing_disabled, WebSearchTool
set_tracing_disabled(True)
async def main(model: str, api_key: str):
agent = Agent(
name="Assistant",
instructions="You only respond in haikus.",
model=OpenAIResponsesModel(
model="openai/gpt-oss-120b",
openai_client=AsyncOpenAI(
base_url="http://localhost:8000/v1",
api_key="EMPTY",
),
)
tools=[WebSearchTool()],
)
result = await Runner.run(agent, "What's the weather in Tokyo?")
print(result.final_output)
if __name__ == "__main__":
asyncio.run(main())
DykeF, takaakikakei and RobinBially