---
title: "Provide more context to your prompts"
description: "Add more context to your prompts and editor commands to fine-tune your AI's response. Learn more in our docs."
canonical_url: "https://tiptap.dev/docs/content-ai/capabilities/generation/text-generation/provide-context"
---

# Provide more context to your prompts

Add more context to your prompts and editor commands to fine-tune your AI's response. Learn more in our docs.

- **1. Activate trial or subscribe**

  Start a [free trial](https://cloud.tiptap.dev/v2?trial=true) or [subscribe to the Start plan](https://cloud.tiptap.dev/v2/billing) in your account.
- **2. Integrate an AI provider**

  Configure OpenAI in your [AI settings](https://cloud.tiptap.dev/v2/cloud/ai) or review the [Custom LLM guides](https://tiptap.dev/docs/content-ai/capabilities/generation/custom-llms.md).
- **3. Install from private registry**

  To install the frontend extensions, authenticate to Tiptap’s private npm registry by following the [setup guide](https://tiptap.dev/docs/guides/pro-extensions.md).

With the `context` option, you can provide additional information to the AI model to help it generate more relevant content. This can be useful when you want to generate content that is more aligned with the context of the conversation.

> **Interactive demo:** [AiContext](https://embed-pro.tiptap.dev/preview/Extensions/AiContext)

## Context option

Context can be provided in two formats, `text` and `url`. The `text` format is used to provide additional text context to the AI model, while the `url` format is used to provide a URL context.

> **URL requirements:**
>
> The url provided must be a valid URL that is accessible by Tiptap Content AI. This is useful when
> you want to provide additional context to the AI model that is referencing a third-party source.

```ts
// Steams the response as rich text into the editor
editor
  .chain()
  .aiTextPrompt({
    text: 'What does Alice do for a living?',
    stream: true,
    format: 'rich-text',
    context: [
      { type: 'text', text: 'John & Alice are a software engineers.' },
      { type: 'url', url: 'https://company.example.com/team' },
    ],
  })
  .run()
```
