feat: add prompt and context props to AiPanelContent and export its type#800
Merged
feat: add prompt and context props to AiPanelContent and export its type#800
prompt and context props to AiPanelContent and export its type#800Conversation
|
Deployment failed with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
sdk-nextjs | 25676f3 | Mar 13 2026, 05:30 AM |
Deploying sdk with
|
| Latest commit: |
25676f3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://56fa4e9c.sdk-8n4.pages.dev |
| Branch Preview URL: | https://ai-context.sdk-8n4.pages.dev |
…requests and system prompts
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for passing structured “AI context” (site/page metadata) from the AI panel through the ASK_AI action to influence the server-side system prompt.
Changes:
- Introduces a new
AIContexttype and threads it throughAIChatOptions/AIConfig/AiPanelContentProps. - Forwards
contextfrom the AI panel requests into theASK_AIaction andChaiAIChatHandler. - Extends
getAskAiSystemPrompt()to append serialized site/page context into the system prompt.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/actions.ts | Adds AIContext and attaches it to AIChatOptions. |
| src/pages/panels/ai-panel/ai-panel-other-lang.tsx | Includes config.context in ASK_AI request body for translation/update flows. |
| src/pages/panels/ai-panel/ai-panel-default-lang.tsx | Includes config.context in ASK_AI request body for default-language flow. |
| src/pages/panels/ai-panel/ai-panel-content.tsx | Exposes context on AiPanelContentProps and injects it into the AI config provider. |
| src/pages/panels/ai-panel/ai-models-context.tsx | Extends AIConfig to carry optional context. |
| src/pages/index.ts | Re-exports AiPanelContentProps as ChaiAiPanelProps. |
| src/actions/classes/system-prompt.ts | Updates getAskAiSystemPrompt() to accept context and append it to the prompt. |
| src/actions/classes/chai-ai-chat-handler.ts | Plumbs context into getAskAiSystemPrompt(); refactors image-message assembly formatting. |
| src/actions/builder/ask-ai-action.ts | Changes context type to AIContext and forwards it to the chat handler. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
surajair
approved these changes
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.