From 39dc115421f3f7f2762f079dcf89d927eb572c20 Mon Sep 17 00:00:00 2001 From: Hayden Date: Mon, 6 Jul 2026 15:05:13 -0700 Subject: [PATCH] docs: document file search result limits Resolves #1004 --- helpers.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/helpers.md b/helpers.md index 5a1092bbc..822dd3e67 100644 --- a/helpers.md +++ b/helpers.md @@ -212,6 +212,26 @@ openai.beta.threads.runs.submitToolOutputsStream(); This method can be used to submit a tool output to a run waiting on the output and start a stream. +### Configuring file search results + +`max_num_results` is a run-level `file_search` tool override. Set it at +`tools[].file_search.max_num_results` when creating or streaming a run: + +```ts +const run = openai.beta.threads.runs.stream(thread.id, { + assistant_id: assistant.id, + tools: [ + { + type: 'file_search', + file_search: { max_num_results: 10 }, + }, + ], +}); +``` + +Message attachments only associate a file with the `file_search` tool, so their `tools` entries use +`{ type: 'file_search' }` without a nested `file_search` configuration object. + ### Assistant Events The assistant API provides events you can subscribe to for the following events.