Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions api/assistant/create-assistant-message.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## Integration with `useChat`

The `useChat` hook from Vercel's AI SDK is the recommended way to integrate the assistant API into your application.

Check warning on line 8 in api/assistant/create-assistant-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api/assistant/create-assistant-message.mdx#L8

Use 'app' instead of 'application'.

<Note>
The Mintlify assistant API is compatible with **AI SDK v4**. If you use AI SDK v5 or later, you must configure a custom transport.
Expand Down Expand Up @@ -33,6 +33,13 @@
body: {
fp: 'anonymous',
retrievalPageSize: 5,
context: [
{
type: 'code',
value: 'const example = "code snippet";',
elementId: 'code-block-1',
},
],
},
streamProtocol: 'data',
sendExtraMessageFields: true,
Expand All @@ -58,9 +65,15 @@
**Required configuration for Mintlify:**
- `streamProtocol: 'data'` - Required for streaming responses.
- `sendExtraMessageFields: true` - Required to send message metadata.
- `body.fp` - Fingerprint identifier (use 'anonymous' or a user identifier).

Check warning on line 68 in api/assistant/create-assistant-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api/assistant/create-assistant-message.mdx#L68

Use parentheses judiciously.
- `body.retrievalPageSize` - Number of search results to use (recommended: 5).

Check warning on line 69 in api/assistant/create-assistant-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api/assistant/create-assistant-message.mdx#L69

Use parentheses judiciously.

**Optional configuration:**
- `body.context` - Array of contextual information to provide to the assistant. Each context object contains:
- `type` - Either `'code'` or `'textSelection'`.
- `value` - The code snippet or selected text content.
- `elementId` (optional) - Identifier for the UI element containing the context.

Check warning on line 75 in api/assistant/create-assistant-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api/assistant/create-assistant-message.mdx#L75

Use parentheses judiciously.

</Step>
</Steps>

Expand Down