Skip to content

Commit b83184f

Browse files
feat(responses)!: Add web_search_2025_08_26 to the WebSearchToolTypes (#4103)
# What does this PR do? Resolves #4102 1. Added `web_search_2025_08_26` to the `WebSearchToolTypes` list and the `OpenAIResponseInputToolWebSearch.type` Literal union 2. No changes needed to tool execution logic - all `web_search` types map to the same underlying tool 3. Backward compatibility is maintained - existing `web_search`, `web_search_preview`, and `web_search_preview_2025_03_11` types continue to work 4. Added an integration test case using {"type": "web_search_2025_08_26"} to verify it works correctly 5. Updated `docs/docs/providers/openai_responses_limitations.mdx` to reflect that `web_search_2025_08_26` is now supported. 6. Removed incorrect references to `MOD1/MOD2/MOD3` (which don't exist in the codebase) <!-- If resolving an issue, uncomment and update the line below --> <!-- Closes #[issue-number] --> ## Test Plan <!-- Describe the tests you ran to verify your changes with result summaries. *Provide clear instructions so the plan can be easily re-executed.* --> --------- Signed-off-by: Aakanksha Duggal <aduggal@redhat.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent f49cb0b commit b83184f

File tree

312 files changed

+22287
-4288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

312 files changed

+22287
-4288
lines changed

client-sdks/stainless/openapi.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6791,6 +6791,8 @@ components:
67916791
const: web_search_preview
67926792
- type: string
67936793
const: web_search_preview_2025_03_11
6794+
- type: string
6795+
const: web_search_2025_08_26
67946796
default: web_search
67956797
description: Web search tool type variant to use
67966798
search_context_size:

docs/docs/providers/openai_responses_limitations.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,9 @@ Both OpenAI and Llama Stack support a web-search built-in tool. The [OpenAI doc
4848

4949
> The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.
5050
51-
In contrast, the [Llama Stack documentation](https://llamastack.github.io/docs/api/create-a-new-open-ai-response) says that the allowed values for `type` for web search are `MOD1`, `MOD2` and `MOD3`.
52-
Is that correct? If so, what are the meanings of each of them? It might make sense for the allowed values for OpenAI map to some values for Llama Stack so that code written to the OpenAI specification
53-
also work with Llama Stack.
51+
Llama Stack now supports both `web_search` and `web_search_2025_08_26` types, matching OpenAI's API. For backward compatibility, Llama Stack also supports `web_search_preview` and `web_search_preview_2025_03_11` types.
5452

55-
The OpenAI web search tool also has fields for `filters` and `user_location` which are not documented as options for Llama Stack. If feasible, it would be good to support these too.
53+
The OpenAI web search tool also has fields for `filters` and `user_location` which are not yet implemented in Llama Stack. If feasible, it would be good to support these too.
5654

5755
---
5856

docs/static/llama-stack-spec.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6075,6 +6075,8 @@ components:
60756075
const: web_search_preview
60766076
- type: string
60776077
const: web_search_preview_2025_03_11
6078+
- type: string
6079+
const: web_search_2025_08_26
60786080
default: web_search
60796081
description: Web search tool type variant to use
60806082
search_context_size:

docs/static/stainless-llama-stack-spec.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6791,6 +6791,8 @@ components:
67916791
const: web_search_preview
67926792
- type: string
67936793
const: web_search_preview_2025_03_11
6794+
- type: string
6795+
const: web_search_2025_08_26
67946796
default: web_search
67956797
description: Web search tool type variant to use
67966798
search_context_size:

src/llama_stack/apis/agents/openai_responses.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ class OpenAIResponseText(BaseModel):
403403

404404

405405
# Must match type Literals of OpenAIResponseInputToolWebSearch below
406-
WebSearchToolTypes = ["web_search", "web_search_preview", "web_search_preview_2025_03_11"]
406+
WebSearchToolTypes = ["web_search", "web_search_preview", "web_search_preview_2025_03_11", "web_search_2025_08_26"]
407407

408408

409409
@json_schema_type
@@ -415,9 +415,12 @@ class OpenAIResponseInputToolWebSearch(BaseModel):
415415
"""
416416

417417
# Must match values of WebSearchToolTypes above
418-
type: Literal["web_search"] | Literal["web_search_preview"] | Literal["web_search_preview_2025_03_11"] = (
419-
"web_search"
420-
)
418+
type: (
419+
Literal["web_search"]
420+
| Literal["web_search_preview"]
421+
| Literal["web_search_preview_2025_03_11"]
422+
| Literal["web_search_2025_08_26"]
423+
) = "web_search"
421424
# TODO: actually use search_context_size somewhere...
422425
search_context_size: str | None = Field(default="medium", pattern="^low|medium|high$")
423426
# TODO: add user_location

tests/integration/agents/recordings/01175978d117633394f2fa36371296b78af269f38656a12fd35a6195efc45787.json

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integration/agents/recordings/025c36f9316fb9ea6f443ab59c8463be6e6e5b451d7775ff4a836c7333935d92.json

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integration/agents/recordings/0337d2703fe8be2ba88a3dd79f1513c9890ca8b0543d3f284c1d54ffb8fc7b0b.json

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integration/agents/recordings/046d92297df0f53e06c3a32b0ce8456db8f8753acb2decc6682abd46fd564b61.json

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integration/agents/recordings/06d0af3070a2ba9296c0f3b60ccdc79123811cb94a827bc9c88ef65f24b10969.json

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)