You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/responses.md
+22-9Lines changed: 22 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -270,7 +270,7 @@ JSON schema with optional name, description, and strict mode:
270
270
271
271
#### `tool_choice`
272
272
273
-
Optional. **Tool selection strategy** that controls whether and how the model uses tools.
273
+
Optional. **Tool selection strategy** that controls whether and how the model uses tools. Does not affect inline RAG selection.
274
274
275
275
**What it does:** When tools are supplied by `tools` attribute, `tool_choice` decides if the model may call them, must call at least one, or must not use any. You can pass a **simple mode string** or a **specific tool-config object** to force a particular tool (e.g. always use file search or a given function). Omitted or `null` behaves like `"auto"`. Typical use: disable tools for a plain-Q&A turn (`"none"`), force RAG-only (`file_search`), or constrain to a subset of tools (`allowed_tools`).
276
276
@@ -282,9 +282,9 @@ Optional. **Tool selection strategy** that controls whether and how the model us
282
282
283
283
**Specific tool objects (object with `type`):**
284
284
285
-
-`allowed_tools`: Restrict to a list of tool definitions; `mode` is `"auto"` or `"required"`, `tools` is a list of tool objects (same shapes as in [tools](#tools)).
286
-
-`file_search`: Force the model to use file search.
287
-
-`web_search`: Force the model to use web search (optionally with a variant such as `web_search_preview`).
285
+
-`allowed_tools`: Restrict to a list of tool definitions; `mode` is `"auto"` or `"required"`, `tools` is a list of key-valued filters for tools configured by `tools` attribute.
286
+
-`file_search`: Force the model to use file-only search.
287
+
-`web_search`: Force the model to use only web search.
288
288
-`function`: Force a specific function; `name` (required) is the function name.
289
289
-`mcp`: Force a tool on an MCP server; `server_label` (required), `name` (optional) tool name.
290
290
-`custom`: Force a custom tool; `name` (required).
@@ -299,16 +299,25 @@ Simple modes (string): use one of `"auto"`, `"required"`, or `"none"`.
299
299
{ "tool_choice": "none" }
300
300
```
301
301
302
-
Restrict to specific tools with `allowed_tools` (mode `"auto"` or `"required"`, plus `tools` array):
302
+
Restrict tool usage to a specific subset using `allowed_tools`. You can control behavior with the `mode` field (`"auto"` or `"required"`) and explicitly list permitted tools in the `tools` array.
303
+
304
+
The `tools` array acts as a **key-value filter**: each object specifies matching criteria (such as `type`, `server_label`, or `name`), and only tools that satisfy all provided attributes are allowed.
305
+
306
+
The example below limits tool usage to:
307
+
- the `file_search` tool
308
+
- a specific MCP tools (`tool_1` and `tool_2`) available on `server_1` (for multiple `name`s act as union)
309
+
310
+
If the `name` field is omitted for an MCP tool, the filter applies to all tools available on the specified server.
|`instructions`| string | System instructions used |
@@ -519,6 +528,10 @@ Vector store IDs are configured within the `tools` as `file_search` tools rather
519
528
520
529
**Vector store IDs:** Accepts **LCORE format** in requests and also outputs it in responses; LCORE translates to/from Llama Stack format internally.
521
530
531
+
The response includes `tools` and `tool_choice` fields that reflect the internally resolved configuration. More specifically, the final set of tools and selection constraints after internal resolution and filtering.
532
+
533
+
`tool_choice` only constrains how the model may use tools (including RAG via the `file_search` tool). It does **not** change inline RAG: vector store IDs you list under `tools` for file search are still used to build inline RAG context even if you set `tool_choice` to `none` or use an allowlist that omits `file_search`.
534
+
522
535
### LCORE-Specific Extensions
523
536
524
537
The API introduces extensions that are not part of the OpenResponses specification:
0 commit comments