/**
 * OpenAI Node - Version 1.4 - Zod Schema
 * Discriminator: resource=assistant, operation=create
 *
 * Use .parse() for strict validation or .safeParse() for error handling.
 *
 * Schema helpers (z, expressionSchema, etc.) are passed as parameters
 * by the schema-validator, not imported from external files.
 *
 * @generated - CommonJS JavaScript for runtime loading
 */

module.exports = function getSchema({ parameters, z, expressionSchema, stringOrExpression, numberOrExpression, booleanOrExpression, resourceLocatorValueSchema, resourceMapperValueSchema, filterValueSchema, assignmentCollectionValueSchema, iDataObjectSchema, resolveSchema, toolInstanceSchema, memoryInstanceSchema }) {

  // Static subnode schema
  const subnodesSchema = z.object({
    tools: z.array(toolInstanceSchema).optional(),
    memory: memoryInstanceSchema.optional(),
  }).strict();

  return z.object({
    parameters: z.object({
      resource: z.literal('assistant'),
      operation: z.literal('create'),
      modelId: z.union([z.object({ __rl: z.literal(true), mode: z.union([z.literal('list'), z.literal('id')]), value: z.union([z.string(), z.number()]), cachedResultName: z.string().optional(), cachedResultUrl: z.string().optional() }), expressionSchema]).optional(),
      name: stringOrExpression,
      description: stringOrExpression.optional(),
      instructions: stringOrExpression.optional(),
      codeInterpreter: booleanOrExpression.optional(),
      knowledgeRetrieval: booleanOrExpression.optional(),
      file_ids: resolveSchema({ parameters, schema: z.array(z.string()), required: false, displayOptions: {"show":{"codeInterpreter":[true],"knowledgeRetrieval":[true]},"hide":{"knowledgeRetrieval":[true],"codeInterpreter":[true]}}, defaults: {"codeInterpreter":false,"knowledgeRetrieval":false} }),
      options: z.object({ temperature: numberOrExpression.optional(), topP: numberOrExpression.optional(), failIfExists: booleanOrExpression.optional() }).optional(),
    }).optional(),
    subnodes: subnodesSchema.optional(),
  });
};