mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 17:38:04 +08:00
109 lines
4.7 KiB
TypeScript
109 lines
4.7 KiB
TypeScript
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
import { z } from 'zod'
|
|
|
|
import { zConversationHistoryResponse, zConversationListItem, zConversationRenameRequest, zConversationsListResponse, zConversationVariablesResponse } from './schemas.gen'
|
|
|
|
export const zGetConversationHistoryData = z.object({
|
|
body: z.never().optional(),
|
|
path: z.never().optional(),
|
|
query: z.object({
|
|
conversation_id: z.string().describe('Conversation ID.'),
|
|
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.'),
|
|
first_id: z.string().describe('The ID of the first chat record on the current page, default is null (for fetching the latest). For subsequent pages, use the ID of the first message from the current list to get older messages.').optional(),
|
|
limit: z.number().int().describe('How many chat history messages to return in one request, default is 20.').optional().default(20),
|
|
}),
|
|
})
|
|
|
|
export type GetConversationHistoryDataZodType = z.infer<typeof zGetConversationHistoryData>
|
|
|
|
/**
|
|
* Successfully retrieved conversation history.
|
|
*/
|
|
export const zGetConversationHistoryResponse = zConversationHistoryResponse
|
|
|
|
export type GetConversationHistoryResponseZodType = z.infer<typeof zGetConversationHistoryResponse>
|
|
|
|
export const zGetConversationsListData = z.object({
|
|
body: z.never().optional(),
|
|
path: z.never().optional(),
|
|
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.'),
|
|
last_id: z.string().describe('(Optional) The ID of the last record on the current page (for pagination).').optional(),
|
|
limit: z.number().int().gte(1).lte(100).describe('(Optional) How many records to return. Default 20, Min 1, Max 100.').optional().default(20),
|
|
sort_by: z.enum([
|
|
'created_at',
|
|
'-created_at',
|
|
'updated_at',
|
|
'-updated_at',
|
|
]).describe('Sorting Field. Default: -updated_at. \'-\' prefix for descending.').optional(),
|
|
}),
|
|
})
|
|
|
|
export type GetConversationsListDataZodType = z.infer<typeof zGetConversationsListData>
|
|
|
|
/**
|
|
* Successfully retrieved conversations list.
|
|
*/
|
|
export const zGetConversationsListResponse = zConversationsListResponse
|
|
|
|
export type GetConversationsListResponseZodType = z.infer<typeof zGetConversationsListResponse>
|
|
|
|
export const zDeleteConversationData = z.object({
|
|
body: z.object({
|
|
user: z.string().describe('The 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.'),
|
|
}),
|
|
path: z.object({
|
|
conversation_id: z.string().describe('Conversation ID.'),
|
|
}),
|
|
query: z.never().optional(),
|
|
})
|
|
|
|
export type DeleteConversationDataZodType = z.infer<typeof zDeleteConversationData>
|
|
|
|
/**
|
|
* Conversation deleted successfully. No Content.
|
|
*/
|
|
export const zDeleteConversationResponse = z.void().describe('Conversation deleted successfully. No Content.')
|
|
|
|
export type DeleteConversationResponseZodType = z.infer<typeof zDeleteConversationResponse>
|
|
|
|
export const zRenameConversationData = z.object({
|
|
body: zConversationRenameRequest,
|
|
path: z.object({
|
|
conversation_id: z.string().describe('Conversation ID.'),
|
|
}),
|
|
query: z.never().optional(),
|
|
})
|
|
|
|
export type RenameConversationDataZodType = z.infer<typeof zRenameConversationData>
|
|
|
|
/**
|
|
* Conversation renamed successfully.
|
|
*/
|
|
export const zRenameConversationResponse = zConversationListItem
|
|
|
|
export type RenameConversationResponseZodType = z.infer<typeof zRenameConversationResponse>
|
|
|
|
export const zGetConversationVariablesData = z.object({
|
|
body: z.never().optional(),
|
|
path: z.object({
|
|
conversation_id: z.string().describe('The ID of the conversation to retrieve variables from.'),
|
|
}),
|
|
query: z.object({
|
|
user: z.string().describe('The user identifier.'),
|
|
last_id: z.string().describe('(Optional) The ID of the last record on the current page (for pagination).').optional(),
|
|
limit: z.number().int().gte(1).lte(100).describe('(Optional) How many records to return. Default 20, Min 1, Max 100.').optional().default(20),
|
|
variable_name: z.string().describe('(Optional) Filter variables by a specific name.').optional(),
|
|
}),
|
|
})
|
|
|
|
export type GetConversationVariablesDataZodType = z.infer<typeof zGetConversationVariablesData>
|
|
|
|
/**
|
|
* Successfully retrieved conversation variables.
|
|
*/
|
|
export const zGetConversationVariablesResponse = zConversationVariablesResponse
|
|
|
|
export type GetConversationVariablesResponseZodType = z.infer<typeof zGetConversationVariablesResponse>
|