Skip to content
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