Skip to content

Commit c0e340d

Browse files
authored
Address feedback (#2058)
* clarify nav nesting * specify AI SDK v4 * note nav limitations and add examples * update param descriptions
1 parent badc9aa commit c0e340d

File tree

3 files changed

+186
-68
lines changed

3 files changed

+186
-68
lines changed

api/assistant/create-assistant-message.mdx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ keywords: ["assistant message", "embed", "chat", "integrate"]
55

66
## Integration with `useChat`
77

8-
The recommended way to integrate the assistant API into your application is with the `useChat` hook from [Vercel's AI SDK](https://sdk.vercel.ai/docs).
8+
The `useChat` hook from Vercel's AI SDK is the recommended way to integrate the assistant API into your application.
9+
10+
<Note>
11+
The Mintlify assistant API is compatible with **AI SDK v4**. If you use AI SDK v5 or later, you must configure a custom transport.
12+
</Note>
913

1014
<Steps>
11-
<Step title="Install the AI SDK">
15+
<Step title="Install AI SDK v4">
1216

1317
```bash
14-
npm i ai
18+
npm i ai@^4.1.15
1519
```
1620

1721
</Step>
@@ -28,9 +32,7 @@ function MyComponent({ domain }) {
2832
},
2933
body: {
3034
fp: 'anonymous',
31-
messages: [
32-
{ role: 'user', content: 'What is this documentation about?' }
33-
]
35+
retrievalPageSize: 5,
3436
},
3537
streamProtocol: 'data',
3638
sendExtraMessageFields: true,
@@ -53,6 +55,12 @@ function MyComponent({ domain }) {
5355
}
5456
```
5557

58+
**Required configuration for Mintlify:**
59+
- `streamProtocol: 'data'` - Required for streaming responses.
60+
- `sendExtraMessageFields: true` - Required to send message metadata.
61+
- `body.fp` - Fingerprint identifier (use 'anonymous' or a user identifier).
62+
- `body.retrievalPageSize` - Number of search results to use (recommended: 5).
63+
5664
</Step>
5765
</Steps>
5866

discovery-openapi.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"properties": {
4848
"fp": {
4949
"type": "string",
50-
"description": "Browser fingerprint or arbitrary string identifier. There may be future functionality which allows you to get the messages for a given fingerprint"
50+
"description": "Fingerprint identifier for tracking conversation sessions. Use 'anonymous' for anonymous users or provide a unique user identifier."
5151
},
5252
"threadId": {
5353
"default": null,
@@ -381,7 +381,7 @@
381381
"retrievalPageSize": {
382382
"type": "number",
383383
"default": 5,
384-
"description": "Number of retrieval results to return"
384+
"description": "Number of documentation search results to use for generating the response. Higher values provide more context but may increase response time. Recommended: 5."
385385
},
386386
"filter": {
387387
"type": "object",

organize/navigation.mdx

Lines changed: 170 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ The [navigation](/organize/settings#param-navigation) property in `docs.json` co
88

99
With proper navigation configuration, you can organize your content so that users can find exactly what they're looking for.
1010

11+
Choose one primary organizational pattern at the root level of your navigation. Once you've chosen your primary pattern, you can nest other navigation elements within it.
12+
1113
## Pages
1214

1315
Pages are the most fundamental navigation component. Each page is an MDX file in your documentation repository.
@@ -173,6 +175,8 @@ Menus add dropdown navigation items to a tab. Use menus to help users go directl
173175

174176
In the `navigation` object, `menu` is an array where each entry is an object that requires an `item` field and can contain other navigation fields such as groups, pages, icons, or links to external pages.
175177

178+
Menu items can only contain groups, pages, and external links.
179+
176180
```json
177181
{
178182
"navigation": {
@@ -262,9 +266,13 @@ In the `navigation` object, `anchors` is an array where each entry is an object
262266
}
263267
```
264268

265-
For anchors that direct to external links only, use the `global` keyword. Anchors in a `global` object must have an `href` field and cannot point to a relative path.
269+
### Global anchors
266270

267-
Global anchors are particularly useful for linking to resources that are not part of your documentation, but should be readily accessible to your users like a blog or support portal.
271+
Use global anchors for external links that should appear on all pages, regardless of which section of your navigation the user is viewing. Global anchors are particularly useful for linking to resources outside your documentation, such as a blog, community forum, or support portal.
272+
273+
<Note>
274+
Global anchors must include an `href` field pointing to an external URL. They cannot contain relative paths.
275+
</Note>
268276

269277
```json
270278
{
@@ -561,37 +569,37 @@ For automated translations, [contact our sales team](mailto:[email protected]) to
561569

562570
## Nesting
563571

564-
You can use any combination of anchors, tabs, dropdowns, and products. The components can be nested within each other interchangeably to create your desired navigation structure.
572+
Navigation elements can be nested within each other to create complex hierarchies. You must have one root-level parent navigation element such as tabs, groups, or a dropdown. You can nest other types of navigation elements within your primary navigation pattern.
573+
574+
Each navigation element can contain one type of child element at each level of your navigation hierarchy. For example, a tab can contain anchors that contain groups, but a tab cannot contain both anchors and groups at the same level.
565575

566576
<CodeGroup>
567577

568-
```json Anchors
578+
```json Tabs containing anchors
569579
{
570580
"navigation": {
571-
"anchors": [
581+
"tabs": [
572582
{
573-
"anchor": "Anchor 1",
574-
"groups": [
583+
"tab": "Documentation",
584+
"anchors": [
575585
{
576-
"group": "Group 1",
577-
"pages": [
578-
"some-folder/file-1",
579-
"another-folder/file-2",
580-
"just-a-file"
581-
]
586+
"anchor": "Guides",
587+
"icon": "book-open",
588+
"pages": ["quickstart", "tutorial"]
589+
},
590+
{
591+
"anchor": "API Reference",
592+
"icon": "code",
593+
"pages": ["api/overview", "api/endpoints"]
582594
}
583595
]
584596
},
585597
{
586-
"anchor": "Anchor 2",
598+
"tab": "Resources",
587599
"groups": [
588600
{
589-
"group": "Group 2",
590-
"pages": [
591-
"some-other-folder/file-1",
592-
"various-different-folders/file-2",
593-
"another-file"
594-
]
601+
"group": "Help",
602+
"pages": ["support", "faq"]
595603
}
596604
]
597605
}
@@ -600,34 +608,130 @@ You can use any combination of anchors, tabs, dropdowns, and products. The compo
600608
}
601609
```
602610

611+
```json Anchors containing tabs
612+
{
613+
"navigation": {
614+
"anchors": [
615+
{
616+
"anchor": "Documentation",
617+
"icon": "book-open",
618+
"tabs": [
619+
{
620+
"tab": "Guides",
621+
"pages": ["quickstart", "tutorial"]
622+
},
623+
{
624+
"tab": "API",
625+
"pages": ["api/overview", "api/endpoints"]
626+
}
627+
]
628+
},
629+
{
630+
"anchor": "Community",
631+
"icon": "users",
632+
"href": "https://community.example.com"
633+
}
634+
]
635+
}
636+
}
637+
```
603638

604-
```json Tabs
639+
```json Products containing tabs
605640
{
606641
"navigation": {
607-
"tabs": [
642+
"products": [
608643
{
609-
"tab": "Tab 1",
610-
"groups": [
644+
"product": "Platform",
645+
"icon": "server",
646+
"tabs": [
611647
{
612-
"group": "Group 1",
613-
"pages": [
614-
"some-folder/file-1",
615-
"another-folder/file-2",
616-
"just-a-file"
648+
"tab": "Documentation",
649+
"groups": [
650+
{
651+
"group": "Getting started",
652+
"pages": ["platform/quickstart"]
653+
}
617654
]
655+
},
656+
{
657+
"tab": "API Reference",
658+
"pages": ["platform/api"]
618659
}
619660
]
620661
},
621662
{
622-
"tab": "Tab 2",
623-
"groups": [
663+
"product": "Mobile SDK",
664+
"icon": "mobile",
665+
"pages": ["mobile/overview"]
666+
}
667+
]
668+
}
669+
}
670+
```
671+
672+
```json Multi-product SaaS with tabs and menu
673+
{
674+
"navigation": {
675+
"products": [
676+
{
677+
"product": "Platform",
678+
"icon": "cloud",
679+
"tabs": [
624680
{
625-
"group": "Group 2",
626-
"pages": [
627-
"some-other-folder/file-1",
628-
"various-different-folders/file-2",
629-
"another-file"
681+
"tab": "Documentation",
682+
"menu": [
683+
{
684+
"item": "Getting Started",
685+
"icon": "rocket",
686+
"groups": [
687+
{
688+
"group": "Setup",
689+
"pages": ["platform/install", "platform/config"]
690+
},
691+
{
692+
"group": "Core Concepts",
693+
"pages": ["platform/concepts/auth", "platform/concepts/data"]
694+
}
695+
]
696+
},
697+
{
698+
"item": "Guides",
699+
"icon": "book",
700+
"pages": ["platform/guides/deployment", "platform/guides/scaling"]
701+
}
702+
]
703+
},
704+
{
705+
"tab": "API Reference",
706+
"groups": [
707+
{
708+
"group": "REST API",
709+
"pages": ["platform/api/users", "platform/api/projects"]
710+
},
711+
{
712+
"group": "GraphQL",
713+
"pages": ["platform/api/graphql/queries", "platform/api/graphql/mutations"]
714+
}
715+
]
716+
}
717+
]
718+
},
719+
{
720+
"product": "Analytics",
721+
"icon": "chart-bar",
722+
"tabs": [
723+
{
724+
"tab": "Documentation",
725+
"groups": [
726+
{
727+
"group": "Getting Started",
728+
"pages": ["analytics/quickstart", "analytics/setup"]
729+
}
630730
]
731+
},
732+
{
733+
"tab": "API",
734+
"pages": ["analytics/api/events", "analytics/api/reports"]
631735
}
632736
]
633737
}
@@ -636,41 +740,47 @@ You can use any combination of anchors, tabs, dropdowns, and products. The compo
636740
}
637741
```
638742

639-
```json Tabs with external anchor
743+
```json Versioned docs with tabs
640744
{
641745
"navigation": {
642-
"global": {
643-
"anchors": [
644-
{
645-
"anchor": "Anchor 1",
646-
"href": "https://mintlify.com/docs"
647-
}
648-
]
649-
},
650-
"tabs": [
746+
"versions": [
651747
{
652-
"tab": "Tab 1",
653-
"groups": [
748+
"version": "v2.0",
749+
"tabs": [
654750
{
655-
"group": "Group 1",
656-
"pages": [
657-
"some-folder/file-1",
658-
"another-folder/file-2",
659-
"just-a-file"
751+
"tab": "Documentation",
752+
"groups": [
753+
{
754+
"group": "Getting Started",
755+
"pages": ["v2/quickstart", "v2/migration-from-v1"]
756+
},
757+
{
758+
"group": "Features",
759+
"pages": ["v2/features/auth", "v2/features/api"]
760+
}
660761
]
762+
},
763+
{
764+
"tab": "API Reference",
765+
"pages": ["v2/api/overview", "v2/api/endpoints"]
661766
}
662767
]
663768
},
664769
{
665-
"tab": "Tab 2",
666-
"groups": [
770+
"version": "v1.0",
771+
"tabs": [
667772
{
668-
"group": "Group 2",
669-
"pages": [
670-
"some-other-folder/file-1",
671-
"various-different-folders/file-2",
672-
"another-file"
773+
"tab": "Documentation",
774+
"groups": [
775+
{
776+
"group": "Getting Started",
777+
"pages": ["v1/quickstart"]
778+
}
673779
]
780+
},
781+
{
782+
"tab": "API Reference",
783+
"pages": ["v1/api/overview"]
674784
}
675785
]
676786
}

0 commit comments

Comments
 (0)