Skip to content

Implement basic URL scheme for Assistant & AI Search #3503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 29, 2025
Merged
5 changes: 5 additions & 0 deletions .changeset/odd-candles-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gitbook": patch
---

Implement basic URL scheme for assistant with ask
41 changes: 39 additions & 2 deletions packages/gitbook/e2e/internal.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
CustomizationAIMode,
CustomizationBackground,
CustomizationCorners,
CustomizationDefaultMonospaceFont,
Expand Down Expand Up @@ -73,14 +74,32 @@ const testCases: TestsCase[] = [
},
{
name: 'AI Search',
url: '?q=What+is+GitBook%3F&ask=true',
url: `${getCustomizationURL({
ai: {
mode: CustomizationAIMode.Search,
},
})}&ask=What+is+GitBook%3F`,
run: async (page) => {
await expect(page.getByTestId('search-ask-answer')).toBeVisible({
timeout: 15_000,
});
},
screenshot: false,
},
{
name: 'AI Assistant',
url: `${getCustomizationURL({
ai: {
mode: CustomizationAIMode.Assistant,
},
})}&ask=What+is+GitBook%3F`,
run: async (page) => {
await expect(page.getByTestId('ai-chat')).toBeVisible({
timeout: 15_000,
});
},
screenshot: false,
},
{
name: 'Not found',
url: 'content-not-found',
Expand Down Expand Up @@ -299,14 +318,32 @@ const testCases: TestsCase[] = [
},
{
name: 'AI Search',
url: '?q=What+is+GitBook%3F&ask=true',
url: `${getCustomizationURL({
ai: {
mode: CustomizationAIMode.Search,
},
})}&ask=What+is+GitBook%3F`,
run: async (page) => {
await expect(page.getByTestId('search-ask-answer')).toBeVisible({
timeout: 15_000,
});
},
screenshot: false,
},
{
name: 'AI Assistant',
url: `${getCustomizationURL({
ai: {
mode: CustomizationAIMode.Assistant,
},
})}&ask=What+is+GitBook%3F`,
run: async (page) => {
await expect(page.getByTestId('ai-chat')).toBeVisible({
timeout: 15_000,
});
},
screenshot: false,
},
{
name: 'Not found',
url: 'content-not-found',
Expand Down
Loading