/**
 * Alibaba Cloud Model Studio Node - Version 1 - Zod Schema
 * Discriminator: resource=text, operation=message
 *
 * 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, toolInstanceSchema }) {

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

  return z.object({
    parameters: z.object({
      resource: z.literal('text').default('text'),
      operation: z.literal('message').default('message'),
      modelId: z.union([z.literal('qwen3-max'), z.literal('qwen3-max-2026-01-23'), z.literal('qwen3.5-122b-a10b'), z.literal('qwen3.5-27b'), z.literal('qwen3.5-35b-a3b'), z.literal('qwen3.5-397b-a17b'), z.literal('qwen3.5-flash'), z.literal('qwen3.5-flash-2026-02-23'), z.literal('qwen3.5-plus'), z.literal('qwen3.5-plus-2026-02-15'), expressionSchema]).optional(),
      messages: z.object({ messageValues: z.array(z.object({ content: stringOrExpression.optional(), role: z.union([z.literal('user'), z.literal('assistant'), expressionSchema]).optional() })).optional() }).optional(),
      simplify: booleanOrExpression.optional(),
      options: z.object({ enableSearch: booleanOrExpression.optional(), maxTokens: numberOrExpression.optional(), maxToolsIterations: numberOrExpression.optional(), repetitionPenalty: numberOrExpression.optional(), seed: numberOrExpression.optional(), stop: stringOrExpression.optional(), system: stringOrExpression.optional(), temperature: numberOrExpression.optional(), topK: numberOrExpression.optional(), topP: numberOrExpression.optional() }).optional(),
    }).optional(),
    subnodes: subnodesSchema.optional(),
  });
};