Files
dify/web/gen/zod/chat.gen.ts
Stephen Zhou 044e35fde4 spilt all
2026-01-25 15:55:10 +08:00

63 lines
2.5 KiB
TypeScript

// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zChatCompletionResponse, zChatRequest, zSuggestedQuestionsResponse } from './schemas.gen'
export const zSendChatMessageData = z.object({
body: zChatRequest,
path: z.never().optional(),
query: z.never().optional(),
})
export type SendChatMessageDataZodType = z.infer<typeof zSendChatMessageData>
/**
* Successful response. The content type and structure depend on the `response_mode` parameter in the request.
* - If `response_mode` is `blocking`, returns `application/json` with a `ChatCompletionResponse` object.
* - If `response_mode` is `streaming`, returns `text/event-stream` with a stream of `ChunkChatEvent` objects.
*/
export const zSendChatMessageResponse = zChatCompletionResponse
export type SendChatMessageResponseZodType = z.infer<typeof zSendChatMessageResponse>
export const zStopChatMessageGenerationData = z.object({
body: z.object({
user: z.string().describe('User identifier, must be consistent with the user passed in the send message interface. **Note**: The Service API does not share conversations created by the WebApp. Conversations created through the API are isolated from those created in the WebApp interface.'),
}),
path: z.object({
task_id: z.string().describe('Task ID, can be obtained from the streaming chunk return of a `/chat-messages` request.'),
}),
query: z.never().optional(),
})
export type StopChatMessageGenerationDataZodType = z.infer<typeof zStopChatMessageGenerationData>
/**
* Operation successful.
*/
export const zStopChatMessageGenerationResponse = z.object({
result: z.string().optional(),
}).describe('Operation successful.')
export type StopChatMessageGenerationResponseZodType = z.infer<typeof zStopChatMessageGenerationResponse>
export const zGetSuggestedQuestionsData = z.object({
body: z.never().optional(),
path: z.object({
message_id: z.string().describe('Message ID.'),
}),
query: z.object({
user: z.string().describe('User identifier. **Note**: The Service API does not share conversations created by the WebApp. Conversations created through the API are isolated from those created in the WebApp interface.'),
}),
})
export type GetSuggestedQuestionsDataZodType = z.infer<typeof zGetSuggestedQuestionsData>
/**
* Successfully retrieved suggested questions.
*/
export const zGetSuggestedQuestionsResponse = zSuggestedQuestionsResponse
export type GetSuggestedQuestionsResponseZodType = z.infer<typeof zGetSuggestedQuestionsResponse>