fix(rawapp): schema for openai (#7364)
This commit is contained in:
@@ -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".'
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user