/**
 * OpenAI Node - Version 2 - Zod Schema
 * Discriminator: resource=text, operation=response
 *
 * 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('text').default('text'),
      operation: z.literal('response'),
      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(),
      responses: z.object({ values: z.array(z.object({ type: z.union([z.literal('text'), z.literal('image'), z.literal('file'), expressionSchema]).optional(), role: z.union([z.literal('user'), z.literal('assistant'), z.literal('system'), expressionSchema]).optional(), content: stringOrExpression.optional(), imageType: z.union([z.literal('url'), z.literal('fileId'), z.literal('base64'), expressionSchema]).optional(), imageUrl: stringOrExpression.optional(), binaryPropertyName: stringOrExpression.optional(), fileId: stringOrExpression.optional(), imageDetail: z.union([z.literal('auto'), z.literal('low'), z.literal('high'), expressionSchema]).optional(), fileType: z.union([z.literal('url'), z.literal('fileId'), z.literal('base64'), expressionSchema]).optional(), fileUrl: stringOrExpression.optional(), fileId: stringOrExpression.optional(), binaryPropertyName: stringOrExpression.optional(), fileName: stringOrExpression.optional() })).optional() }).optional(),
      simplify: booleanOrExpression.optional(),
      hideTools: resolveSchema({ parameters, schema: z.unknown(), required: false, displayOptions: {"show":{"modelId":["gpt-3.5-turbo-16k-0613","dall-e-3","text-embedding-3-large","dall-e-2","whisper-1","tts-1-hd-1106","tts-1-hd","gpt-4-0314","text-embedding-3-small","gpt-4-32k-0314","gpt-3.5-turbo-0301","gpt-4-vision-preview","gpt-3.5-turbo-16k","gpt-3.5-turbo-instruct-0914","tts-1","davinci-002","gpt-3.5-turbo-instruct","babbage-002","tts-1-1106","text-embedding-ada-002"]}}, defaults: {"modelId":{"mode":"list","value":""}} }),
      builtInTools: z.object({ webSearch: z.object({ searchContextSize: z.union([z.literal('low'), z.literal('medium'), z.literal('high'), expressionSchema]).optional(), allowedDomains: stringOrExpression.optional(), country: stringOrExpression.optional(), city: stringOrExpression.optional(), region: stringOrExpression.optional() }).optional(), fileSearch: z.object({ vectorStoreIds: z.union([iDataObjectSchema, z.string()]).optional(), filters: z.union([iDataObjectSchema, z.string()]).optional(), maxResults: numberOrExpression.optional() }).optional(), codeInterpreter: booleanOrExpression.optional() }).optional(),
      options: z.object({ conversationId: stringOrExpression.optional(), include: z.array(z.union([z.literal('code_interpreter_call.outputs'), z.literal('computer_call_output.output.image_url'), z.literal('file_search_call.results'), z.literal('message.input_image.image_url'), z.literal('message.output_text.logprobs'), z.literal('reasoning.encrypted_content'), z.literal('web_search_call.action.sources')])).optional(), instructions: stringOrExpression.optional(), maxTokens: numberOrExpression.optional(), maxToolsIterations: numberOrExpression.optional(), maxToolCalls: numberOrExpression.optional(), metadata: z.union([iDataObjectSchema, z.string()]).optional(), parallelToolCalls: booleanOrExpression.optional(), previousResponseId: stringOrExpression.optional(), promptConfig: z.object({ promptOptions: z.object({ promptId: stringOrExpression.optional(), version: stringOrExpression.optional(), variables: z.union([iDataObjectSchema, z.string()]).optional() }).optional() }).optional(), promptCacheKey: stringOrExpression.optional(), reasoning: z.object({ reasoningOptions: z.object({ effort: z.union([z.literal('low'), z.literal('medium'), z.literal('high'), expressionSchema]).optional(), summary: z.union([z.literal('none'), z.literal('auto'), z.literal('concise'), z.literal('detailed'), expressionSchema]).optional() }).optional() }).optional(), safetyIdentifier: stringOrExpression.optional(), serviceTier: z.union([z.literal('auto'), z.literal('flex'), z.literal('default'), z.literal('priority'), expressionSchema]).optional(), store: booleanOrExpression.optional(), textFormat: z.object({ textOptions: z.object({ type: z.union([z.literal('text'), z.literal('json_schema'), z.literal('json_object'), expressionSchema]).optional(), verbosity: z.union([z.literal('low'), z.literal('medium'), z.literal('high'), expressionSchema]).optional(), name: stringOrExpression.optional(), schema: z.union([iDataObjectSchema, z.string()]).optional(), description: stringOrExpression.optional(), strict: booleanOrExpression.optional() }).optional() }).optional(), topLogprobs: numberOrExpression.optional(), temperature: numberOrExpression.optional(), topP: numberOrExpression.optional(), truncation: booleanOrExpression.optional(), backgroundMode: z.object({ values: z.object({ enabled: booleanOrExpression.optional(), timeout: numberOrExpression.optional() }).optional() }).optional() }).optional(),
    }).optional(),
    subnodes: subnodesSchema.optional(),
  });
};