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
+11 -1
View File
@@ -1,6 +1,7 @@
"use client"
import {
AiAssistantProvider,
AnalyticsProvider,
ScrollControllerProvider,
SiteConfigProvider,
@@ -23,7 +24,16 @@ const Providers = ({ children }: ProvidersProps) => {
<SidebarProvider>
<MainNavProvider>
<SearchProvider>
<TooltipProvider>{children}</TooltipProvider>
<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"
}
>
<TooltipProvider>{children}</TooltipProvider>
</AiAssistantProvider>
</SearchProvider>
</MainNavProvider>
</SidebarProvider>
+1 -29
View File
@@ -1,11 +1,6 @@
"use client"
import {
AiAssistantIcon,
AiAssistantProvider,
SearchProvider as UiSearchProvider,
searchFilters,
} from "docs-ui"
import { SearchProvider as UiSearchProvider, searchFilters } from "docs-ui"
import { absoluteUrl } from "../lib/absolute-url"
type SearchProviderProps = {
@@ -37,29 +32,6 @@ const SearchProvider = ({ children }: SearchProviderProps) => {
filterOptions: searchFilters,
}}
initialDefaultFilters={["ui"]}
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"
}
version="v1"
/>
),
title: "AI Assistant",
badge: {
variant: "blue",
badgeType: "shaded",
children: "Beta",
},
},
]}
>
{children}
</UiSearchProvider>