mirror of
https://github.com/langgenius/dify.git
synced 2026-07-21 18:58:35 +08:00
76 lines
1.9 KiB
TypeScript
76 lines
1.9 KiB
TypeScript
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
import { oc } from '@orpc/contract'
|
|
import * as z from 'zod'
|
|
import {
|
|
zPostWorkflowGenerateBody,
|
|
zPostWorkflowGenerateResponse,
|
|
zPostWorkflowGenerateStreamBody,
|
|
zPostWorkflowGenerateStreamResponse,
|
|
zPostWorkflowGenerateSuggestionsBody,
|
|
zPostWorkflowGenerateSuggestionsResponse,
|
|
} from './zod.gen'
|
|
|
|
/**
|
|
* Stream a Dify workflow graph (plan then result) via SSE
|
|
*/
|
|
export const post = oc
|
|
.route({
|
|
description: 'Stream a Dify workflow graph (plan then result) via SSE',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postWorkflowGenerateStream',
|
|
path: '/workflow-generate/stream',
|
|
tags: ['console'],
|
|
})
|
|
.input(z.object({ body: zPostWorkflowGenerateStreamBody }))
|
|
.output(zPostWorkflowGenerateStreamResponse)
|
|
|
|
export const stream = {
|
|
post,
|
|
}
|
|
|
|
/**
|
|
* Suggest example workflow-generator instructions for the tenant
|
|
*/
|
|
export const post2 = oc
|
|
.route({
|
|
description: 'Suggest example workflow-generator instructions for the tenant',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postWorkflowGenerateSuggestions',
|
|
path: '/workflow-generate/suggestions',
|
|
tags: ['console'],
|
|
})
|
|
.input(z.object({ body: zPostWorkflowGenerateSuggestionsBody }))
|
|
.output(zPostWorkflowGenerateSuggestionsResponse)
|
|
|
|
export const suggestions = {
|
|
post: post2,
|
|
}
|
|
|
|
/**
|
|
* Generate a Dify workflow graph from natural language
|
|
*/
|
|
export const post3 = oc
|
|
.route({
|
|
description: 'Generate a Dify workflow graph from natural language',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postWorkflowGenerate',
|
|
path: '/workflow-generate',
|
|
tags: ['console'],
|
|
})
|
|
.input(z.object({ body: zPostWorkflowGenerateBody }))
|
|
.output(zPostWorkflowGenerateResponse)
|
|
|
|
export const workflowGenerate = {
|
|
post: post3,
|
|
stream,
|
|
suggestions,
|
|
}
|
|
|
|
export const contract = {
|
|
workflowGenerate,
|
|
}
|