docs: improve AI Assistant (#11208)
* initial implementation * integrate new ai assistant in other projects + ux improvements * fix chat window on mobile devices * fixes to mobile * allow pre * change shortcut to i * improved responsiveness * align version in navbar
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import {
|
||||
AiAssistantProvider,
|
||||
AnalyticsProvider,
|
||||
ColorModeProvider,
|
||||
HooksLoader,
|
||||
@@ -35,13 +36,28 @@ const Providers = ({ children }: ProvidersProps) => {
|
||||
<PaginationProvider>
|
||||
<MainNavProvider>
|
||||
<SearchProvider>
|
||||
<HooksLoader
|
||||
options={{
|
||||
pageScrollManager: true,
|
||||
}}
|
||||
<AiAssistantProvider
|
||||
apiUrl={
|
||||
process.env.NEXT_PUBLIC_AI_ASSISTANT_URL ||
|
||||
"temp"
|
||||
}
|
||||
websiteId={
|
||||
process.env.NEXT_PUBLIC_AI_WEBSITE_ID || "temp"
|
||||
}
|
||||
recaptchaSiteKey={
|
||||
// eslint-disable-next-line prettier/prettier, max-len
|
||||
process.env.NEXT_PUBLIC_AI_API_ASSISTANT_RECAPTCHA_SITE_KEY ||
|
||||
"temp"
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</HooksLoader>
|
||||
<HooksLoader
|
||||
options={{
|
||||
pageScrollManager: true,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</HooksLoader>
|
||||
</AiAssistantProvider>
|
||||
</SearchProvider>
|
||||
</MainNavProvider>
|
||||
</PaginationProvider>
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import {
|
||||
SearchProvider as UiSearchProvider,
|
||||
AiAssistantIcon,
|
||||
AiAssistantProvider,
|
||||
searchFilters,
|
||||
} from "docs-ui"
|
||||
import { SearchProvider as UiSearchProvider, searchFilters } from "docs-ui"
|
||||
import { config } from "../config"
|
||||
|
||||
type SearchProviderProps = {
|
||||
@@ -46,28 +41,6 @@ const SearchProvider = ({ children }: SearchProviderProps) => {
|
||||
}}
|
||||
// TODO change later when we have a user guide filter
|
||||
initialDefaultFilters={["guides"]}
|
||||
commands={[
|
||||
{
|
||||
name: "ai-assistant",
|
||||
icon: <AiAssistantIcon />,
|
||||
component: (
|
||||
<AiAssistantProvider
|
||||
apiUrl={process.env.NEXT_PUBLIC_AI_ASSISTANT_URL || "temp"}
|
||||
websiteId={process.env.NEXT_PUBLIC_AI_WEBSITE_ID || "temp"}
|
||||
recaptchaSiteKey={
|
||||
process.env.NEXT_PUBLIC_AI_API_ASSISTANT_RECAPTCHA_SITE_KEY ||
|
||||
"temp"
|
||||
}
|
||||
/>
|
||||
),
|
||||
title: "AI Assistant",
|
||||
badge: {
|
||||
variant: "blue",
|
||||
children: "Beta",
|
||||
badgeType: "shaded",
|
||||
},
|
||||
},
|
||||
]}
|
||||
>
|
||||
{children}
|
||||
</UiSearchProvider>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 80 KiB |
Reference in New Issue
Block a user