dify/web/gen/orpc/api/messages.ts
Stephen Zhou 3f7d76d4e2
sort
2026-01-25 20:37:32 +08:00

49 lines
2.1 KiB
TypeScript

// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zGetConversationHistoryData, zGetConversationHistoryResponse, zGetSuggestedQuestionsData, zGetSuggestedQuestionsResponse, zPostChatMessageFeedbackData, zPostChatMessageFeedbackResponse } from '../../zod/api/messages'
import { base } from '../common'
/**
* Message Feedback
*
* End-users can provide feedback messages, facilitating application developers to optimize expected outputs.
*/
export const postChatMessageFeedbackContract = base.route({
method: 'POST',
path: '/messages/{message_id}/feedbacks',
operationId: 'postChatMessageFeedback',
summary: 'Message Feedback',
description: 'End-users can provide feedback messages, facilitating application developers to optimize expected outputs.',
tags: ['Feedback'],
}).input(zPostChatMessageFeedbackData).output(z.object({ body: zPostChatMessageFeedbackResponse, status: z.literal(200) }))
/**
* Next Suggested Questions
*
* Get next questions suggestions for the current message.
*/
export const getSuggestedQuestionsContract = base.route({
method: 'GET',
path: '/messages/{message_id}/suggested',
operationId: 'getSuggestedQuestions',
summary: 'Next Suggested Questions',
description: 'Get next questions suggestions for the current message.',
tags: ['Chat'],
}).input(zGetSuggestedQuestionsData).output(z.object({ body: zGetSuggestedQuestionsResponse, status: z.literal(200) }))
/**
* Get Conversation History Messages
*
* Returns historical chat records in a scrolling load format, with the first page returning the latest `{limit}` messages, i.e., in reverse order.
*/
export const getConversationHistoryContract = base.route({
method: 'GET',
path: '/messages',
operationId: 'getConversationHistory',
summary: 'Get Conversation History Messages',
description: 'Returns historical chat records in a scrolling load format, with the first page returning the latest `{limit}` messages, i.e., in reverse order.',
tags: ['Conversations'],
}).input(zGetConversationHistoryData).output(z.object({ body: zGetConversationHistoryResponse, status: z.literal(200) }))