Web search
Generate responses that cite public web sources. Jockey can search the public web for information that supports its answer and cite the sources it uses. This guide shows you how to enable web search and read the url_citation annotations it returns.
Prerequisites
- You’ve already uploaded your videos and images, and the assets have reached the
readystatus. See the Upload content page for details. - You’ve already created a knowledge store. See the Create a knowledge store page for details.
- You’ve already added at least one asset to the knowledge store, and the item has reached the
readystatus. See the Add assets to a knowledge store page for details. - You’ve already read the Create a response page and understand the basic request and response format.
Enable web search
Include { "type": "jockey:web_search" } in the tools array to allow web search. Jockey decides whether to use an available tool, so enabling web search does not guarantee a search. To make a search more likely, explicitly tell Jockey what information to look up in input or instructions. A prompt that asks Jockey to search the web does not enable web search by itself. If you omit tools or pass [], Jockey cannot search public web sources, even when the prompt requests it.
The tools setting applies to each request on its own, including requests that continue a session.
Example
Copy and paste the code below, replacing the placeholders surrounded by <> with your values.
Code explanation
Python
Node.js
To enable web search, call the responses.create method and pass the tools parameter.
Parameters:
knowledge_store_id: The unique identifier of the knowledge store to reason over. Every request requires exactly one.input: An array of input items. Each item is a message you send to Jockey.tools: An array of tools for this request. Pass[{ "type": "jockey:web_search" }]to allow web search.
Return value: An object of type ResponseObject. The answer text includes url_citation annotations alongside media citations. Use the start_index and end_index fields of each annotation to locate the span of text it covers; both bounds are inclusive and count Unicode code points.
Example response
The message in the output array contains the answer text with its citations. This response cites a public web source and a moment from a video in the knowledge store:
The web citation covers Super Bowl LVIII, a span of ordinary text. The video citation covers the [1] marker. Both bounds are inclusive and count Unicode code points.
Common pitfalls
- Treat unknown citation types as un-displayable, not as errors. The platform can add new citation types. When you encounter a type you do not recognize, keep the response text and display the citations you do recognize.
- Retry without an unavailable tool. If a requested tool is unavailable, the request fails with HTTP
422and codeparameter_invalid. Remove the unavailable tool from thetoolsarray and retry. For web search, remove the entry withtype: "jockey:web_search".
Next steps
- Create a response - customize Jockey’s behavior with instructions, restrict the request to specific items with
selections, and inspect intermediate reasoning steps - Streaming - receive tokens in real time; citations arrive with the completed content part
- Multi-turn sessions - maintain conversation context across requests;
toolsapplies to each request on its own