Skip to content

Commit f9f6d1c

Browse files
Update api/assistant/create-assistant-message.mdx (#2416)
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
1 parent 436d6ab commit f9f6d1c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

api/assistant/create-assistant-message.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ function MyComponent({ domain }) {
3333
body: {
3434
fp: 'anonymous',
3535
retrievalPageSize: 5,
36+
context: [
37+
{
38+
type: 'code',
39+
value: 'const example = "code snippet";',
40+
elementId: 'code-block-1',
41+
},
42+
],
3643
},
3744
streamProtocol: 'data',
3845
sendExtraMessageFields: true,
@@ -61,6 +68,12 @@ function MyComponent({ domain }) {
6168
- `body.fp` - Fingerprint identifier (use 'anonymous' or a user identifier).
6269
- `body.retrievalPageSize` - Number of search results to use (recommended: 5).
6370

71+
**Optional configuration:**
72+
- `body.context` - Array of contextual information to provide to the assistant. Each context object contains:
73+
- `type` - Either `'code'` or `'textSelection'`.
74+
- `value` - The code snippet or selected text content.
75+
- `elementId` (optional) - Identifier for the UI element containing the context.
76+
6477
</Step>
6578
</Steps>
6679

0 commit comments

Comments
 (0)