Skip to content

Does gpt-oss support Agents SDK tools? #1379

@davidydu

Description

@davidydu

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())

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions