Retrieve context snippets from an assistant
You can retrieve context snippets from an assistant, as in the following example:JSON
Control the snippets retrieved
This is available in API versions
2025-04 and later.top_k * snippet_size:
snippet_size: Controls the max size of a snippet (default is 2048 tokens). Note that snippet size can vary and, in rare cases, may be bigger than the setsnippet_size. Snippet size controls the amount of context given for each chunk of text.top_k: Controls the max number of context snippets retrieved (default is 16).top_kcontrols the diversity of information received in the returned snippets.
top_k and snippet_size can help manage token consumption.