This commit is contained in:
Stephen Zhou 2026-01-25 16:01:51 +08:00
parent 044e35fde4
commit ef31649ce3
No known key found for this signature in database
46 changed files with 603 additions and 502 deletions

View File

@ -0,0 +1,20 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zGetChatAppFeedbacksData, zGetChatAppFeedbacksResponse } from '../../zod/api/app.gen'
import { base } from '../common.gen'
/**
* Get feedbacks of application
*
* Get application's feedbacks.
*/
export const getChatAppFeedbacksContract = base.route({
path: '/app/feedbacks',
method: 'GET',
operationId: 'getChatAppFeedbacks',
summary: 'Get feedbacks of application',
description: 'Get application\'s feedbacks.',
tags: ['Feedback'],
}).input(zGetChatAppFeedbacksData).output(z.object({ body: zGetChatAppFeedbacksResponse, status: z.literal(200) }))

View File

@ -2,8 +2,8 @@
import { z } from 'zod'
import { zCreateAnnotationData, zCreateAnnotationResponse, zDeleteAnnotationData, zGetAnnotationListData, zGetAnnotationListResponse, zGetInitialAnnotationReplySettingsStatusData, zGetInitialAnnotationReplySettingsStatusResponse, zInitialAnnotationReplySettingsData, zInitialAnnotationReplySettingsResponse, zUpdateAnnotationData, zUpdateAnnotationResponse } from '../zod/annotations.gen'
import { base } from './common.gen'
import { zCreateAnnotationData, zCreateAnnotationResponse, zDeleteAnnotationData, zGetAnnotationListData, zGetAnnotationListResponse, zGetInitialAnnotationReplySettingsStatusData, zGetInitialAnnotationReplySettingsStatusResponse, zInitialAnnotationReplySettingsData, zInitialAnnotationReplySettingsResponse, zUpdateAnnotationData, zUpdateAnnotationResponse } from '../../zod/api/apps.gen'
import { base } from '../common.gen'
/**
* Get Annotation List

View File

@ -2,8 +2,8 @@
import { z } from 'zod'
import { zAudioToTextData, zAudioToTextResponse, zTextToAudioChatData, zTextToAudioChatResponse } from '../zod/tts.gen'
import { base } from './common.gen'
import { zAudioToTextData, zAudioToTextResponse } from '../../zod/api/audio-to-text.gen'
import { base } from '../common.gen'
/**
* Speech to Text
@ -18,17 +18,3 @@ export const audioToTextContract = base.route({
description: 'Convert audio file to text. Supported formats: mp3, mp4, mpeg, mpga, m4a, wav, webm. File size limit: 15MB.',
tags: ['TTS'],
}).input(zAudioToTextData).output(z.object({ body: zAudioToTextResponse, status: z.literal(200) }))
/**
* Text to Audio
*
* Convert text to speech.
*/
export const textToAudioChatContract = base.route({
path: '/text-to-audio',
method: 'POST',
operationId: 'textToAudioChat',
summary: 'Text to Audio',
description: 'Convert text to speech.',
tags: ['TTS'],
}).input(zTextToAudioChatData).output(z.object({ body: zTextToAudioChatResponse, status: z.literal(200) }))

View File

@ -2,8 +2,8 @@
import { z } from 'zod'
import { zGetSuggestedQuestionsData, zGetSuggestedQuestionsResponse, zSendChatMessageData, zSendChatMessageResponse, zStopChatMessageGenerationData, zStopChatMessageGenerationResponse } from '../zod/chat.gen'
import { base } from './common.gen'
import { zSendChatMessageData, zSendChatMessageResponse, zStopChatMessageGenerationData, zStopChatMessageGenerationResponse } from '../../zod/api/chat-messages.gen'
import { base } from '../common.gen'
/**
* Send Chat Message
@ -32,17 +32,3 @@ export const stopChatMessageGenerationContract = base.route({
description: 'Stops a chat message generation task. Only supported in streaming mode.',
tags: ['Chat'],
}).input(zStopChatMessageGenerationData).output(z.object({ body: zStopChatMessageGenerationResponse, status: z.literal(200) }))
/**
* Next Suggested Questions
*
* Get next questions suggestions for the current message.
*/
export const getSuggestedQuestionsContract = base.route({
path: '/messages/{message_id}/suggested',
method: 'GET',
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) }))

View File

@ -2,22 +2,8 @@
import { z } from 'zod'
import { zDeleteConversationData, zGetConversationHistoryData, zGetConversationHistoryResponse, zGetConversationsListData, zGetConversationsListResponse, zGetConversationVariablesData, zGetConversationVariablesResponse, zRenameConversationData, zRenameConversationResponse } from '../zod/conversations.gen'
import { base } from './common.gen'
/**
* 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({
path: '/messages',
method: 'GET',
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) }))
import { zDeleteConversationData, zGetConversationsListData, zGetConversationsListResponse, zGetConversationVariablesData, zGetConversationVariablesResponse, zRenameConversationData, zRenameConversationResponse } from '../../zod/api/conversations.gen'
import { base } from '../common.gen'
/**
* Get Conversations

View File

@ -2,8 +2,8 @@
import { z } from 'zod'
import { zPreviewChatFileData, zPreviewChatFileResponse, zUploadChatFileData, zUploadChatFileResponse } from '../zod/files.gen'
import { base } from './common.gen'
import { zPreviewChatFileData, zPreviewChatFileResponse, zUploadChatFileData, zUploadChatFileResponse } from '../../zod/api/files.gen'
import { base } from '../common.gen'
/**
* File Upload

View File

@ -0,0 +1,20 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zGetChatAppInfoResponse } from '../../zod/api/info.gen'
import { base } from '../common.gen'
/**
* Get Application Basic Information
*
* Used to get basic information about this application.
*/
export const getChatAppInfoContract = base.route({
path: '/info',
method: 'GET',
operationId: 'getChatAppInfo',
summary: 'Get Application Basic Information',
description: 'Used to get basic information about this application.',
tags: ['Application'],
}).output(z.object({ body: zGetChatAppInfoResponse, status: z.literal(200) }))

View File

@ -0,0 +1,48 @@
// 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.gen'
import { base } from '../common.gen'
/**
* Message Feedback
*
* End-users can provide feedback messages, facilitating application developers to optimize expected outputs.
*/
export const postChatMessageFeedbackContract = base.route({
path: '/messages/{message_id}/feedbacks',
method: 'POST',
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({
path: '/messages/{message_id}/suggested',
method: 'GET',
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({
path: '/messages',
method: 'GET',
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) }))

View File

@ -0,0 +1,20 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zGetChatAppMetaResponse } from '../../zod/api/meta.gen'
import { base } from '../common.gen'
/**
* Get Application Meta Information
*
* Used to get icons of tools in this application.
*/
export const getChatAppMetaContract = base.route({
path: '/meta',
method: 'GET',
operationId: 'getChatAppMeta',
summary: 'Get Application Meta Information',
description: 'Used to get icons of tools in this application.',
tags: ['Application'],
}).output(z.object({ body: zGetChatAppMetaResponse, status: z.literal(200) }))

View File

@ -0,0 +1,20 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zGetChatAppParametersData, zGetChatAppParametersResponse } from '../../zod/api/parameters.gen'
import { base } from '../common.gen'
/**
* Get Application Parameters Information
*
* Used at the start of entering the page to obtain information such as features, input parameter names, types, and default values.
*/
export const getChatAppParametersContract = base.route({
path: '/parameters',
method: 'GET',
operationId: 'getChatAppParameters',
summary: 'Get Application Parameters Information',
description: 'Used at the start of entering the page to obtain information such as features, input parameter names, types, and default values.',
tags: ['Application'],
}).input(zGetChatAppParametersData).output(z.object({ body: zGetChatAppParametersResponse, status: z.literal(200) }))

View File

@ -0,0 +1,20 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zGetChatWebAppSettingsResponse } from '../../zod/api/site.gen'
import { base } from '../common.gen'
/**
* Get Application WebApp Settings
*
* Used to get the WebApp settings of the application.
*/
export const getChatWebAppSettingsContract = base.route({
path: '/site',
method: 'GET',
operationId: 'getChatWebAppSettings',
summary: 'Get Application WebApp Settings',
description: 'Used to get the WebApp settings of the application.',
tags: ['Application'],
}).output(z.object({ body: zGetChatWebAppSettingsResponse, status: z.literal(200) }))

View File

@ -0,0 +1,20 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zTextToAudioChatData, zTextToAudioChatResponse } from '../../zod/api/text-to-audio.gen'
import { base } from '../common.gen'
/**
* Text to Audio
*
* Convert text to speech.
*/
export const textToAudioChatContract = base.route({
path: '/text-to-audio',
method: 'POST',
operationId: 'textToAudioChat',
summary: 'Text to Audio',
description: 'Convert text to speech.',
tags: ['TTS'],
}).input(zTextToAudioChatData).output(z.object({ body: zTextToAudioChatResponse, status: z.literal(200) }))

View File

@ -1,62 +0,0 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zGetChatAppInfoResponse, zGetChatAppMetaResponse, zGetChatAppParametersData, zGetChatAppParametersResponse, zGetChatWebAppSettingsResponse } from '../zod/application.gen'
import { base } from './common.gen'
/**
* Get Application Basic Information
*
* Used to get basic information about this application.
*/
export const getChatAppInfoContract = base.route({
path: '/info',
method: 'GET',
operationId: 'getChatAppInfo',
summary: 'Get Application Basic Information',
description: 'Used to get basic information about this application.',
tags: ['Application'],
}).output(z.object({ body: zGetChatAppInfoResponse, status: z.literal(200) }))
/**
* Get Application Parameters Information
*
* Used at the start of entering the page to obtain information such as features, input parameter names, types, and default values.
*/
export const getChatAppParametersContract = base.route({
path: '/parameters',
method: 'GET',
operationId: 'getChatAppParameters',
summary: 'Get Application Parameters Information',
description: 'Used at the start of entering the page to obtain information such as features, input parameter names, types, and default values.',
tags: ['Application'],
}).input(zGetChatAppParametersData).output(z.object({ body: zGetChatAppParametersResponse, status: z.literal(200) }))
/**
* Get Application Meta Information
*
* Used to get icons of tools in this application.
*/
export const getChatAppMetaContract = base.route({
path: '/meta',
method: 'GET',
operationId: 'getChatAppMeta',
summary: 'Get Application Meta Information',
description: 'Used to get icons of tools in this application.',
tags: ['Application'],
}).output(z.object({ body: zGetChatAppMetaResponse, status: z.literal(200) }))
/**
* Get Application WebApp Settings
*
* Used to get the WebApp settings of the application.
*/
export const getChatWebAppSettingsContract = base.route({
path: '/site',
method: 'GET',
operationId: 'getChatWebAppSettings',
summary: 'Get Application WebApp Settings',
description: 'Used to get the WebApp settings of the application.',
tags: ['Application'],
}).output(z.object({ body: zGetChatWebAppSettingsResponse, status: z.literal(200) }))

View File

@ -2,13 +2,18 @@
import { oc } from '@orpc/contract'
import { createAnnotationContract, deleteAnnotationContract, getAnnotationListContract, getInitialAnnotationReplySettingsStatusContract, initialAnnotationReplySettingsContract, updateAnnotationContract } from './annotations.gen'
import { getChatAppInfoContract, getChatAppMetaContract, getChatAppParametersContract, getChatWebAppSettingsContract } from './application.gen'
import { getSuggestedQuestionsContract, sendChatMessageContract, stopChatMessageGenerationContract } from './chat.gen'
import { deleteConversationContract, getConversationHistoryContract, getConversationsListContract, getConversationVariablesContract, renameConversationContract } from './conversations.gen'
import { getChatAppFeedbacksContract, postChatMessageFeedbackContract } from './feedback.gen'
import { previewChatFileContract, uploadChatFileContract } from './files.gen'
import { audioToTextContract, textToAudioChatContract } from './tts.gen'
import { getChatAppFeedbacksContract } from './api/app.gen'
import { createAnnotationContract, deleteAnnotationContract, getAnnotationListContract, getInitialAnnotationReplySettingsStatusContract, initialAnnotationReplySettingsContract, updateAnnotationContract } from './api/apps.gen'
import { audioToTextContract } from './api/audio-to-text.gen'
import { sendChatMessageContract, stopChatMessageGenerationContract } from './api/chat-messages.gen'
import { deleteConversationContract, getConversationsListContract, getConversationVariablesContract, renameConversationContract } from './api/conversations.gen'
import { previewChatFileContract, uploadChatFileContract } from './api/files.gen'
import { getChatAppInfoContract } from './api/info.gen'
import { getConversationHistoryContract, getSuggestedQuestionsContract, postChatMessageFeedbackContract } from './api/messages.gen'
import { getChatAppMetaContract } from './api/meta.gen'
import { getChatAppParametersContract } from './api/parameters.gen'
import { getChatWebAppSettingsContract } from './api/site.gen'
import { textToAudioChatContract } from './api/text-to-audio.gen'
export const base = oc.$route({ inputStructure: 'detailed', outputStructure: 'detailed' })

View File

@ -1,34 +0,0 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zGetChatAppFeedbacksData, zGetChatAppFeedbacksResponse, zPostChatMessageFeedbackData, zPostChatMessageFeedbackResponse } from '../zod/feedback.gen'
import { base } from './common.gen'
/**
* Message Feedback
*
* End-users can provide feedback messages, facilitating application developers to optimize expected outputs.
*/
export const postChatMessageFeedbackContract = base.route({
path: '/messages/{message_id}/feedbacks',
method: 'POST',
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) }))
/**
* Get feedbacks of application
*
* Get application's feedbacks.
*/
export const getChatAppFeedbacksContract = base.route({
path: '/app/feedbacks',
method: 'GET',
operationId: 'getChatAppFeedbacks',
summary: 'Get feedbacks of application',
description: 'Get application\'s feedbacks.',
tags: ['Feedback'],
}).input(zGetChatAppFeedbacksData).output(z.object({ body: zGetChatAppFeedbacksResponse, status: z.literal(200) }))

View File

@ -1,29 +1,6 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { AppFeedbacksResponse, MessageFeedbackRequest } from './schemas.gen'
export type PostChatMessageFeedbackData = {
body: MessageFeedbackRequest
path: {
/**
* Message ID for which feedback is being provided.
*/
message_id: string
}
query?: never
url: '/messages/{message_id}/feedbacks'
}
export type PostChatMessageFeedbackResponses = {
/**
* Operation successful.
*/
200: {
result?: string
}
}
export type PostChatMessageFeedbackResponse = PostChatMessageFeedbackResponses[keyof PostChatMessageFeedbackResponses]
import type { AppFeedbacksResponse } from '../models.gen'
export type GetChatAppFeedbacksData = {
body?: never

View File

@ -1,6 +1,6 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { AnnotationItem, AnnotationListResponse, CreateAnnotationRequest, InitialAnnotationReplySettingsRequest, InitialAnnotationReplySettingsResponse as InitialAnnotationReplySettingsResponse2, InitialAnnotationReplySettingsStatusResponse, UpdateAnnotationRequest } from './schemas.gen'
import type { AnnotationItem, AnnotationListResponse, CreateAnnotationRequest, InitialAnnotationReplySettingsRequest, InitialAnnotationReplySettingsResponse as InitialAnnotationReplySettingsResponse2, InitialAnnotationReplySettingsStatusResponse, UpdateAnnotationRequest } from '../models.gen'
export type GetAnnotationListData = {
body?: never

View File

@ -1,6 +1,6 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { AudioToTextRequest, AudioToTextResponse as AudioToTextResponse2, TextToAudioFormRequest } from './schemas.gen'
import type { AudioToTextRequest, AudioToTextResponse as AudioToTextResponse2 } from '../models.gen'
export type AudioToTextData = {
body: AudioToTextRequest
@ -17,19 +17,3 @@ export type AudioToTextResponses = {
}
export type AudioToTextResponse = AudioToTextResponses[keyof AudioToTextResponses]
export type TextToAudioChatData = {
body: TextToAudioFormRequest
path?: never
query?: never
url: '/text-to-audio'
}
export type TextToAudioChatResponses = {
/**
* The generated audio file.
*/
200: Blob | File
}
export type TextToAudioChatResponse = TextToAudioChatResponses[keyof TextToAudioChatResponses]

View File

@ -1,6 +1,6 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { ChatCompletionResponse, ChatRequest, ErrorResponse, SuggestedQuestionsResponse } from './schemas.gen'
import type { ChatCompletionResponse, ChatRequest, ErrorResponse } from '../models.gen'
export type SendChatMessageData = {
/**
@ -73,29 +73,3 @@ export type StopChatMessageGenerationResponses = {
}
export type StopChatMessageGenerationResponse = StopChatMessageGenerationResponses[keyof StopChatMessageGenerationResponses]
export type GetSuggestedQuestionsData = {
body?: never
path: {
/**
* Message ID.
*/
message_id: string
}
query: {
/**
* 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.
*/
user: string
}
url: '/messages/{message_id}/suggested'
}
export type GetSuggestedQuestionsResponses = {
/**
* Successfully retrieved suggested questions.
*/
200: SuggestedQuestionsResponse
}
export type GetSuggestedQuestionsResponse = GetSuggestedQuestionsResponses[keyof GetSuggestedQuestionsResponses]

View File

@ -1,39 +1,6 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { ConversationHistoryResponse, ConversationListItem, ConversationRenameRequest, ConversationsListResponse, ConversationVariablesResponse, ErrorResponse } from './schemas.gen'
export type GetConversationHistoryData = {
body?: never
path?: never
query: {
/**
* Conversation ID.
*/
conversation_id: string
/**
* 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.
*/
user: string
/**
* 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.
*/
first_id?: string
/**
* How many chat history messages to return in one request, default is 20.
*/
limit?: number
}
url: '/messages'
}
export type GetConversationHistoryResponses = {
/**
* Successfully retrieved conversation history.
*/
200: ConversationHistoryResponse
}
export type GetConversationHistoryResponse = GetConversationHistoryResponses[keyof GetConversationHistoryResponses]
import type { ConversationListItem, ConversationRenameRequest, ConversationsListResponse, ConversationVariablesResponse, ErrorResponse } from '../models.gen'
export type GetConversationsListData = {
body?: never

View File

@ -1,6 +1,6 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { ErrorResponse, FileUploadResponse } from './schemas.gen'
import type { ErrorResponse, FileUploadResponse } from '../models.gen'
export type UploadChatFileData = {
/**

View File

@ -0,0 +1,19 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { AppInfoResponse } from '../models.gen'
export type GetChatAppInfoData = {
body?: never
path?: never
query?: never
url: '/info'
}
export type GetChatAppInfoResponses = {
/**
* Basic information of the application.
*/
200: AppInfoResponse
}
export type GetChatAppInfoResponse = GetChatAppInfoResponses[keyof GetChatAppInfoResponses]

View File

@ -0,0 +1,85 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { ConversationHistoryResponse, MessageFeedbackRequest, SuggestedQuestionsResponse } from '../models.gen'
export type PostChatMessageFeedbackData = {
body: MessageFeedbackRequest
path: {
/**
* Message ID for which feedback is being provided.
*/
message_id: string
}
query?: never
url: '/messages/{message_id}/feedbacks'
}
export type PostChatMessageFeedbackResponses = {
/**
* Operation successful.
*/
200: {
result?: string
}
}
export type PostChatMessageFeedbackResponse = PostChatMessageFeedbackResponses[keyof PostChatMessageFeedbackResponses]
export type GetSuggestedQuestionsData = {
body?: never
path: {
/**
* Message ID.
*/
message_id: string
}
query: {
/**
* 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.
*/
user: string
}
url: '/messages/{message_id}/suggested'
}
export type GetSuggestedQuestionsResponses = {
/**
* Successfully retrieved suggested questions.
*/
200: SuggestedQuestionsResponse
}
export type GetSuggestedQuestionsResponse = GetSuggestedQuestionsResponses[keyof GetSuggestedQuestionsResponses]
export type GetConversationHistoryData = {
body?: never
path?: never
query: {
/**
* Conversation ID.
*/
conversation_id: string
/**
* 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.
*/
user: string
/**
* 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.
*/
first_id?: string
/**
* How many chat history messages to return in one request, default is 20.
*/
limit?: number
}
url: '/messages'
}
export type GetConversationHistoryResponses = {
/**
* Successfully retrieved conversation history.
*/
200: ConversationHistoryResponse
}
export type GetConversationHistoryResponse = GetConversationHistoryResponses[keyof GetConversationHistoryResponses]

View File

@ -0,0 +1,19 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { AppMetaResponse } from '../models.gen'
export type GetChatAppMetaData = {
body?: never
path?: never
query?: never
url: '/meta'
}
export type GetChatAppMetaResponses = {
/**
* Successfully retrieved application meta information.
*/
200: AppMetaResponse
}
export type GetChatAppMetaResponse = GetChatAppMetaResponses[keyof GetChatAppMetaResponses]

View File

@ -0,0 +1,24 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { ChatAppParametersResponse } from '../models.gen'
export type GetChatAppParametersData = {
body?: never
path?: never
query: {
/**
* User identifier, defined by the developer's rules, must be unique within the application.
*/
user: string
}
url: '/parameters'
}
export type GetChatAppParametersResponses = {
/**
* Application parameters information.
*/
200: ChatAppParametersResponse
}
export type GetChatAppParametersResponse = GetChatAppParametersResponses[keyof GetChatAppParametersResponses]

View File

@ -0,0 +1,19 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { WebAppSettingsResponse } from '../models.gen'
export type GetChatWebAppSettingsData = {
body?: never
path?: never
query?: never
url: '/site'
}
export type GetChatWebAppSettingsResponses = {
/**
* WebApp settings of the application.
*/
200: WebAppSettingsResponse
}
export type GetChatWebAppSettingsResponse = GetChatWebAppSettingsResponses[keyof GetChatWebAppSettingsResponses]

View File

@ -0,0 +1,19 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { TextToAudioFormRequest } from '../models.gen'
export type TextToAudioChatData = {
body: TextToAudioFormRequest
path?: never
query?: never
url: '/text-to-audio'
}
export type TextToAudioChatResponses = {
/**
* The generated audio file.
*/
200: Blob | File
}
export type TextToAudioChatResponse = TextToAudioChatResponses[keyof TextToAudioChatResponses]

View File

@ -1,72 +0,0 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { AppInfoResponse, AppMetaResponse, ChatAppParametersResponse, WebAppSettingsResponse } from './schemas.gen'
export type GetChatAppInfoData = {
body?: never
path?: never
query?: never
url: '/info'
}
export type GetChatAppInfoResponses = {
/**
* Basic information of the application.
*/
200: AppInfoResponse
}
export type GetChatAppInfoResponse = GetChatAppInfoResponses[keyof GetChatAppInfoResponses]
export type GetChatAppParametersData = {
body?: never
path?: never
query: {
/**
* User identifier, defined by the developer's rules, must be unique within the application.
*/
user: string
}
url: '/parameters'
}
export type GetChatAppParametersResponses = {
/**
* Application parameters information.
*/
200: ChatAppParametersResponse
}
export type GetChatAppParametersResponse = GetChatAppParametersResponses[keyof GetChatAppParametersResponses]
export type GetChatAppMetaData = {
body?: never
path?: never
query?: never
url: '/meta'
}
export type GetChatAppMetaResponses = {
/**
* Successfully retrieved application meta information.
*/
200: AppMetaResponse
}
export type GetChatAppMetaResponse = GetChatAppMetaResponses[keyof GetChatAppMetaResponses]
export type GetChatWebAppSettingsData = {
body?: never
path?: never
query?: never
url: '/site'
}
export type GetChatWebAppSettingsResponses = {
/**
* WebApp settings of the application.
*/
200: WebAppSettingsResponse
}
export type GetChatWebAppSettingsResponse = GetChatWebAppSettingsResponses[keyof GetChatWebAppSettingsResponses]

View File

@ -0,0 +1,5 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://{api_base_url}` | (string & {})
}

View File

@ -1,9 +1,5 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://{api_base_url}` | (string & {})
}
export type ChatRequest = {
/**
* User Input/Question content.

View File

@ -2,26 +2,7 @@
import { z } from 'zod'
import { zAppFeedbacksResponse, zMessageFeedbackRequest } from './schemas.gen'
export const zPostChatMessageFeedbackData = z.object({
body: zMessageFeedbackRequest,
path: z.object({
message_id: z.string().describe('Message ID for which feedback is being provided.'),
}),
query: z.never().optional(),
})
export type PostChatMessageFeedbackDataZodType = z.infer<typeof zPostChatMessageFeedbackData>
/**
* Operation successful.
*/
export const zPostChatMessageFeedbackResponse = z.object({
result: z.string().optional(),
}).describe('Operation successful.')
export type PostChatMessageFeedbackResponseZodType = z.infer<typeof zPostChatMessageFeedbackResponse>
import { zAppFeedbacksResponse } from '../models.gen'
export const zGetChatAppFeedbacksData = z.object({
body: z.never().optional(),

View File

@ -2,7 +2,7 @@
import { z } from 'zod'
import { zAnnotationItem, zAnnotationListResponse, zCreateAnnotationRequest, zInitialAnnotationReplySettingsRequest, zInitialAnnotationReplySettingsResponse as zInitialAnnotationReplySettingsResponse2, zInitialAnnotationReplySettingsStatusResponse, zUpdateAnnotationRequest } from './schemas.gen'
import { zAnnotationItem, zAnnotationListResponse, zCreateAnnotationRequest, zInitialAnnotationReplySettingsRequest, zInitialAnnotationReplySettingsResponse as zInitialAnnotationReplySettingsResponse2, zInitialAnnotationReplySettingsStatusResponse, zUpdateAnnotationRequest } from '../models.gen'
export const zGetAnnotationListData = z.object({
body: z.never().optional(),

View File

@ -2,7 +2,7 @@
import { z } from 'zod'
import { zAudioToTextRequest, zAudioToTextResponse as zAudioToTextResponse2, zTextToAudioFormRequest } from './schemas.gen'
import { zAudioToTextRequest, zAudioToTextResponse as zAudioToTextResponse2 } from '../models.gen'
export const zAudioToTextData = z.object({
body: zAudioToTextRequest,
@ -18,18 +18,3 @@ export type AudioToTextDataZodType = z.infer<typeof zAudioToTextData>
export const zAudioToTextResponse = zAudioToTextResponse2
export type AudioToTextResponseZodType = z.infer<typeof zAudioToTextResponse>
export const zTextToAudioChatData = z.object({
body: zTextToAudioFormRequest,
path: z.never().optional(),
query: z.never().optional(),
})
export type TextToAudioChatDataZodType = z.infer<typeof zTextToAudioChatData>
/**
* The generated audio file.
*/
export const zTextToAudioChatResponse = z.string().describe('The generated audio file.')
export type TextToAudioChatResponseZodType = z.infer<typeof zTextToAudioChatResponse>

View File

@ -2,7 +2,7 @@
import { z } from 'zod'
import { zChatCompletionResponse, zChatRequest, zSuggestedQuestionsResponse } from './schemas.gen'
import { zChatCompletionResponse, zChatRequest } from '../models.gen'
export const zSendChatMessageData = z.object({
body: zChatRequest,
@ -41,22 +41,3 @@ export const zStopChatMessageGenerationResponse = z.object({
}).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>

View File

@ -2,27 +2,7 @@
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>
import { zConversationListItem, zConversationRenameRequest, zConversationsListResponse, zConversationVariablesResponse } from '../models.gen'
export const zGetConversationsListData = z.object({
body: z.never().optional(),

View File

@ -2,7 +2,7 @@
import { z } from 'zod'
import { zFileUploadResponse } from './schemas.gen'
import { zFileUploadResponse } from '../models.gen'
export const zUploadChatFileData = z.object({
body: z.object({

View File

@ -0,0 +1,20 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zAppInfoResponse } from '../models.gen'
export const zGetChatAppInfoData = z.object({
body: z.never().optional(),
path: z.never().optional(),
query: z.never().optional(),
})
export type GetChatAppInfoDataZodType = z.infer<typeof zGetChatAppInfoData>
/**
* Basic information of the application.
*/
export const zGetChatAppInfoResponse = zAppInfoResponse
export type GetChatAppInfoResponseZodType = z.infer<typeof zGetChatAppInfoResponse>

View File

@ -0,0 +1,63 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zConversationHistoryResponse, zMessageFeedbackRequest, zSuggestedQuestionsResponse } from '../models.gen'
export const zPostChatMessageFeedbackData = z.object({
body: zMessageFeedbackRequest,
path: z.object({
message_id: z.string().describe('Message ID for which feedback is being provided.'),
}),
query: z.never().optional(),
})
export type PostChatMessageFeedbackDataZodType = z.infer<typeof zPostChatMessageFeedbackData>
/**
* Operation successful.
*/
export const zPostChatMessageFeedbackResponse = z.object({
result: z.string().optional(),
}).describe('Operation successful.')
export type PostChatMessageFeedbackResponseZodType = z.infer<typeof zPostChatMessageFeedbackResponse>
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>
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>

View File

@ -0,0 +1,20 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zAppMetaResponse } from '../models.gen'
export const zGetChatAppMetaData = z.object({
body: z.never().optional(),
path: z.never().optional(),
query: z.never().optional(),
})
export type GetChatAppMetaDataZodType = z.infer<typeof zGetChatAppMetaData>
/**
* Successfully retrieved application meta information.
*/
export const zGetChatAppMetaResponse = zAppMetaResponse
export type GetChatAppMetaResponseZodType = z.infer<typeof zGetChatAppMetaResponse>

View File

@ -0,0 +1,22 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zChatAppParametersResponse } from '../models.gen'
export const zGetChatAppParametersData = z.object({
body: z.never().optional(),
path: z.never().optional(),
query: z.object({
user: z.string().describe('User identifier, defined by the developer\'s rules, must be unique within the application.'),
}),
})
export type GetChatAppParametersDataZodType = z.infer<typeof zGetChatAppParametersData>
/**
* Application parameters information.
*/
export const zGetChatAppParametersResponse = zChatAppParametersResponse
export type GetChatAppParametersResponseZodType = z.infer<typeof zGetChatAppParametersResponse>

View File

@ -0,0 +1,20 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zWebAppSettingsResponse } from '../models.gen'
export const zGetChatWebAppSettingsData = z.object({
body: z.never().optional(),
path: z.never().optional(),
query: z.never().optional(),
})
export type GetChatWebAppSettingsDataZodType = z.infer<typeof zGetChatWebAppSettingsData>
/**
* WebApp settings of the application.
*/
export const zGetChatWebAppSettingsResponse = zWebAppSettingsResponse
export type GetChatWebAppSettingsResponseZodType = z.infer<typeof zGetChatWebAppSettingsResponse>

View File

@ -0,0 +1,20 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zTextToAudioFormRequest } from '../models.gen'
export const zTextToAudioChatData = z.object({
body: zTextToAudioFormRequest,
path: z.never().optional(),
query: z.never().optional(),
})
export type TextToAudioChatDataZodType = z.infer<typeof zTextToAudioChatData>
/**
* The generated audio file.
*/
export const zTextToAudioChatResponse = z.string().describe('The generated audio file.')
export type TextToAudioChatResponseZodType = z.infer<typeof zTextToAudioChatResponse>

View File

@ -1,67 +0,0 @@
// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zAppInfoResponse, zAppMetaResponse, zChatAppParametersResponse, zWebAppSettingsResponse } from './schemas.gen'
export const zGetChatAppInfoData = z.object({
body: z.never().optional(),
path: z.never().optional(),
query: z.never().optional(),
})
export type GetChatAppInfoDataZodType = z.infer<typeof zGetChatAppInfoData>
/**
* Basic information of the application.
*/
export const zGetChatAppInfoResponse = zAppInfoResponse
export type GetChatAppInfoResponseZodType = z.infer<typeof zGetChatAppInfoResponse>
export const zGetChatAppParametersData = z.object({
body: z.never().optional(),
path: z.never().optional(),
query: z.object({
user: z.string().describe('User identifier, defined by the developer\'s rules, must be unique within the application.'),
}),
})
export type GetChatAppParametersDataZodType = z.infer<typeof zGetChatAppParametersData>
/**
* Application parameters information.
*/
export const zGetChatAppParametersResponse = zChatAppParametersResponse
export type GetChatAppParametersResponseZodType = z.infer<typeof zGetChatAppParametersResponse>
export const zGetChatAppMetaData = z.object({
body: z.never().optional(),
path: z.never().optional(),
query: z.never().optional(),
})
export type GetChatAppMetaDataZodType = z.infer<typeof zGetChatAppMetaData>
/**
* Successfully retrieved application meta information.
*/
export const zGetChatAppMetaResponse = zAppMetaResponse
export type GetChatAppMetaResponseZodType = z.infer<typeof zGetChatAppMetaResponse>
export const zGetChatWebAppSettingsData = z.object({
body: z.never().optional(),
path: z.never().optional(),
query: z.never().optional(),
})
export type GetChatWebAppSettingsDataZodType = z.infer<typeof zGetChatWebAppSettingsData>
/**
* WebApp settings of the application.
*/
export const zGetChatWebAppSettingsResponse = zWebAppSettingsResponse
export type GetChatWebAppSettingsResponseZodType = z.infer<typeof zGetChatWebAppSettingsResponse>

View File

@ -2,39 +2,65 @@ import { defineConfig } from '@hey-api/openapi-ts'
import { defineConfig as defineOrpcConfig } from './plugins/hey-api-orpc/config'
// Whether to split generated files by tag
const splitByTags = true
// Symbol type for the getFilePath hook (not publicly exported by hey-api)
type SymbolMeta = {
type SymbolMeta = Record<string, unknown> & {
tags?: readonly string[]
tool?: string
resource?: string
pluginName?: string
path?: readonly (string | number)[]
}
// Get file path based on symbol metadata
function getFilePathByTag(symbol: { meta?: SymbolMeta }): string | undefined {
// Extract API path segment from OpenAPI path array
// e.g., ["paths", "/chat-messages", "post"] → "chat-messages"
// e.g., ["paths", "/files/upload", "post"] → "files"
function getApiSegment(path: readonly (string | number)[] | undefined): string | undefined {
if (!path || path[0] !== 'paths')
return undefined
const apiPath = path[1] // e.g., "/chat-messages" or "/files/upload"
if (typeof apiPath !== 'string')
return undefined
// Get first segment after leading slash
return apiPath.split('/').filter(Boolean)[0]
}
// Get file path based on symbol metadata (mixed strategy)
function getFilePath(symbol: { meta?: SymbolMeta }): string | undefined {
const meta = symbol.meta
if (!meta)
return undefined
// Get the first tag from symbol metadata, fallback to 'schemas' for definitions
const tag = meta.tags?.[0]?.toLowerCase()
// Handle typescript plugin symbols
if (meta.tool === 'typescript') {
return `types/${tag ?? 'schemas'}`
if (meta.resource === 'definition') {
return 'types/models'
}
if (meta.resource === 'operation') {
const segment = getApiSegment(meta.path)
return `types/api/${segment ?? 'common'}`
}
return 'types/common'
}
// Handle zod plugin symbols
if (meta.tool === 'zod') {
return `zod/${tag ?? 'schemas'}`
if (meta.resource === 'definition') {
return 'zod/models'
}
if (meta.resource === 'operation') {
const segment = getApiSegment(meta.path)
return `zod/api/${segment ?? 'common'}`
}
return 'zod/common'
}
// Handle orpc plugin symbols
if (meta.pluginName === 'orpc') {
return `orpc/${tag ?? 'common'}`
if (meta.resource === 'operation') {
const segment = getApiSegment(meta.path)
return `orpc/api/${segment ?? 'common'}`
}
return 'orpc/common'
}
return undefined
@ -62,13 +88,11 @@ export default defineConfig({
output: 'orpc',
}),
],
parser: splitByTags
? {
hooks: {
symbols: {
getFilePath: getFilePathByTag,
},
},
}
: undefined,
parser: {
hooks: {
symbols: {
getFilePath,
},
},
},
})

View File

@ -121,6 +121,7 @@ export const handler: OrpcPlugin['Handler'] = ({ plugin }) => {
const contractSymbol = plugin.symbol(contractName, {
exported: true,
meta: {
path: ['paths', op.path, op.method.toLowerCase()],
pluginName: 'orpc',
resource: 'operation',
resourceId: op.id,