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:
Shahed Nasser
2025-01-29 19:13:51 +02:00
committed by GitHub
parent 51d2960a57
commit 5634a4762b
57 changed files with 1571 additions and 743 deletions
+15 -1
View File
@@ -1,4 +1,5 @@
import {
AiAssistantProvider,
AnalyticsProvider,
PageLoadingProvider,
ScrollControllerProvider,
@@ -21,7 +22,20 @@ const Providers = ({ children }: ProvidersProps) => {
<ScrollControllerProvider scrollableSelector="#main">
<SidebarProvider>
<MainNavProvider>
<SearchProvider>{children}</SearchProvider>
<SearchProvider>
<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"
}
chatType="popover"
>
{children}
</AiAssistantProvider>
</SearchProvider>
</MainNavProvider>
</SidebarProvider>
</ScrollControllerProvider>
@@ -4,8 +4,6 @@ import {
usePageLoading,
SearchProvider as UiSearchProvider,
searchFilters,
AiAssistantIcon,
AiAssistantProvider,
} from "docs-ui"
import { config } from "../config"
import basePathUrl from "../utils/base-path-url"
@@ -53,28 +51,6 @@ const SearchProvider = ({ children }: SearchProviderProps) => {
),
filterOptions: searchFilters,
}}
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",
badgeType: "shaded",
children: "Beta",
},
},
]}
>
{children}
</UiSearchProvider>