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

Add chatbot #969

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@docsearch/react": "3",
"@headlessui/react": "^1.7.13",
"@heroicons/react": "^2.0.18",
"@langbase/components": "^0.1.5",
"@langbase/components": "^0.1.6",
"@mdx-js/mdx": "^3.0.1",
"@next/third-parties": "^14.1.4",
"@radix-ui/react-hover-card": "^1.1.1",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 13 additions & 9 deletions src/app/chat.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Chatbot } from '@langbase/components';
import {Chatbot} from '@langbase/components';
import '@langbase/components/styles';

export default function Chat() {
Expand All @@ -11,25 +11,29 @@ export default function Chat() {
background-color: #dedede;
}
`}</style>
<Chatbot apiRoute="/docs/api/chat"
openingMessage="Hi there! Welcome to Ask Sourcegraph AI agent. How can I help you?"
<Chatbot
title="Ask AI"
triggerText="Ask AI"
badge="Experimental"
apiRoute="/docs/api/chat"
openingMessage="Hi there! I'm Sourcegraph's AI assistant trained for our documentation. How can I help you?"
// Remember AI can make mistakes, please double-check responses.
suggestions={[
{
title: `What is SourceGraph?`,
prompt: `What is SourceGraph?`
title: `What is Sourcegraph?`,
prompt: `What is Sourcegraph?`
},
{
title: `What is Cody?`,
prompt: `What is Cody?`
},
{
title: `What can I do with Cody?`,
prompt: `What can I do with Cody?`
title: `Search query syntax`,
prompt: `What is the search query syntax?`
},
{
title: `What are search query types?`,
prompt: `What are search query types?`
title: `Language specific query examples`,
prompt: `Give me language specific query examples?`
}
]}
/>
Expand Down
13 changes: 7 additions & 6 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Providers } from '@/app/providers';
import { Layout } from '@/components/Layout';
import { GoogleAnalytics } from '@next/third-parties/google';
import Chat from '@/app/chat';
import {Providers} from '@/app/providers';
import {Layout} from '@/components/Layout';
import {GoogleAnalytics} from '@next/third-parties/google';
import clsx from 'clsx';
import config from 'docs.config';
import { type Metadata } from 'next';
import { Inter } from 'next/font/google';
import {type Metadata} from 'next';
import {Inter} from 'next/font/google';
import localFont from 'next/font/local';

import '@/styles/tailwind.css';
Expand Down Expand Up @@ -98,7 +99,7 @@ export default function RootLayout({children}: {children: React.ReactNode}) {
className="flex min-h-full bg-light-bg dark:bg-dark-bg"
>
<Providers>
{/* <Chat /> */}
<Chat />
<Layout>{children}</Layout>
</Providers>
</body>
Expand Down