|
| 1 | +# Sourcegraph Docs - Agent Instructions |
| 2 | + |
| 3 | +## Build Commands |
| 4 | + |
| 5 | +- **Type Check**: `npx tsc --noEmit` |
| 6 | +- **Build**: `npm run build` |
| 7 | +- **Dev**: `npm run dev` |
| 8 | +- **Lint**: `npm run lint` |
| 9 | + |
| 10 | +## AI Chat Integration |
| 11 | + |
| 12 | +This site uses **runLLM** for the AI chat widget. The integration is implemented via: |
| 13 | + |
| 14 | +- **Location**: `src/app/layout.tsx` |
| 15 | +- **Widget**: runLLM script loaded via Next.js `<Script>` component |
| 16 | +- **Configuration**: |
| 17 | + - Position: BOTTOM_RIGHT |
| 18 | + - Theme color: #FF5543 (Sourcegraph brand color) |
| 19 | + - Button text: "Ask AI" |
| 20 | + - Keyboard shortcut: Mod+j |
| 21 | + |
| 22 | +### runLLM Configuration |
| 23 | + |
| 24 | +To update the runLLM assistant ID or other settings, modify the Script component in `src/app/layout.tsx`: |
| 25 | + |
| 26 | +```tsx |
| 27 | +<Script |
| 28 | + id="runllm-widget-script" |
| 29 | + type="module" |
| 30 | + src="https://widget.runllm.com" |
| 31 | + crossOrigin="" |
| 32 | + runllm-keyboard-shortcut="Mod+j" |
| 33 | + runllm-name="Sourcegraph AI Assistant" |
| 34 | + runllm-position="BOTTOM_RIGHT" |
| 35 | + runllm-assistant-id="YOUR_ASSISTANT_ID" // Update this |
| 36 | + runllm-theme-color="#FF5543" |
| 37 | + runllm-floating-button-text="Ask AI" |
| 38 | + async |
| 39 | +/> |
| 40 | +``` |
| 41 | + |
| 42 | +### Previous Integration |
| 43 | + |
| 44 | +Previously used **Langbase** with custom React components. This has been completely removed: |
| 45 | +- Removed `@langbase/components` and `langbase` packages |
| 46 | +- Removed custom chat components (`src/app/chat.tsx`, `src/components/ChatBot/`) |
| 47 | +- Removed API routes (`src/app/api/chat/`) |
| 48 | +- Removed memory creation scripts |
| 49 | + |
| 50 | +## Important Notes |
| 51 | + |
| 52 | +- **Assistant ID**: The `runllm-assistant-id` is currently set to "YOUR_ASSISTANT_ID" and needs to be updated with the actual Sourcegraph runLLM assistant ID |
| 53 | +- **Deployment**: After updating the assistant ID, add the deployment URL to the runLLM dashboard |
| 54 | +- **Styling**: The widget inherits the site's theme and uses the Sourcegraph brand color (#FF5543) |
0 commit comments