***

title: setUserPrompt
slug: /reference/typescript/agents/context-builder/context/set-user-prompt
description: Inject a user message when entering this context.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[ref-context]: /docs/server-sdks/reference/typescript/agents/context-builder/context

Inject a user message when entering this context. Useful for triggering the AI to
speak first after a context switch.

## **Parameters**

<ParamField path="userPrompt" type="string" required={true} toc={true}>
  User message to inject.
</ParamField>

## **Returns**

[`Context`][ref-context] -- Self for method chaining.

## **Example**

```typescript {5}
import { ContextBuilder } from '@signalwire/sdk';

const builder = new ContextBuilder();
const sales = builder.addContext('default');
sales.setUserPrompt('I\'d like to learn about your products.');
sales.addStep('pitch').setText('Present our product lineup to the caller.');
```