> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ardent.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompts

> Instruction templates for language models

**Prompts** allow agents to call a model with a specific request, and stream back a response.
They're similar to [tools](/concepts/tools), but instead of running arbitrary executable code,
they generate a prompt from a template and pass that prompt to a model.

While tools help enforce deterministic behavior in your agent, prompts are helpful when you
still want creativity, but you want it constrained. You can think of a prompt as a tool that
"executes" instructions in natural language rather than instructions written in code.

## 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:

```ts theme={null}
import { Prompt } from '@ardent-ai/sdk';
import { z } from 'zod';

const findAddress = new Prompt({
  name: 'findAddress',
  description: 'Find addresses in a string of text'
  parameters: {
    text: z.string()
  },
  prompt: 'Find all addresses in the following text:\n\n{text}'
});
```

The `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 a `result` schema.
Here's the same prompt from the previous example, but instead of free-form text, the model will return
an array of objects:

```ts {10-17} theme={null}
import { Prompt } from '@ardent-ai/sdk';
import { z } from 'zod';

const findAddress = new Prompt({
  name: 'findAddress',
  description: 'Find US postal addresses in a string of text'
  parameters: {
    text: z.string()
  },
  result: z.array(
    z.object({
      address: z.string(),
      city: z.string(),
      state: z.string(),
      zip: z.string(),
    })
  ),
  prompt: 'Find all addresses in the following text:\n\n{text}'
});
```

## 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:

```ts {7} theme={null}
import { Agent, Prompt, anthropic } from '@ardent-ai/sdk';
import { z } from 'zod';

const bottomLineUpFront = new Prompt({
  name: 'bottomLineUpFront',
  description: 'Summarize the top 3 key points from a project proposal',
  model: anthropic('claude-3-5-haiku-latest')
  parameters: {
    text: z.string()
  },
  prompt: 'Find the 3 most important key points from the following document, and summarize them succinctly:\n\n{text}'
});

const agent = new Agent({
  model: anthropic('claude-4-0-opus'),
  instructions: 'You are an expert at summarizing project proposals.'
  prompts: [bottomLineUpFront]
});

export default agent;
```

## See also

* [Prompt](/reference/prompt) in the SDK reference
