dify/packages/contracts/generated/api/console/workflow-generate/zod.gen.ts
Crazywoola 8809cc036d
feat(workflow-generator): enhance the AI auto-creation flow end-to-end (#38175)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2026-07-01 02:28:58 +00:00

79 lines
2.2 KiB
TypeScript

// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* GeneratorResponse
*/
export const zGeneratorResponse = z.unknown()
/**
* WorkflowInstructionSuggestionsPayload
*
* Payload for the workflow-generator instruction-suggestions endpoint.
*
* Runs before the user picks a model, so the suggestions come from the
* tenant's default model. The underlying generator never raises — an empty
* ``suggestions`` list is a valid 200 (soft-fail).
*/
export const zWorkflowInstructionSuggestionsPayload = z.object({
count: z.int().gte(1).lte(6).optional().default(4),
language: z.string().nullish(),
mode: z.enum(['advanced-chat', 'workflow']),
})
/**
* 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', 'auto', 'workflow']),
model_config: zModelConfig,
})
export const zPostWorkflowGenerateBody = zWorkflowGeneratePayload
/**
* Workflow graph generated successfully
*/
export const zPostWorkflowGenerateResponse = zGeneratorResponse
export const zPostWorkflowGenerateStreamBody = zWorkflowGeneratePayload
/**
* Server-Sent Events stream of plan/result events
*/
export const zPostWorkflowGenerateStreamResponse = z.record(z.string(), z.unknown())
export const zPostWorkflowGenerateSuggestionsBody = zWorkflowInstructionSuggestionsPayload
/**
* Suggestions generated successfully
*/
export const zPostWorkflowGenerateSuggestionsResponse = zGeneratorResponse