// This file is auto-generated by @hey-api/openapi-ts

import * as z from 'zod'

/**
 * GeneratorResponse
 */
export const zGeneratorResponse = z.unknown()

/**
 * LLMMode
 *
 * Enum class for large language model mode.
 */
export const zLlmMode = z.enum(['chat', 'completion'])

/**
 * ModelConfig
 */
export const zModelConfig = z.object({
  completion_params: z.record(z.string(), z.unknown()).optional(),
  mode: zLlmMode,
  name: z.string(),
  provider: z.string(),
})

/**
 * WorkflowGeneratePayload
 *
 * Payload for the cmd+k `/create` and `/refine` workflow generator endpoint.
 *
 * See ``services/workflow_generator_service.py`` for behaviour. Errors are
 * surfaced through the same envelope as ``/rule-generate`` so the frontend
 * can reuse its existing handler.
 */
export const zWorkflowGeneratePayload = z.object({
  current_graph: z.record(z.string(), z.unknown()).nullish(),
  ideal_output: z.string().optional().default(''),
  instruction: z.string(),
  mode: z.enum(['advanced-chat', 'workflow']),
  model_config: zModelConfig,
})

export const zPostWorkflowGenerateBody = zWorkflowGeneratePayload

/**
 * Workflow graph generated successfully
 */
export const zPostWorkflowGenerateResponse = zGeneratorResponse
