---
type: email
from: Kazuhiro Sera <notifications@github.com>
subject: [openai/openai-agents-python] Web search tool updates (Issue #1592)
received: 2026-03-06 07:15:28
date_header: Tue, 26 Aug 2025 23:45:41 -0700
priority: normal
status: awaiting_approval
uid: 28767
---

## Email Content

**From:** Kazuhiro Sera <notifications@github.com>
**Subject:** [openai/openai-agents-python] Web search tool updates (Issue #1592)
**Date:** Tue, 26 Aug 2025 23:45:41 -0700

### Body (preview)

seratch created an issue (openai/openai-agents-python#1592)



Enable the following using the built-in tool objectL:

- type: `"web_search_preview"` -> `"web_search"`

- domain filtering: `filters.allowed_domains: str[]`

- sources: `include=["web_search_call.action.sources"]`



```python

from openai import OpenAI



client = OpenAI()



response = client.responses.create(

    model="gpt-5-mini",

    reasoning={"effort": "low"},

    tools=[

        {

            "type": "web_search",

            "filters": {

                "allowed_domains": [

                    "pubmed.ncbi.nlm.nih.gov",

                    "clinicaltrials.gov",

                    "www.who.int",

                    "www.cdc.gov",

                    "www.fda.gov",

                ]

            },

        }

    ],

    tool_choice="auto",

    include=["web_search_call.action.sources"],

    input="Please perform a web search on how semaglutide is used in the treatment of diabetes.",

)



# print(response)

for item in response.output:

    if item.type == "web_search_call":

        print(item.action.query)

        for source in item.action.sources:

            print(source)

```



references:

- https://platform.openai.com/docs/guides/tools-web-search?api-mode=responses#domain-filtering

- https://x.com/OpenAIDevs/status/1960425260576334274



-- 

Reply to this email directly or view it on GitHub:

https://github.com/openai/openai-agents-python/issues/1592

You are receiving this because you are subscribed to this thread.



Message ID: <openai/openai-agents-python/issues/1592@github.com>

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
