Custom dashboards and unified ai no playground#1243
Merged
Conversation
This reverts commit 937db90.
Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
…er/route.ts Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
…er/route.ts Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
N2D4
approved these changes
Mar 13, 2026
…unified-ai-no-playground
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.
This PR implements unified AI endpoint and custom dashboards.
Unified AI Endpoint
We now use a single endpoint throughout the codebase that makes the call to openrouter. Specifically, email drafts, email templates, email themes, wysiwyg, cmd centre ai search and docs ai, all use this unified ai endpoint. All the tools are defined in the backend, all the prompts exist in the backend.
How to review this PR for unified ai endpoint:
This PR will be easier to review if we look at the different folders that were affected.
under packages - We added streaming functionality, and made renaming changes
under docs - there are three files that have changed
package.json - we updated the package (we were previously using a very old version of the package)
route.ts - we changed the call from a direct call to openrouter to the unified ai endpoint
ai-chat.tsx - because of updating the package, we had to make changes to adapt to the latest versions of the package
under backend
route.ts - the main unified ai endpoint. this endpoint uses various support files
forward.ts - this is the forward to production functionality
models.ts - consists of the models, and the rules for selecting those models
prompts.ts - consists of the base prompt + specific system prompts depending upon the usage
schema.ts
every single file under ai/tools folder - which as the name suggests, consists of the implementations of the different tools that can be provided to the llm
route-handlers - added support for streaming to SmartRoute and response
under dashboard
ai-search/route.ts - refactored the file to use unified ai endpoint
chat-adapters.ts - refactored the file to use unified ai endpoint and created extra checks for the ai generated code
Custom Dashboards
We let the user write their query in english. We then use AI to create dashboards that are interactive, live and savable. This PR includes a new package called dashboard-ui-components. This package has components that are used in the dashboard and more importantly, these components are being imported from esm in the ai generated code for custom dashboards. We also change the bar at the top for the products pages.
How to review this PR:
Review the new package (package/dashboard-ui-components), the setup and the files inside it.
Review the schema changes in stack-shared/src
Review the changes in dashboard. The following changes have been made
Updated the design-components folder since we moved the dashboard components to the new package
Updated imports for these components accordingly
Updated the title bar of the product pages
Created the files for custom dashboards under the dashboards folder and components under commands/create-dashboard
Created a script under dashboard/scripts that generates the file with type definitions that would go to the llm
Review the backend
Started using unified ai endpoint
Summary by CodeRabbit
New Features
Improvements