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 <rubenfiszel@users.noreply.github.com> * Rename TS_INLINE_TYPE_INSTRUCTION to TS_RESOURCE_TYPE_INSTRUCTION Co-authored-by: centdix <centdix@users.noreply.github.com> * remove --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Ruben Fiszel <rubenfiszel@users.noreply.github.com> Co-authored-by: centdix <centdix@users.noreply.github.com> Co-authored-by: centdix <farhadg110@gmail.com>
This commit is contained in:
@@ -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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user