From b8e2a363576e8ba4ec3f1231fd5bfdf9b2f65294 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Thu, 14 Aug 2025 11:53:17 +0200 Subject: [PATCH] nit(aichat): Remove inline type restriction for ts (#6100) * Remove inline type restriction from TypeScript AI script generation Remove the requirement to inline object types in TypeScript AI chat prompts. The AI will now only receive guidance about using RT.ResourceType for resource types, without being forced to inline other parameter types. Fixes #6099 Co-authored-by: Ruben Fiszel * Rename TS_INLINE_TYPE_INSTRUCTION to TS_RESOURCE_TYPE_INSTRUCTION Co-authored-by: centdix * remove --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Ruben Fiszel Co-authored-by: centdix Co-authored-by: centdix --- frontend/src/lib/components/copilot/chat/script/core.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/frontend/src/lib/components/copilot/chat/script/core.ts b/frontend/src/lib/components/copilot/chat/script/core.ts index e93306023e..562fd13079 100644 --- a/frontend/src/lib/components/copilot/chat/script/core.ts +++ b/frontend/src/lib/components/copilot/chat/script/core.ts @@ -68,8 +68,6 @@ const TS_RESOURCE_TYPE_SYSTEM = `On Windmill, credentials and configuration are If you need credentials, you should add a parameter to \`main\` with the corresponding resource type inside the \`RT\` namespace: for instance \`RT.Stripe\`. You should only use them if you need them to satisfy the user's instructions. Always use the RT namespace.\n` -const TS_INLINE_TYPE_INSTRUCTION = `When using resource types, you should use RT.ResourceType as parameter type. For other parameters, you should inline the objects types instead of defining them separately. This is because Windmill requires the types (other than resource types) to be inlined to generate a user friendly UI from the parameters.` - const TS_WINDMILL_CLIENT_CONTEXT = ` The windmill client (wmill) can be used to interact with Windmill from the script. Import it with \`import * as wmill from "windmill-client"\`. Key functions include: @@ -213,9 +211,7 @@ export function getLangContext( : TS_RESOURCE_TYPE_SYSTEM + (allowResourcesFetch ? `To query the RT namespace, you can use the \`search_resource_types\` tool.\n` - : '')) + - TS_INLINE_TYPE_INSTRUCTION + - TS_WINDMILL_CLIENT_CONTEXT + : '')) + TS_WINDMILL_CLIENT_CONTEXT const mainFunctionName = isPreprocessor ? 'preprocessor' : 'main'