Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
fix: Improve operations detection (#2470)
Giuseppeacfc8c41665f
diff --git a/apps/builder/app/builder/features/ai/ai-fetch-result.ts b/apps/builder/app/builder/features/ai/ai-fetch-result.tsindex 8bfa1b932d..7f4291d1a9 100644--- a/apps/builder/app/builder/features/ai/ai-fetch-result.ts+++ b/apps/builder/app/builder/features/ai/ai-fetch-result.ts@@ -107,6 +107,10 @@ export const fetchResult = async (command === operations.deleteInstanceName? jsx: requestParams.jsx,+ // @todo This helps the operations chain disambiguating operation detection.+ // Ideally though the operations chain can be executed just for one+ // specific kind of operation i.e. `command`.+ prompt: `${command}:\n\n${requestParams.prompt}`,}),signal: abortSignal,}),diff --git a/packages/ai/src/chains/operations/chain.ts b/packages/ai/src/chains/operations/chain.tsindex 50b0341be8..c5181ca275 100644--- a/packages/ai/src/chains/operations/chain.ts+++ b/packages/ai/src/chains/operations/chain.ts@@ -41,6 +41,9 @@ export const createChain = <ModelMessageFormat>(): Chain<async function chain({ model, context }) {const { prompt, components, jsx } = context;+ // @todo Make it so this chain can run only for+ // a specific operation among the supported ones.+ // This could be passed as context.operations.const operationsSchema = zodToJsonSchema(AiOperationsSchema.element,"AiOperationsSchema"