diff --git a/frontend/src/lib/components/copilot/chat/app/core.ts b/frontend/src/lib/components/copilot/chat/app/core.ts index 39a0e9ceae..ec305c51a4 100644 --- a/frontend/src/lib/components/copilot/chat/app/core.ts +++ b/frontend/src/lib/components/copilot/chat/app/core.ts @@ -237,7 +237,8 @@ const getSetBackendRunnableToolDef = memo(() => createToolDef( getSetBackendRunnableSchema(), 'set_backend_runnable', - 'Create or update a backend runnable. Use type "inline" for custom code, or reference existing workspace/hub scripts/flows. Returns lint diagnostics (errors and warnings).' + 'Create or update a backend runnable. Use type "inline" for custom code, or reference existing workspace/hub scripts/flows. Returns lint diagnostics (errors and warnings).', + { strict: false } ) ) @@ -294,7 +295,6 @@ const getListWorkspaceRunnablesSchema = memo(() => query: z.string().describe('The search query to find workspace scripts and flows'), type: z .enum(['all', 'scripts', 'flows']) - .optional() .describe( 'Filter by type: "scripts" for scripts only, "flows" for flows only, "all" for both. Defaults to "all".' ) diff --git a/frontend/src/lib/components/copilot/chat/shared.ts b/frontend/src/lib/components/copilot/chat/shared.ts index 286197ecd0..ac92350a68 100644 --- a/frontend/src/lib/components/copilot/chat/shared.ts +++ b/frontend/src/lib/components/copilot/chat/shared.ts @@ -506,7 +506,8 @@ export interface ToolCallbacks { export function createToolDef( zodSchema: z.ZodSchema, name: string, - description: string + description: string, + { strict = true }: { strict?: boolean } = {} // we sometimes have to set strict to false for open ai models to avoid issues with complex properties ): ChatCompletionFunctionTool { // console.log('creating tool def for', name, zodSchema) let parameters = z.toJSONSchema(zodSchema) @@ -516,7 +517,7 @@ export function createToolDef( return { type: 'function', function: { - strict: true, + strict, name, description, parameters