Your first prompt
A common use for a prompt is finding and extracting data from unstructured text. For example, this prompt will ask the model to read through text and return any addresses it finds:prompt
property acts as a template. When your agent decides to use the prompt, any placeholders
(in curly braces, like {this}
) will be replaced by arguments, and then the completed prompt will
be passed on to the model.
Structured outputs
You can also instruct the model to return a result in a specific format by providing aresult
schema.
Here’s the same prompt from the previous example, but instead of free-form text, the model will return
an array of objects:
Using a different model
Some tasks can often be performed by smaller (and therefore cheaper!) models. By default, prompts will use the same model as the agent, but you can also choose to override it:See also
- Prompt in the SDK reference