mirror of
https://github.com/langgenius/dify.git
synced 2026-01-25 16:54:18 +00:00
Compare commits
36 Commits
deploy/age
...
1-24-kubb-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21a1e4ba82 | ||
|
|
3f7d76d4e2 | ||
|
|
b41aee2278 | ||
|
|
9a02cbe0d3 | ||
|
|
9b05116289 | ||
|
|
892cfbafde | ||
|
|
a6286dbffd | ||
|
|
e3a355aaad | ||
|
|
50c134a4bc | ||
|
|
4061c83b26 | ||
|
|
bd14023af3 | ||
|
|
55f80c568b | ||
|
|
bc451416d1 | ||
|
|
ef31649ce3 | ||
|
|
044e35fde4 | ||
|
|
bdd183811e | ||
|
|
f844e2d0f5 | ||
|
|
55c6511875 | ||
|
|
7cf81aa8d3 | ||
|
|
bddb6296a0 | ||
|
|
54e7386e29 | ||
|
|
299f8b10c2 | ||
|
|
47fde14cf3 | ||
|
|
b61061b831 | ||
|
|
7fe1457f7c | ||
|
|
62ac2dd811 | ||
|
|
393c530647 | ||
|
|
a8693dd2d9 | ||
|
|
76cf17c729 | ||
|
|
f5fdb6899a | ||
|
|
1d928ab340 | ||
|
|
6a0c439667 | ||
|
|
f3eaf5a13d | ||
|
|
1b8685d9a5 | ||
|
|
a55469a9cb | ||
|
|
e780345ef3 |
3
open-api/console-api.json
Normal file
3
open-api/console-api.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"error": "Unable to render schema"
|
||||
}
|
||||
1
open-api/fastopenapi.json
Normal file
1
open-api/fastopenapi.json
Normal file
@@ -0,0 +1 @@
|
||||
{"openapi":"3.0.0","info":{"title":"Dify API (FastOpenAPI PoC)","version":"1.0","description":"FastOpenAPI proof of concept for Dify API"},"paths":{"/console/api/ping":{"get":{"summary":"Health check endpoint for connection testing.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PingResponse"}}}}},"tags":["console"]}}},"components":{"schemas":{"ErrorSchema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"},"details":{"type":"string"}},"required":["type","message","status"]}},"required":["error"]},"PingResponse":{"properties":{"result":{"description":"Health check result","examples":["pong"],"title":"Result","type":"string"}},"required":["result"],"title":"PingResponse","type":"object"}}}}
|
||||
4576
open-api/service-api.json
Normal file
4576
open-api/service-api.json
Normal file
File diff suppressed because it is too large
Load Diff
2230
open-api/web-api.json
Normal file
2230
open-api/web-api.json
Normal file
File diff suppressed because it is too large
Load Diff
377
web/gen/orpc.ts
Normal file
377
web/gen/orpc.ts
Normal file
@@ -0,0 +1,377 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zAudioToTextData, zAudioToTextResponse2, zCreateAnnotationData, zCreateAnnotationResponse, zDeleteAnnotationData, zDeleteConversationData, zGetAnnotationListData, zGetAnnotationListResponse, zGetChatAppFeedbacksData, zGetChatAppFeedbacksResponse, zGetChatAppInfoResponse, zGetChatAppMetaResponse, zGetChatAppParametersData, zGetChatAppParametersResponse, zGetChatWebAppSettingsResponse, zGetConversationHistoryData, zGetConversationHistoryResponse, zGetConversationsListData, zGetConversationsListResponse, zGetConversationVariablesData, zGetConversationVariablesResponse, zGetInitialAnnotationReplySettingsStatusData, zGetInitialAnnotationReplySettingsStatusResponse, zGetSuggestedQuestionsData, zGetSuggestedQuestionsResponse, zInitialAnnotationReplySettingsData, zInitialAnnotationReplySettingsResponse2, zPostChatMessageFeedbackData, zPostChatMessageFeedbackResponse, zPreviewChatFileData, zPreviewChatFileResponse, zRenameConversationData, zRenameConversationResponse, zSendChatMessageData, zSendChatMessageResponse, zStopChatMessageGenerationData, zStopChatMessageGenerationResponse, zTextToAudioChatData, zTextToAudioChatResponse, zUpdateAnnotationData, zUpdateAnnotationResponse, zUploadChatFileData, zUploadChatFileResponse } from './zod'
|
||||
|
||||
export const base = oc.$route({ inputStructure: 'detailed', outputStructure: 'detailed' })
|
||||
|
||||
/**
|
||||
* Send Chat Message
|
||||
*
|
||||
* Send a request to the chat application.
|
||||
*/
|
||||
export const sendChatMessageContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/chat-messages',
|
||||
operationId: 'sendChatMessage',
|
||||
summary: 'Send Chat Message',
|
||||
description: 'Send a request to the chat application.',
|
||||
tags: ['Chat'],
|
||||
}).input(zSendChatMessageData).output(z.object({ body: zSendChatMessageResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* File Upload
|
||||
*
|
||||
* Upload a file (currently only images are supported) for use when sending messages, enabling multimodal understanding of images and text. Supports png, jpg, jpeg, webp, gif formats. Uploaded files are for use by the current end-user only.
|
||||
*/
|
||||
export const uploadChatFileContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/files/upload',
|
||||
operationId: 'uploadChatFile',
|
||||
summary: 'File Upload',
|
||||
description: 'Upload a file (currently only images are supported) for use when sending messages, enabling multimodal understanding of images and text. Supports png, jpg, jpeg, webp, gif formats. Uploaded files are for use by the current end-user only.',
|
||||
tags: ['Files'],
|
||||
}).input(zUploadChatFileData).output(z.object({ body: zUploadChatFileResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* File Preview
|
||||
*
|
||||
* Preview or download uploaded files. This endpoint allows you to access files that have been previously uploaded via the File Upload API. Files can only be accessed if they belong to messages within the requesting application.
|
||||
*/
|
||||
export const previewChatFileContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/files/{file_id}/preview',
|
||||
operationId: 'previewChatFile',
|
||||
summary: 'File Preview',
|
||||
description: 'Preview or download uploaded files. This endpoint allows you to access files that have been previously uploaded via the File Upload API. Files can only be accessed if they belong to messages within the requesting application.',
|
||||
tags: ['Files'],
|
||||
}).input(zPreviewChatFileData).output(z.object({ body: zPreviewChatFileResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Stop Chat Message Generation
|
||||
*
|
||||
* Stops a chat message generation task. Only supported in streaming mode.
|
||||
*/
|
||||
export const stopChatMessageGenerationContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/chat-messages/{task_id}/stop',
|
||||
operationId: 'stopChatMessageGeneration',
|
||||
summary: 'Stop Chat Message Generation',
|
||||
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) }))
|
||||
|
||||
/**
|
||||
* 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) }))
|
||||
|
||||
/**
|
||||
* Get feedbacks of application
|
||||
*
|
||||
* Get application's feedbacks.
|
||||
*/
|
||||
export const getChatAppFeedbacksContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/app/feedbacks',
|
||||
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) }))
|
||||
|
||||
/**
|
||||
* 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) }))
|
||||
|
||||
/**
|
||||
* Get Conversations
|
||||
*
|
||||
* Retrieve the conversation list for the current user, defaulting to the most recent 20 entries.
|
||||
*/
|
||||
export const getConversationsListContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/conversations',
|
||||
operationId: 'getConversationsList',
|
||||
summary: 'Get Conversations',
|
||||
description: 'Retrieve the conversation list for the current user, defaulting to the most recent 20 entries.',
|
||||
tags: ['Conversations'],
|
||||
}).input(zGetConversationsListData).output(z.object({ body: zGetConversationsListResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Delete Conversation
|
||||
*
|
||||
* Delete a conversation.
|
||||
*/
|
||||
export const deleteConversationContract = base.route({
|
||||
method: 'DELETE',
|
||||
path: '/conversations/{conversation_id}',
|
||||
operationId: 'deleteConversation',
|
||||
summary: 'Delete Conversation',
|
||||
description: 'Delete a conversation.',
|
||||
tags: ['Conversations'],
|
||||
}).input(zDeleteConversationData)
|
||||
|
||||
/**
|
||||
* Conversation Rename
|
||||
*
|
||||
* Rename the session. The session name is used for display on clients that support multiple sessions.
|
||||
*/
|
||||
export const renameConversationContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/conversations/{conversation_id}/name',
|
||||
operationId: 'renameConversation',
|
||||
summary: 'Conversation Rename',
|
||||
description: 'Rename the session. The session name is used for display on clients that support multiple sessions.',
|
||||
tags: ['Conversations'],
|
||||
}).input(zRenameConversationData).output(z.object({ body: zRenameConversationResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Get Conversation Variables
|
||||
*
|
||||
* Retrieve variables from a specific conversation.
|
||||
*/
|
||||
export const getConversationVariablesContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/conversations/{conversation_id}/variables',
|
||||
operationId: 'getConversationVariables',
|
||||
summary: 'Get Conversation Variables',
|
||||
description: 'Retrieve variables from a specific conversation.',
|
||||
tags: ['Conversations'],
|
||||
}).input(zGetConversationVariablesData).output(z.object({ body: zGetConversationVariablesResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Speech to Text
|
||||
*
|
||||
* Convert audio file to text. Supported formats: mp3, mp4, mpeg, mpga, m4a, wav, webm. File size limit: 15MB.
|
||||
*/
|
||||
export const audioToTextContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/audio-to-text',
|
||||
operationId: 'audioToText',
|
||||
summary: 'Speech to Text',
|
||||
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: zAudioToTextResponse2, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Text to Audio
|
||||
*
|
||||
* Convert text to speech.
|
||||
*/
|
||||
export const textToAudioChatContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/text-to-audio',
|
||||
operationId: 'textToAudioChat',
|
||||
summary: 'Text to Audio',
|
||||
description: 'Convert text to speech.',
|
||||
tags: ['TTS'],
|
||||
}).input(zTextToAudioChatData).output(z.object({ body: zTextToAudioChatResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Get Application Basic Information
|
||||
*
|
||||
* Used to get basic information about this application.
|
||||
*/
|
||||
export const getChatAppInfoContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/info',
|
||||
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({
|
||||
method: 'GET',
|
||||
path: '/parameters',
|
||||
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({
|
||||
method: 'GET',
|
||||
path: '/meta',
|
||||
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({
|
||||
method: 'GET',
|
||||
path: '/site',
|
||||
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) }))
|
||||
|
||||
/**
|
||||
* Get Annotation List
|
||||
*
|
||||
* Retrieves a list of annotations for the application.
|
||||
*/
|
||||
export const getAnnotationListContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/apps/annotations',
|
||||
operationId: 'getAnnotationList',
|
||||
summary: 'Get Annotation List',
|
||||
description: 'Retrieves a list of annotations for the application.',
|
||||
tags: ['Annotations'],
|
||||
}).input(zGetAnnotationListData).output(z.object({ body: zGetAnnotationListResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Create Annotation
|
||||
*
|
||||
* Creates a new annotation.
|
||||
*/
|
||||
export const createAnnotationContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/apps/annotations',
|
||||
operationId: 'createAnnotation',
|
||||
summary: 'Create Annotation',
|
||||
description: 'Creates a new annotation.',
|
||||
tags: ['Annotations'],
|
||||
}).input(zCreateAnnotationData).output(z.object({ body: zCreateAnnotationResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Delete Annotation
|
||||
*
|
||||
* Deletes an annotation.
|
||||
*/
|
||||
export const deleteAnnotationContract = base.route({
|
||||
method: 'DELETE',
|
||||
path: '/apps/annotations/{annotation_id}',
|
||||
operationId: 'deleteAnnotation',
|
||||
summary: 'Delete Annotation',
|
||||
description: 'Deletes an annotation.',
|
||||
tags: ['Annotations'],
|
||||
}).input(zDeleteAnnotationData)
|
||||
|
||||
/**
|
||||
* Update Annotation
|
||||
*
|
||||
* Updates an existing annotation.
|
||||
*/
|
||||
export const updateAnnotationContract = base.route({
|
||||
method: 'PUT',
|
||||
path: '/apps/annotations/{annotation_id}',
|
||||
operationId: 'updateAnnotation',
|
||||
summary: 'Update Annotation',
|
||||
description: 'Updates an existing annotation.',
|
||||
tags: ['Annotations'],
|
||||
}).input(zUpdateAnnotationData).output(z.object({ body: zUpdateAnnotationResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Initial Annotation Reply Settings
|
||||
*
|
||||
* Enable or disable annotation reply settings and configure embedding models. This interface is executed asynchronously.
|
||||
*/
|
||||
export const initialAnnotationReplySettingsContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/apps/annotation-reply/{action}',
|
||||
operationId: 'initialAnnotationReplySettings',
|
||||
summary: 'Initial Annotation Reply Settings',
|
||||
description: 'Enable or disable annotation reply settings and configure embedding models. This interface is executed asynchronously.',
|
||||
tags: ['Annotations'],
|
||||
}).input(zInitialAnnotationReplySettingsData).output(z.object({ body: zInitialAnnotationReplySettingsResponse2, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Query Initial Annotation Reply Settings Task Status
|
||||
*
|
||||
* Queries the status of an asynchronously executed annotation reply settings task.
|
||||
*/
|
||||
export const getInitialAnnotationReplySettingsStatusContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/apps/annotation-reply/{action}/status/{job_id}',
|
||||
operationId: 'getInitialAnnotationReplySettingsStatus',
|
||||
summary: 'Query Initial Annotation Reply Settings Task Status',
|
||||
description: 'Queries the status of an asynchronously executed annotation reply settings task.',
|
||||
tags: ['Annotations'],
|
||||
}).input(zGetInitialAnnotationReplySettingsStatusData).output(z.object({ body: zGetInitialAnnotationReplySettingsStatusResponse, status: z.literal(200) }))
|
||||
|
||||
export const router = {
|
||||
chatMessages: { send: sendChatMessageContract, stopGeneration: stopChatMessageGenerationContract },
|
||||
files: { uploadChat: uploadChatFileContract, previewChat: previewChatFileContract },
|
||||
messages: {
|
||||
postChatFeedback: postChatMessageFeedbackContract,
|
||||
getSuggestedQuestions: getSuggestedQuestionsContract,
|
||||
getConversationHistory: getConversationHistoryContract,
|
||||
},
|
||||
app: { getChatFeedbacks: getChatAppFeedbacksContract },
|
||||
conversations: {
|
||||
getList: getConversationsListContract,
|
||||
delete: deleteConversationContract,
|
||||
rename: renameConversationContract,
|
||||
getVariables: getConversationVariablesContract,
|
||||
},
|
||||
audioToText: { audioToText: audioToTextContract },
|
||||
textToAudio: { textToAudioChat: textToAudioChatContract },
|
||||
info: { getChatApp: getChatAppInfoContract },
|
||||
parameters: { getChatApp: getChatAppParametersContract },
|
||||
meta: { getChatApp: getChatAppMetaContract },
|
||||
site: { getChatWebAppSettings: getChatWebAppSettingsContract },
|
||||
apps: {
|
||||
getAnnotationList: getAnnotationListContract,
|
||||
createAnnotation: createAnnotationContract,
|
||||
deleteAnnotation: deleteAnnotationContract,
|
||||
updateAnnotation: updateAnnotationContract,
|
||||
initialAnnotationReplySettings: initialAnnotationReplySettingsContract,
|
||||
getInitialAnnotationReplySettingsStatus: getInitialAnnotationReplySettingsStatusContract,
|
||||
},
|
||||
}
|
||||
|
||||
export type Router = typeof router
|
||||
20
web/gen/orpc/api/app.ts
Normal file
20
web/gen/orpc/api/app.ts
Normal 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'
|
||||
import { base } from '../common'
|
||||
|
||||
/**
|
||||
* Get feedbacks of application
|
||||
*
|
||||
* Get application's feedbacks.
|
||||
*/
|
||||
export const getChatAppFeedbacksContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/app/feedbacks',
|
||||
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) }))
|
||||
90
web/gen/orpc/api/apps.ts
Normal file
90
web/gen/orpc/api/apps.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zCreateAnnotationData, zCreateAnnotationResponse, zDeleteAnnotationData, zGetAnnotationListData, zGetAnnotationListResponse, zGetInitialAnnotationReplySettingsStatusData, zGetInitialAnnotationReplySettingsStatusResponse, zInitialAnnotationReplySettingsData, zInitialAnnotationReplySettingsResponse, zUpdateAnnotationData, zUpdateAnnotationResponse } from '../../zod/api/apps'
|
||||
import { base } from '../common'
|
||||
|
||||
/**
|
||||
* Get Annotation List
|
||||
*
|
||||
* Retrieves a list of annotations for the application.
|
||||
*/
|
||||
export const getAnnotationListContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/apps/annotations',
|
||||
operationId: 'getAnnotationList',
|
||||
summary: 'Get Annotation List',
|
||||
description: 'Retrieves a list of annotations for the application.',
|
||||
tags: ['Annotations'],
|
||||
}).input(zGetAnnotationListData).output(z.object({ body: zGetAnnotationListResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Create Annotation
|
||||
*
|
||||
* Creates a new annotation.
|
||||
*/
|
||||
export const createAnnotationContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/apps/annotations',
|
||||
operationId: 'createAnnotation',
|
||||
summary: 'Create Annotation',
|
||||
description: 'Creates a new annotation.',
|
||||
tags: ['Annotations'],
|
||||
}).input(zCreateAnnotationData).output(z.object({ body: zCreateAnnotationResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Delete Annotation
|
||||
*
|
||||
* Deletes an annotation.
|
||||
*/
|
||||
export const deleteAnnotationContract = base.route({
|
||||
method: 'DELETE',
|
||||
path: '/apps/annotations/{annotation_id}',
|
||||
operationId: 'deleteAnnotation',
|
||||
summary: 'Delete Annotation',
|
||||
description: 'Deletes an annotation.',
|
||||
tags: ['Annotations'],
|
||||
}).input(zDeleteAnnotationData)
|
||||
|
||||
/**
|
||||
* Update Annotation
|
||||
*
|
||||
* Updates an existing annotation.
|
||||
*/
|
||||
export const updateAnnotationContract = base.route({
|
||||
method: 'PUT',
|
||||
path: '/apps/annotations/{annotation_id}',
|
||||
operationId: 'updateAnnotation',
|
||||
summary: 'Update Annotation',
|
||||
description: 'Updates an existing annotation.',
|
||||
tags: ['Annotations'],
|
||||
}).input(zUpdateAnnotationData).output(z.object({ body: zUpdateAnnotationResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Initial Annotation Reply Settings
|
||||
*
|
||||
* Enable or disable annotation reply settings and configure embedding models. This interface is executed asynchronously.
|
||||
*/
|
||||
export const initialAnnotationReplySettingsContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/apps/annotation-reply/{action}',
|
||||
operationId: 'initialAnnotationReplySettings',
|
||||
summary: 'Initial Annotation Reply Settings',
|
||||
description: 'Enable or disable annotation reply settings and configure embedding models. This interface is executed asynchronously.',
|
||||
tags: ['Annotations'],
|
||||
}).input(zInitialAnnotationReplySettingsData).output(z.object({ body: zInitialAnnotationReplySettingsResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Query Initial Annotation Reply Settings Task Status
|
||||
*
|
||||
* Queries the status of an asynchronously executed annotation reply settings task.
|
||||
*/
|
||||
export const getInitialAnnotationReplySettingsStatusContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/apps/annotation-reply/{action}/status/{job_id}',
|
||||
operationId: 'getInitialAnnotationReplySettingsStatus',
|
||||
summary: 'Query Initial Annotation Reply Settings Task Status',
|
||||
description: 'Queries the status of an asynchronously executed annotation reply settings task.',
|
||||
tags: ['Annotations'],
|
||||
}).input(zGetInitialAnnotationReplySettingsStatusData).output(z.object({ body: zGetInitialAnnotationReplySettingsStatusResponse, status: z.literal(200) }))
|
||||
20
web/gen/orpc/api/audio-to-text.ts
Normal file
20
web/gen/orpc/api/audio-to-text.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zAudioToTextData, zAudioToTextResponse } from '../../zod/api/audio-to-text'
|
||||
import { base } from '../common'
|
||||
|
||||
/**
|
||||
* Speech to Text
|
||||
*
|
||||
* Convert audio file to text. Supported formats: mp3, mp4, mpeg, mpga, m4a, wav, webm. File size limit: 15MB.
|
||||
*/
|
||||
export const audioToTextContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/audio-to-text',
|
||||
operationId: 'audioToText',
|
||||
summary: 'Speech to Text',
|
||||
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) }))
|
||||
34
web/gen/orpc/api/chat-messages.ts
Normal file
34
web/gen/orpc/api/chat-messages.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zSendChatMessageData, zSendChatMessageResponse, zStopChatMessageGenerationData, zStopChatMessageGenerationResponse } from '../../zod/api/chat-messages'
|
||||
import { base } from '../common'
|
||||
|
||||
/**
|
||||
* Send Chat Message
|
||||
*
|
||||
* Send a request to the chat application.
|
||||
*/
|
||||
export const sendChatMessageContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/chat-messages',
|
||||
operationId: 'sendChatMessage',
|
||||
summary: 'Send Chat Message',
|
||||
description: 'Send a request to the chat application.',
|
||||
tags: ['Chat'],
|
||||
}).input(zSendChatMessageData).output(z.object({ body: zSendChatMessageResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Stop Chat Message Generation
|
||||
*
|
||||
* Stops a chat message generation task. Only supported in streaming mode.
|
||||
*/
|
||||
export const stopChatMessageGenerationContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/chat-messages/{task_id}/stop',
|
||||
operationId: 'stopChatMessageGeneration',
|
||||
summary: 'Stop Chat Message Generation',
|
||||
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) }))
|
||||
62
web/gen/orpc/api/conversations.ts
Normal file
62
web/gen/orpc/api/conversations.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zDeleteConversationData, zGetConversationsListData, zGetConversationsListResponse, zGetConversationVariablesData, zGetConversationVariablesResponse, zRenameConversationData, zRenameConversationResponse } from '../../zod/api/conversations'
|
||||
import { base } from '../common'
|
||||
|
||||
/**
|
||||
* Get Conversations
|
||||
*
|
||||
* Retrieve the conversation list for the current user, defaulting to the most recent 20 entries.
|
||||
*/
|
||||
export const getConversationsListContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/conversations',
|
||||
operationId: 'getConversationsList',
|
||||
summary: 'Get Conversations',
|
||||
description: 'Retrieve the conversation list for the current user, defaulting to the most recent 20 entries.',
|
||||
tags: ['Conversations'],
|
||||
}).input(zGetConversationsListData).output(z.object({ body: zGetConversationsListResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Delete Conversation
|
||||
*
|
||||
* Delete a conversation.
|
||||
*/
|
||||
export const deleteConversationContract = base.route({
|
||||
method: 'DELETE',
|
||||
path: '/conversations/{conversation_id}',
|
||||
operationId: 'deleteConversation',
|
||||
summary: 'Delete Conversation',
|
||||
description: 'Delete a conversation.',
|
||||
tags: ['Conversations'],
|
||||
}).input(zDeleteConversationData)
|
||||
|
||||
/**
|
||||
* Conversation Rename
|
||||
*
|
||||
* Rename the session. The session name is used for display on clients that support multiple sessions.
|
||||
*/
|
||||
export const renameConversationContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/conversations/{conversation_id}/name',
|
||||
operationId: 'renameConversation',
|
||||
summary: 'Conversation Rename',
|
||||
description: 'Rename the session. The session name is used for display on clients that support multiple sessions.',
|
||||
tags: ['Conversations'],
|
||||
}).input(zRenameConversationData).output(z.object({ body: zRenameConversationResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* Get Conversation Variables
|
||||
*
|
||||
* Retrieve variables from a specific conversation.
|
||||
*/
|
||||
export const getConversationVariablesContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/conversations/{conversation_id}/variables',
|
||||
operationId: 'getConversationVariables',
|
||||
summary: 'Get Conversation Variables',
|
||||
description: 'Retrieve variables from a specific conversation.',
|
||||
tags: ['Conversations'],
|
||||
}).input(zGetConversationVariablesData).output(z.object({ body: zGetConversationVariablesResponse, status: z.literal(200) }))
|
||||
34
web/gen/orpc/api/files.ts
Normal file
34
web/gen/orpc/api/files.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zPreviewChatFileData, zPreviewChatFileResponse, zUploadChatFileData, zUploadChatFileResponse } from '../../zod/api/files'
|
||||
import { base } from '../common'
|
||||
|
||||
/**
|
||||
* File Upload
|
||||
*
|
||||
* Upload a file (currently only images are supported) for use when sending messages, enabling multimodal understanding of images and text. Supports png, jpg, jpeg, webp, gif formats. Uploaded files are for use by the current end-user only.
|
||||
*/
|
||||
export const uploadChatFileContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/files/upload',
|
||||
operationId: 'uploadChatFile',
|
||||
summary: 'File Upload',
|
||||
description: 'Upload a file (currently only images are supported) for use when sending messages, enabling multimodal understanding of images and text. Supports png, jpg, jpeg, webp, gif formats. Uploaded files are for use by the current end-user only.',
|
||||
tags: ['Files'],
|
||||
}).input(zUploadChatFileData).output(z.object({ body: zUploadChatFileResponse, status: z.literal(200) }))
|
||||
|
||||
/**
|
||||
* File Preview
|
||||
*
|
||||
* Preview or download uploaded files. This endpoint allows you to access files that have been previously uploaded via the File Upload API. Files can only be accessed if they belong to messages within the requesting application.
|
||||
*/
|
||||
export const previewChatFileContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/files/{file_id}/preview',
|
||||
operationId: 'previewChatFile',
|
||||
summary: 'File Preview',
|
||||
description: 'Preview or download uploaded files. This endpoint allows you to access files that have been previously uploaded via the File Upload API. Files can only be accessed if they belong to messages within the requesting application.',
|
||||
tags: ['Files'],
|
||||
}).input(zPreviewChatFileData).output(z.object({ body: zPreviewChatFileResponse, status: z.literal(200) }))
|
||||
20
web/gen/orpc/api/info.ts
Normal file
20
web/gen/orpc/api/info.ts
Normal 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'
|
||||
import { base } from '../common'
|
||||
|
||||
/**
|
||||
* Get Application Basic Information
|
||||
*
|
||||
* Used to get basic information about this application.
|
||||
*/
|
||||
export const getChatAppInfoContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/info',
|
||||
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) }))
|
||||
48
web/gen/orpc/api/messages.ts
Normal file
48
web/gen/orpc/api/messages.ts
Normal 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'
|
||||
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) }))
|
||||
20
web/gen/orpc/api/meta.ts
Normal file
20
web/gen/orpc/api/meta.ts
Normal 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'
|
||||
import { base } from '../common'
|
||||
|
||||
/**
|
||||
* Get Application Meta Information
|
||||
*
|
||||
* Used to get icons of tools in this application.
|
||||
*/
|
||||
export const getChatAppMetaContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/meta',
|
||||
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) }))
|
||||
20
web/gen/orpc/api/parameters.ts
Normal file
20
web/gen/orpc/api/parameters.ts
Normal 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'
|
||||
import { base } from '../common'
|
||||
|
||||
/**
|
||||
* 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({
|
||||
method: 'GET',
|
||||
path: '/parameters',
|
||||
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) }))
|
||||
20
web/gen/orpc/api/site.ts
Normal file
20
web/gen/orpc/api/site.ts
Normal 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'
|
||||
import { base } from '../common'
|
||||
|
||||
/**
|
||||
* Get Application WebApp Settings
|
||||
*
|
||||
* Used to get the WebApp settings of the application.
|
||||
*/
|
||||
export const getChatWebAppSettingsContract = base.route({
|
||||
method: 'GET',
|
||||
path: '/site',
|
||||
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) }))
|
||||
20
web/gen/orpc/api/text-to-audio.ts
Normal file
20
web/gen/orpc/api/text-to-audio.ts
Normal 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'
|
||||
import { base } from '../common'
|
||||
|
||||
/**
|
||||
* Text to Audio
|
||||
*
|
||||
* Convert text to speech.
|
||||
*/
|
||||
export const textToAudioChatContract = base.route({
|
||||
method: 'POST',
|
||||
path: '/text-to-audio',
|
||||
operationId: 'textToAudioChat',
|
||||
summary: 'Text to Audio',
|
||||
description: 'Convert text to speech.',
|
||||
tags: ['TTS'],
|
||||
}).input(zTextToAudioChatData).output(z.object({ body: zTextToAudioChatResponse, status: z.literal(200) }))
|
||||
5
web/gen/orpc/common.ts
Normal file
5
web/gen/orpc/common.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
|
||||
export const base = oc.$route({ inputStructure: 'detailed', outputStructure: 'detailed' })
|
||||
47
web/gen/orpc/router.ts
Normal file
47
web/gen/orpc/router.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { getChatAppFeedbacksContract } from './api/app'
|
||||
import { createAnnotationContract, deleteAnnotationContract, getAnnotationListContract, getInitialAnnotationReplySettingsStatusContract, initialAnnotationReplySettingsContract, updateAnnotationContract } from './api/apps'
|
||||
import { audioToTextContract } from './api/audio-to-text'
|
||||
import { sendChatMessageContract, stopChatMessageGenerationContract } from './api/chat-messages'
|
||||
import { deleteConversationContract, getConversationsListContract, getConversationVariablesContract, renameConversationContract } from './api/conversations'
|
||||
import { previewChatFileContract, uploadChatFileContract } from './api/files'
|
||||
import { getChatAppInfoContract } from './api/info'
|
||||
import { getConversationHistoryContract, getSuggestedQuestionsContract, postChatMessageFeedbackContract } from './api/messages'
|
||||
import { getChatAppMetaContract } from './api/meta'
|
||||
import { getChatAppParametersContract } from './api/parameters'
|
||||
import { getChatWebAppSettingsContract } from './api/site'
|
||||
import { textToAudioChatContract } from './api/text-to-audio'
|
||||
|
||||
export const router = {
|
||||
chatMessages: { send: sendChatMessageContract, stopGeneration: stopChatMessageGenerationContract },
|
||||
files: { uploadChat: uploadChatFileContract, previewChat: previewChatFileContract },
|
||||
messages: {
|
||||
postChatFeedback: postChatMessageFeedbackContract,
|
||||
getSuggestedQuestions: getSuggestedQuestionsContract,
|
||||
getConversationHistory: getConversationHistoryContract,
|
||||
},
|
||||
app: { getChatFeedbacks: getChatAppFeedbacksContract },
|
||||
conversations: {
|
||||
getList: getConversationsListContract,
|
||||
delete: deleteConversationContract,
|
||||
rename: renameConversationContract,
|
||||
getVariables: getConversationVariablesContract,
|
||||
},
|
||||
audioToText: { audioToText: audioToTextContract },
|
||||
textToAudio: { textToAudioChat: textToAudioChatContract },
|
||||
info: { getChatApp: getChatAppInfoContract },
|
||||
parameters: { getChatApp: getChatAppParametersContract },
|
||||
meta: { getChatApp: getChatAppMetaContract },
|
||||
site: { getChatWebAppSettings: getChatWebAppSettingsContract },
|
||||
apps: {
|
||||
getAnnotationList: getAnnotationListContract,
|
||||
createAnnotation: createAnnotationContract,
|
||||
deleteAnnotation: deleteAnnotationContract,
|
||||
updateAnnotation: updateAnnotationContract,
|
||||
initialAnnotationReplySettings: initialAnnotationReplySettingsContract,
|
||||
getInitialAnnotationReplySettingsStatus: getInitialAnnotationReplySettingsStatusContract,
|
||||
},
|
||||
}
|
||||
|
||||
export type Router = typeof router
|
||||
1367
web/gen/types.ts
Normal file
1367
web/gen/types.ts
Normal file
File diff suppressed because it is too large
Load Diff
28
web/gen/types/api/app.ts
Normal file
28
web/gen/types/api/app.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { AppFeedbacksResponse } from '../models/app'
|
||||
|
||||
export type GetChatAppFeedbacksData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
/**
|
||||
* (optional) Pagination page number. Default: 1
|
||||
*/
|
||||
page?: number
|
||||
/**
|
||||
* (optional) Records per page. Default: 20
|
||||
*/
|
||||
limit?: number
|
||||
}
|
||||
url: '/app/feedbacks'
|
||||
}
|
||||
|
||||
export type GetChatAppFeedbacksResponses = {
|
||||
/**
|
||||
* A list of application feedbacks.
|
||||
*/
|
||||
200: AppFeedbacksResponse
|
||||
}
|
||||
|
||||
export type GetChatAppFeedbacksResponse = GetChatAppFeedbacksResponses[keyof GetChatAppFeedbacksResponses]
|
||||
135
web/gen/types/api/apps.ts
Normal file
135
web/gen/types/api/apps.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { AnnotationItem, AnnotationListResponse } from '../models/annotation'
|
||||
import type { CreateAnnotationRequest } from '../models/create'
|
||||
import type { InitialAnnotationReplySettingsRequest, InitialAnnotationReplySettingsResponse as InitialAnnotationReplySettingsResponse2, InitialAnnotationReplySettingsStatusResponse } from '../models/initial'
|
||||
import type { UpdateAnnotationRequest } from '../models/update'
|
||||
|
||||
export type GetAnnotationListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
/**
|
||||
* Page number.
|
||||
*/
|
||||
page?: number
|
||||
/**
|
||||
* Number of items returned, default 20, range 1-100.
|
||||
*/
|
||||
limit?: number
|
||||
}
|
||||
url: '/apps/annotations'
|
||||
}
|
||||
|
||||
export type GetAnnotationListResponses = {
|
||||
/**
|
||||
* Successfully retrieved annotation list.
|
||||
*/
|
||||
200: AnnotationListResponse
|
||||
}
|
||||
|
||||
export type GetAnnotationListResponse = GetAnnotationListResponses[keyof GetAnnotationListResponses]
|
||||
|
||||
export type CreateAnnotationData = {
|
||||
body: CreateAnnotationRequest
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/apps/annotations'
|
||||
}
|
||||
|
||||
export type CreateAnnotationResponses = {
|
||||
/**
|
||||
* Annotation created successfully.
|
||||
*/
|
||||
200: AnnotationItem
|
||||
}
|
||||
|
||||
export type CreateAnnotationResponse = CreateAnnotationResponses[keyof CreateAnnotationResponses]
|
||||
|
||||
export type DeleteAnnotationData = {
|
||||
body?: never
|
||||
path: {
|
||||
/**
|
||||
* Annotation ID.
|
||||
*/
|
||||
annotation_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/apps/annotations/{annotation_id}'
|
||||
}
|
||||
|
||||
export type DeleteAnnotationResponses = {
|
||||
/**
|
||||
* Annotation deleted successfully. No Content.
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type DeleteAnnotationResponse = DeleteAnnotationResponses[keyof DeleteAnnotationResponses]
|
||||
|
||||
export type UpdateAnnotationData = {
|
||||
body: UpdateAnnotationRequest
|
||||
path: {
|
||||
/**
|
||||
* Annotation ID.
|
||||
*/
|
||||
annotation_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/apps/annotations/{annotation_id}'
|
||||
}
|
||||
|
||||
export type UpdateAnnotationResponses = {
|
||||
/**
|
||||
* Annotation updated successfully.
|
||||
*/
|
||||
200: AnnotationItem
|
||||
}
|
||||
|
||||
export type UpdateAnnotationResponse = UpdateAnnotationResponses[keyof UpdateAnnotationResponses]
|
||||
|
||||
export type InitialAnnotationReplySettingsData = {
|
||||
body: InitialAnnotationReplySettingsRequest
|
||||
path: {
|
||||
/**
|
||||
* Action, can only be 'enable' or 'disable'.
|
||||
*/
|
||||
action: 'enable' | 'disable'
|
||||
}
|
||||
query?: never
|
||||
url: '/apps/annotation-reply/{action}'
|
||||
}
|
||||
|
||||
export type InitialAnnotationReplySettingsResponses = {
|
||||
/**
|
||||
* Annotation reply settings task initiated.
|
||||
*/
|
||||
200: InitialAnnotationReplySettingsResponse2
|
||||
}
|
||||
|
||||
export type InitialAnnotationReplySettingsResponse = InitialAnnotationReplySettingsResponses[keyof InitialAnnotationReplySettingsResponses]
|
||||
|
||||
export type GetInitialAnnotationReplySettingsStatusData = {
|
||||
body?: never
|
||||
path: {
|
||||
/**
|
||||
* Action, must be the same as in the initial settings call ('enable' or 'disable').
|
||||
*/
|
||||
action: 'enable' | 'disable'
|
||||
/**
|
||||
* Job ID obtained from the initial settings call.
|
||||
*/
|
||||
job_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/apps/annotation-reply/{action}/status/{job_id}'
|
||||
}
|
||||
|
||||
export type GetInitialAnnotationReplySettingsStatusResponses = {
|
||||
/**
|
||||
* Successfully retrieved task status.
|
||||
*/
|
||||
200: InitialAnnotationReplySettingsStatusResponse
|
||||
}
|
||||
|
||||
export type GetInitialAnnotationReplySettingsStatusResponse = GetInitialAnnotationReplySettingsStatusResponses[keyof GetInitialAnnotationReplySettingsStatusResponses]
|
||||
19
web/gen/types/api/audio-to-text.ts
Normal file
19
web/gen/types/api/audio-to-text.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { AudioToTextRequest, AudioToTextResponse as AudioToTextResponse2 } from '../models/audio'
|
||||
|
||||
export type AudioToTextData = {
|
||||
body: AudioToTextRequest
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/audio-to-text'
|
||||
}
|
||||
|
||||
export type AudioToTextResponses = {
|
||||
/**
|
||||
* Successfully converted audio to text.
|
||||
*/
|
||||
200: AudioToTextResponse2
|
||||
}
|
||||
|
||||
export type AudioToTextResponse = AudioToTextResponses[keyof AudioToTextResponses]
|
||||
76
web/gen/types/api/chat-messages.ts
Normal file
76
web/gen/types/api/chat-messages.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { ChatCompletionResponse, ChatRequest } from '../models/chat'
|
||||
import type { ErrorResponse } from '../models/error'
|
||||
|
||||
export type SendChatMessageData = {
|
||||
/**
|
||||
* Request body to send a chat message.
|
||||
*/
|
||||
body: ChatRequest
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/chat-messages'
|
||||
}
|
||||
|
||||
export type SendChatMessageErrors = {
|
||||
/**
|
||||
* Bad Request. Possible error codes:
|
||||
* - `invalid_param`: Abnormal parameter input.
|
||||
* - `app_unavailable`: App configuration unavailable.
|
||||
* - `provider_not_initialize`: No available model credential configuration.
|
||||
* - `provider_quota_exceeded`: Model invocation quota insufficient.
|
||||
* - `model_currently_not_support`: Current model unavailable.
|
||||
* - `completion_request_error`: Text generation failed.
|
||||
*/
|
||||
400: ErrorResponse
|
||||
/**
|
||||
* Conversation does not exist.
|
||||
*/
|
||||
404: ErrorResponse
|
||||
/**
|
||||
* Internal server error.
|
||||
*/
|
||||
500: ErrorResponse
|
||||
}
|
||||
|
||||
export type SendChatMessageError = SendChatMessageErrors[keyof SendChatMessageErrors]
|
||||
|
||||
export type SendChatMessageResponses = {
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
200: ChatCompletionResponse
|
||||
}
|
||||
|
||||
export type SendChatMessageResponse = SendChatMessageResponses[keyof SendChatMessageResponses]
|
||||
|
||||
export type StopChatMessageGenerationData = {
|
||||
body: {
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
user: string
|
||||
}
|
||||
path: {
|
||||
/**
|
||||
* Task ID, can be obtained from the streaming chunk return of a `/chat-messages` request.
|
||||
*/
|
||||
task_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/chat-messages/{task_id}/stop'
|
||||
}
|
||||
|
||||
export type StopChatMessageGenerationResponses = {
|
||||
/**
|
||||
* Operation successful.
|
||||
*/
|
||||
200: {
|
||||
result?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type StopChatMessageGenerationResponse = StopChatMessageGenerationResponses[keyof StopChatMessageGenerationResponses]
|
||||
132
web/gen/types/api/conversations.ts
Normal file
132
web/gen/types/api/conversations.ts
Normal file
@@ -0,0 +1,132 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { ConversationListItem, ConversationRenameRequest, ConversationVariablesResponse } from '../models/conversation'
|
||||
import type { ConversationsListResponse } from '../models/conversations'
|
||||
import type { ErrorResponse } from '../models/error'
|
||||
|
||||
export type GetConversationsListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
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
|
||||
/**
|
||||
* (Optional) The ID of the last record on the current page (for pagination).
|
||||
*/
|
||||
last_id?: string
|
||||
/**
|
||||
* (Optional) How many records to return. Default 20, Min 1, Max 100.
|
||||
*/
|
||||
limit?: number
|
||||
/**
|
||||
* Sorting Field. Default: -updated_at. '-' prefix for descending.
|
||||
*/
|
||||
sort_by?: 'created_at' | '-created_at' | 'updated_at' | '-updated_at'
|
||||
}
|
||||
url: '/conversations'
|
||||
}
|
||||
|
||||
export type GetConversationsListResponses = {
|
||||
/**
|
||||
* Successfully retrieved conversations list.
|
||||
*/
|
||||
200: ConversationsListResponse
|
||||
}
|
||||
|
||||
export type GetConversationsListResponse = GetConversationsListResponses[keyof GetConversationsListResponses]
|
||||
|
||||
export type DeleteConversationData = {
|
||||
body: {
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
user: string
|
||||
}
|
||||
path: {
|
||||
/**
|
||||
* Conversation ID.
|
||||
*/
|
||||
conversation_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/conversations/{conversation_id}'
|
||||
}
|
||||
|
||||
export type DeleteConversationResponses = {
|
||||
/**
|
||||
* Conversation deleted successfully. No Content.
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type DeleteConversationResponse = DeleteConversationResponses[keyof DeleteConversationResponses]
|
||||
|
||||
export type RenameConversationData = {
|
||||
body: ConversationRenameRequest
|
||||
path: {
|
||||
/**
|
||||
* Conversation ID.
|
||||
*/
|
||||
conversation_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/conversations/{conversation_id}/name'
|
||||
}
|
||||
|
||||
export type RenameConversationResponses = {
|
||||
/**
|
||||
* Conversation renamed successfully.
|
||||
*/
|
||||
200: ConversationListItem
|
||||
}
|
||||
|
||||
export type RenameConversationResponse = RenameConversationResponses[keyof RenameConversationResponses]
|
||||
|
||||
export type GetConversationVariablesData = {
|
||||
body?: never
|
||||
path: {
|
||||
/**
|
||||
* The ID of the conversation to retrieve variables from.
|
||||
*/
|
||||
conversation_id: string
|
||||
}
|
||||
query: {
|
||||
/**
|
||||
* The user identifier.
|
||||
*/
|
||||
user: string
|
||||
/**
|
||||
* (Optional) The ID of the last record on the current page (for pagination).
|
||||
*/
|
||||
last_id?: string
|
||||
/**
|
||||
* (Optional) How many records to return. Default 20, Min 1, Max 100.
|
||||
*/
|
||||
limit?: number
|
||||
/**
|
||||
* (Optional) Filter variables by a specific name.
|
||||
*/
|
||||
variable_name?: string
|
||||
}
|
||||
url: '/conversations/{conversation_id}/variables'
|
||||
}
|
||||
|
||||
export type GetConversationVariablesErrors = {
|
||||
/**
|
||||
* Conversation not found. Error code: `conversation_not_exists`
|
||||
*/
|
||||
404: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetConversationVariablesError = GetConversationVariablesErrors[keyof GetConversationVariablesErrors]
|
||||
|
||||
export type GetConversationVariablesResponses = {
|
||||
/**
|
||||
* Successfully retrieved conversation variables.
|
||||
*/
|
||||
200: ConversationVariablesResponse
|
||||
}
|
||||
|
||||
export type GetConversationVariablesResponse = GetConversationVariablesResponses[keyof GetConversationVariablesResponses]
|
||||
114
web/gen/types/api/files.ts
Normal file
114
web/gen/types/api/files.ts
Normal file
@@ -0,0 +1,114 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { ErrorResponse } from '../models/error'
|
||||
import type { FileUploadResponse } from '../models/file'
|
||||
|
||||
export type UploadChatFileData = {
|
||||
/**
|
||||
* File upload request. Requires multipart/form-data.
|
||||
*/
|
||||
body: {
|
||||
/**
|
||||
* The file to be uploaded. Supported image types: png, jpg, jpeg, webp, gif.
|
||||
*/
|
||||
file: Blob | File
|
||||
/**
|
||||
* User identifier, defined by the developer's rules, must be unique within the application. **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
|
||||
}
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/files/upload'
|
||||
}
|
||||
|
||||
export type UploadChatFileErrors = {
|
||||
/**
|
||||
* Bad Request for file operations. Possible error codes:
|
||||
* - `no_file_uploaded`: A file must be provided.
|
||||
* - `too_many_files`: Currently only one file is accepted.
|
||||
* - `unsupported_preview`: The file does not support preview.
|
||||
* - `unsupported_estimate`: The file does not support estimation.
|
||||
*/
|
||||
400: ErrorResponse
|
||||
/**
|
||||
* `file_too_large`: The file is too large.
|
||||
*/
|
||||
413: ErrorResponse
|
||||
/**
|
||||
* `unsupported_file_type`: Unsupported extension. (Note: The description for `/files/upload` lists image types, while this generic error mentions document files. This might indicate a context-specific message from the backend).
|
||||
*/
|
||||
415: ErrorResponse
|
||||
/**
|
||||
* Internal server error.
|
||||
*/
|
||||
500: ErrorResponse
|
||||
/**
|
||||
* Service Unavailable for S3 operations. Possible error codes:
|
||||
* - `s3_connection_failed`: Unable to connect to S3 service.
|
||||
* - `s3_permission_denied`: No permission to upload files to S3.
|
||||
* - `s3_file_too_large`: File exceeds S3 size limit.
|
||||
*/
|
||||
503: ErrorResponse
|
||||
}
|
||||
|
||||
export type UploadChatFileError = UploadChatFileErrors[keyof UploadChatFileErrors]
|
||||
|
||||
export type UploadChatFileResponses = {
|
||||
/**
|
||||
* File uploaded successfully.
|
||||
*/
|
||||
200: FileUploadResponse
|
||||
}
|
||||
|
||||
export type UploadChatFileResponse = UploadChatFileResponses[keyof UploadChatFileResponses]
|
||||
|
||||
export type PreviewChatFileData = {
|
||||
body?: never
|
||||
path: {
|
||||
/**
|
||||
* The unique identifier of the file to preview, obtained from the File Upload API response.
|
||||
*/
|
||||
file_id: string
|
||||
}
|
||||
query?: {
|
||||
/**
|
||||
* Whether to force download the file as an attachment. Default is `false` (preview in browser).
|
||||
*/
|
||||
as_attachment?: boolean
|
||||
}
|
||||
url: '/files/{file_id}/preview'
|
||||
}
|
||||
|
||||
export type PreviewChatFileErrors = {
|
||||
/**
|
||||
* Bad Request. Possible error codes:
|
||||
* - `invalid_param`: Abnormal parameter input.
|
||||
*/
|
||||
400: ErrorResponse
|
||||
/**
|
||||
* Forbidden. Possible error codes:
|
||||
* - `file_access_denied`: File access denied or file does not belong to current application.
|
||||
*/
|
||||
403: ErrorResponse
|
||||
/**
|
||||
* Not Found. Possible error codes:
|
||||
* - `file_not_found`: File not found or has been deleted.
|
||||
*/
|
||||
404: ErrorResponse
|
||||
/**
|
||||
* Internal server error.
|
||||
*/
|
||||
500: ErrorResponse
|
||||
}
|
||||
|
||||
export type PreviewChatFileError = PreviewChatFileErrors[keyof PreviewChatFileErrors]
|
||||
|
||||
export type PreviewChatFileResponses = {
|
||||
/**
|
||||
* File content returned successfully. Headers set based on file type and request parameters.
|
||||
*/
|
||||
200: Blob | File
|
||||
}
|
||||
|
||||
export type PreviewChatFileResponse = PreviewChatFileResponses[keyof PreviewChatFileResponses]
|
||||
19
web/gen/types/api/info.ts
Normal file
19
web/gen/types/api/info.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { AppInfoResponse } from '../models/app'
|
||||
|
||||
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]
|
||||
87
web/gen/types/api/messages.ts
Normal file
87
web/gen/types/api/messages.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { ConversationHistoryResponse } from '../models/conversation'
|
||||
import type { MessageFeedbackRequest } from '../models/message'
|
||||
import type { SuggestedQuestionsResponse } from '../models/suggested'
|
||||
|
||||
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]
|
||||
19
web/gen/types/api/meta.ts
Normal file
19
web/gen/types/api/meta.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { AppMetaResponse } from '../models/app'
|
||||
|
||||
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]
|
||||
24
web/gen/types/api/parameters.ts
Normal file
24
web/gen/types/api/parameters.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { ChatAppParametersResponse } from '../models/chat'
|
||||
|
||||
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]
|
||||
19
web/gen/types/api/site.ts
Normal file
19
web/gen/types/api/site.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { WebAppSettingsResponse } from '../models/web'
|
||||
|
||||
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]
|
||||
19
web/gen/types/api/text-to-audio.ts
Normal file
19
web/gen/types/api/text-to-audio.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { TextToAudioFormRequest } from '../models/text'
|
||||
|
||||
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]
|
||||
5
web/gen/types/common.ts
Normal file
5
web/gen/types/common.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://{api_base_url}` | (string & {})
|
||||
}
|
||||
40
web/gen/types/models/agent.ts
Normal file
40
web/gen/types/models/agent.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type AgentThoughtItem = {
|
||||
/**
|
||||
* Agent thought ID.
|
||||
*/
|
||||
id?: string
|
||||
/**
|
||||
* Unique message ID this thought belongs to.
|
||||
*/
|
||||
message_id?: string
|
||||
/**
|
||||
* Position of this thought.
|
||||
*/
|
||||
position?: number
|
||||
/**
|
||||
* What LLM is thinking.
|
||||
*/
|
||||
thought?: string
|
||||
/**
|
||||
* Tools called, split by ';'.
|
||||
*/
|
||||
tool?: string
|
||||
/**
|
||||
* Input of tools in JSON format.
|
||||
*/
|
||||
tool_input?: string
|
||||
/**
|
||||
* Response from tool calls.
|
||||
*/
|
||||
observation?: string
|
||||
/**
|
||||
* File IDs related to this thought (from example, Markdown text says 'message_files').
|
||||
*/
|
||||
files?: Array<string>
|
||||
/**
|
||||
* Creation timestamp.
|
||||
*/
|
||||
created_at?: number
|
||||
}
|
||||
17
web/gen/types/models/annotation.ts
Normal file
17
web/gen/types/models/annotation.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type AnnotationListResponse = {
|
||||
data?: Array<AnnotationItem>
|
||||
has_more?: boolean
|
||||
limit?: number
|
||||
total?: number
|
||||
page?: number
|
||||
}
|
||||
|
||||
export type AnnotationItem = {
|
||||
id?: string
|
||||
question?: string
|
||||
answer?: string
|
||||
hit_count?: number
|
||||
created_at?: number
|
||||
}
|
||||
23
web/gen/types/models/app.ts
Normal file
23
web/gen/types/models/app.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { FeedbackItem } from './feedback'
|
||||
import type { ToolIconDetail } from './tool'
|
||||
|
||||
export type AppFeedbacksResponse = {
|
||||
data?: Array<FeedbackItem>
|
||||
}
|
||||
|
||||
export type AppInfoResponse = {
|
||||
name?: string
|
||||
description?: string
|
||||
tags?: Array<string>
|
||||
}
|
||||
|
||||
export type AppMetaResponse = {
|
||||
/**
|
||||
* Tool icons. Keys are tool names.
|
||||
*/
|
||||
tool_icons?: {
|
||||
[key: string]: string | ToolIconDetail
|
||||
}
|
||||
}
|
||||
19
web/gen/types/models/audio.ts
Normal file
19
web/gen/types/models/audio.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type AudioToTextRequest = {
|
||||
/**
|
||||
* Audio file. Supported: mp3, mp4, mpeg, mpga, m4a, wav, webm. Limit: 15MB.
|
||||
*/
|
||||
file: Blob | File
|
||||
/**
|
||||
* User identifier.
|
||||
*/
|
||||
user: string
|
||||
}
|
||||
|
||||
export type AudioToTextResponse = {
|
||||
/**
|
||||
* Output text from speech recognition.
|
||||
*/
|
||||
text?: string
|
||||
}
|
||||
119
web/gen/types/models/chat.ts
Normal file
119
web/gen/types/models/chat.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { InputFileObject } from './input'
|
||||
import type { RetrieverResource } from './retriever'
|
||||
import type { Usage } from './usage'
|
||||
import type { UserInputFormItem } from './user'
|
||||
|
||||
export type ChatRequest = {
|
||||
/**
|
||||
* User Input/Question content.
|
||||
*/
|
||||
query: string
|
||||
/**
|
||||
* Allows the entry of various variable values defined by the App. Contains key/value pairs. Default {}.
|
||||
*/
|
||||
inputs?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
/**
|
||||
* Mode of response return. `streaming` (recommended) uses SSE. `blocking` returns after completion (may be interrupted for long processes; not supported in Agent Assistant mode). Cloudflare timeout is 100s.
|
||||
*/
|
||||
response_mode?: 'streaming' | 'blocking'
|
||||
/**
|
||||
* User identifier, unique within the application. **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
|
||||
/**
|
||||
* Conversation ID to continue a conversation. Pass the previous message's conversation_id.
|
||||
*/
|
||||
conversation_id?: string
|
||||
/**
|
||||
* File list (images) for Vision-capable models.
|
||||
*/
|
||||
files?: Array<InputFileObject>
|
||||
/**
|
||||
* Auto-generate conversation title. Default `true`. If `false`, use conversation rename API with `auto_generate: true` for async title generation.
|
||||
*/
|
||||
auto_generate_name?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Response object for blocking mode chat completion.
|
||||
*/
|
||||
export type ChatCompletionResponse = {
|
||||
/**
|
||||
* Event type, fixed as `message`.
|
||||
*/
|
||||
event?: string
|
||||
/**
|
||||
* Task ID for request tracking and stop response API.
|
||||
*/
|
||||
task_id?: string
|
||||
/**
|
||||
* Unique ID of this response/message event.
|
||||
*/
|
||||
id?: string
|
||||
/**
|
||||
* Unique message ID.
|
||||
*/
|
||||
message_id?: string
|
||||
/**
|
||||
* Conversation ID.
|
||||
*/
|
||||
conversation_id?: string
|
||||
/**
|
||||
* App mode, fixed as `chat`.
|
||||
*/
|
||||
mode?: string
|
||||
/**
|
||||
* Complete response content.
|
||||
*/
|
||||
answer?: string
|
||||
metadata?: {
|
||||
usage?: Usage
|
||||
retriever_resources?: Array<RetrieverResource>
|
||||
}
|
||||
/**
|
||||
* Message creation timestamp (Unix epoch seconds).
|
||||
*/
|
||||
created_at?: number
|
||||
}
|
||||
|
||||
export type ChatAppParametersResponse = {
|
||||
opening_statement?: string
|
||||
suggested_questions?: Array<string>
|
||||
suggested_questions_after_answer?: {
|
||||
enabled?: boolean
|
||||
}
|
||||
speech_to_text?: {
|
||||
enabled?: boolean
|
||||
}
|
||||
text_to_speech?: {
|
||||
enabled?: boolean
|
||||
voice?: string
|
||||
language?: string
|
||||
autoPlay?: 'enabled' | 'disabled'
|
||||
}
|
||||
retriever_resource?: {
|
||||
enabled?: boolean
|
||||
}
|
||||
annotation_reply?: {
|
||||
enabled?: boolean
|
||||
}
|
||||
user_input_form?: Array<UserInputFormItem>
|
||||
file_upload?: {
|
||||
image?: {
|
||||
enabled?: boolean
|
||||
number_limits?: number
|
||||
detail?: string
|
||||
transfer_methods?: Array<'remote_url' | 'local_file'>
|
||||
}
|
||||
}
|
||||
system_parameters?: {
|
||||
file_size_limit?: number
|
||||
image_file_size_limit?: number
|
||||
audio_file_size_limit?: number
|
||||
video_file_size_limit?: number
|
||||
}
|
||||
}
|
||||
11
web/gen/types/models/chunk.ts
Normal file
11
web/gen/types/models/chunk.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
/**
|
||||
* Base schema for Server-Sent Event chunks in streaming mode.
|
||||
*/
|
||||
export type ChunkChatEvent = {
|
||||
/**
|
||||
* The type of event.
|
||||
*/
|
||||
event: 'message' | 'agent_message' | 'tts_message' | 'tts_message_end' | 'agent_thought' | 'message_file' | 'message_end' | 'message_replace' | 'error' | 'ping'
|
||||
}
|
||||
100
web/gen/types/models/conversation.ts
Normal file
100
web/gen/types/models/conversation.ts
Normal file
@@ -0,0 +1,100 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { AgentThoughtItem } from './agent'
|
||||
import type { MessageFileItem } from './message'
|
||||
import type { RetrieverResource } from './retriever'
|
||||
|
||||
export type ConversationHistoryResponse = {
|
||||
limit?: number
|
||||
has_more?: boolean
|
||||
data?: Array<ConversationMessageItem>
|
||||
}
|
||||
|
||||
export type ConversationMessageItem = {
|
||||
id?: string
|
||||
conversation_id?: string
|
||||
inputs?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
query?: string
|
||||
answer?: string
|
||||
message_files?: Array<MessageFileItem>
|
||||
feedback?: {
|
||||
rating?: 'like' | 'dislike'
|
||||
} | null
|
||||
retriever_resources?: Array<RetrieverResource>
|
||||
agent_thoughts?: Array<AgentThoughtItem>
|
||||
created_at?: number
|
||||
}
|
||||
|
||||
export type ConversationListItem = {
|
||||
id?: string
|
||||
name?: string
|
||||
inputs?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
status?: string
|
||||
introduction?: string
|
||||
created_at?: number
|
||||
updated_at?: number
|
||||
}
|
||||
|
||||
export type ConversationRenameRequest = {
|
||||
/**
|
||||
* (Optional) The name of the conversation. Omit if auto_generate is true.
|
||||
*/
|
||||
name?: string
|
||||
/**
|
||||
* (Optional) Automatically generate the title. Default false.
|
||||
*/
|
||||
auto_generate?: boolean
|
||||
/**
|
||||
* The user identifier.
|
||||
*/
|
||||
user: string
|
||||
}
|
||||
|
||||
export type ConversationRenameResponse = ConversationListItem
|
||||
|
||||
export type ConversationVariablesResponse = {
|
||||
/**
|
||||
* Number of items per page.
|
||||
*/
|
||||
limit?: number
|
||||
/**
|
||||
* Whether there is a next page.
|
||||
*/
|
||||
has_more?: boolean
|
||||
data?: Array<ConversationVariableItem>
|
||||
}
|
||||
|
||||
export type ConversationVariableItem = {
|
||||
/**
|
||||
* Variable ID.
|
||||
*/
|
||||
id?: string
|
||||
/**
|
||||
* Variable name.
|
||||
*/
|
||||
name?: string
|
||||
/**
|
||||
* Variable type (string, number, object, json, etc.).
|
||||
*/
|
||||
value_type?: string
|
||||
/**
|
||||
* Variable value (can be a JSON string for complex types).
|
||||
*/
|
||||
value?: string
|
||||
/**
|
||||
* Variable description.
|
||||
*/
|
||||
description?: string
|
||||
/**
|
||||
* Creation timestamp.
|
||||
*/
|
||||
created_at?: number
|
||||
/**
|
||||
* Last update timestamp.
|
||||
*/
|
||||
updated_at?: number
|
||||
}
|
||||
9
web/gen/types/models/conversations.ts
Normal file
9
web/gen/types/models/conversations.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { ConversationListItem } from './conversation'
|
||||
|
||||
export type ConversationsListResponse = {
|
||||
limit?: number
|
||||
has_more?: boolean
|
||||
data?: Array<ConversationListItem>
|
||||
}
|
||||
6
web/gen/types/models/create.ts
Normal file
6
web/gen/types/models/create.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type CreateAnnotationRequest = {
|
||||
question: string
|
||||
answer: string
|
||||
}
|
||||
7
web/gen/types/models/error.ts
Normal file
7
web/gen/types/models/error.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ErrorResponse = {
|
||||
status?: number
|
||||
code?: string
|
||||
message?: string
|
||||
}
|
||||
15
web/gen/types/models/feedback.ts
Normal file
15
web/gen/types/models/feedback.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type FeedbackItem = {
|
||||
id?: string
|
||||
app_id?: string
|
||||
conversation_id?: string
|
||||
message_id?: string
|
||||
rating?: 'like' | 'dislike' | null
|
||||
content?: string
|
||||
from_source?: string
|
||||
from_end_user_id?: string
|
||||
from_account_id?: string | null
|
||||
created_at?: string
|
||||
updated_at?: string
|
||||
}
|
||||
11
web/gen/types/models/file.ts
Normal file
11
web/gen/types/models/file.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type FileUploadResponse = {
|
||||
id?: string
|
||||
name?: string
|
||||
size?: number
|
||||
extension?: string
|
||||
mime_type?: string
|
||||
created_by?: string
|
||||
created_at?: number
|
||||
}
|
||||
27
web/gen/types/models/initial.ts
Normal file
27
web/gen/types/models/initial.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type InitialAnnotationReplySettingsRequest = {
|
||||
/**
|
||||
* Specified embedding model provider name (Optional).
|
||||
*/
|
||||
embedding_provider_name?: string
|
||||
/**
|
||||
* Specified embedding model name (Optional).
|
||||
*/
|
||||
embedding_model_name?: string
|
||||
/**
|
||||
* Similarity threshold for matching annotated replies.
|
||||
*/
|
||||
score_threshold: number
|
||||
}
|
||||
|
||||
export type InitialAnnotationReplySettingsResponse = {
|
||||
job_id?: string
|
||||
job_status?: string
|
||||
}
|
||||
|
||||
export type InitialAnnotationReplySettingsStatusResponse = {
|
||||
job_id?: string
|
||||
job_status?: string
|
||||
error_msg?: string | null
|
||||
}
|
||||
26
web/gen/types/models/input.ts
Normal file
26
web/gen/types/models/input.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type InputFileObject = ({
|
||||
transfer_method?: 'remote_url'
|
||||
url: string
|
||||
} | {
|
||||
transfer_method?: 'local_file'
|
||||
upload_file_id: string
|
||||
}) & {
|
||||
/**
|
||||
* Supported type: `image`.
|
||||
*/
|
||||
type: 'image'
|
||||
/**
|
||||
* Transfer method, `remote_url` for image URL / `local_file` for file upload
|
||||
*/
|
||||
transfer_method: 'remote_url' | 'local_file'
|
||||
/**
|
||||
* Image URL (when the transfer method is `remote_url`)
|
||||
*/
|
||||
url?: string
|
||||
/**
|
||||
* Uploaded file ID, which must be obtained by uploading through the File Upload API in advance (when the transfer method is `local_file`)
|
||||
*/
|
||||
upload_file_id?: string
|
||||
}
|
||||
23
web/gen/types/models/message.ts
Normal file
23
web/gen/types/models/message.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type MessageFeedbackRequest = {
|
||||
rating?: 'like' | 'dislike' | null
|
||||
user: string
|
||||
content?: string
|
||||
}
|
||||
|
||||
export type MessageFileItem = {
|
||||
id?: string
|
||||
/**
|
||||
* File type, e.g., 'image'.
|
||||
*/
|
||||
type?: string
|
||||
/**
|
||||
* Preview image URL.
|
||||
*/
|
||||
url?: string
|
||||
/**
|
||||
* Who this file belongs to.
|
||||
*/
|
||||
belongs_to?: 'user' | 'assistant'
|
||||
}
|
||||
12
web/gen/types/models/paragraph.ts
Normal file
12
web/gen/types/models/paragraph.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ParagraphControlWrapper = {
|
||||
paragraph: ParagraphControl
|
||||
}
|
||||
|
||||
export type ParagraphControl = {
|
||||
label: string
|
||||
variable: string
|
||||
required: boolean
|
||||
default?: string
|
||||
}
|
||||
39
web/gen/types/models/retriever.ts
Normal file
39
web/gen/types/models/retriever.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
/**
|
||||
* Citation and Attribution information for a resource.
|
||||
*/
|
||||
export type RetrieverResource = {
|
||||
/**
|
||||
* Position of the resource in the list.
|
||||
*/
|
||||
position?: number
|
||||
/**
|
||||
* ID of the dataset.
|
||||
*/
|
||||
dataset_id?: string
|
||||
/**
|
||||
* Name of the dataset.
|
||||
*/
|
||||
dataset_name?: string
|
||||
/**
|
||||
* ID of the document.
|
||||
*/
|
||||
document_id?: string
|
||||
/**
|
||||
* Name of the document.
|
||||
*/
|
||||
document_name?: string
|
||||
/**
|
||||
* ID of the specific segment within the document.
|
||||
*/
|
||||
segment_id?: string
|
||||
/**
|
||||
* Relevance score of the resource.
|
||||
*/
|
||||
score?: number
|
||||
/**
|
||||
* Content snippet from the resource.
|
||||
*/
|
||||
content?: string
|
||||
}
|
||||
13
web/gen/types/models/select.ts
Normal file
13
web/gen/types/models/select.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type SelectControlWrapper = {
|
||||
select: SelectControl
|
||||
}
|
||||
|
||||
export type SelectControl = {
|
||||
label: string
|
||||
variable: string
|
||||
required: boolean
|
||||
default?: string
|
||||
options: Array<string>
|
||||
}
|
||||
149
web/gen/types/models/stream.ts
Normal file
149
web/gen/types/models/stream.ts
Normal file
@@ -0,0 +1,149 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { ChunkChatEvent } from './chunk'
|
||||
import type { RetrieverResource } from './retriever'
|
||||
import type { Usage } from './usage'
|
||||
|
||||
export type StreamEventBase = {
|
||||
/**
|
||||
* Task ID.
|
||||
*/
|
||||
task_id?: string
|
||||
/**
|
||||
* Unique message ID.
|
||||
*/
|
||||
message_id?: string
|
||||
/**
|
||||
* Conversation ID.
|
||||
*/
|
||||
conversation_id?: string
|
||||
/**
|
||||
* Creation timestamp.
|
||||
*/
|
||||
created_at?: number
|
||||
}
|
||||
|
||||
export type StreamEventChatMessage = Omit<ChunkChatEvent, 'event'> & StreamEventBase & {
|
||||
/**
|
||||
* LLM returned text chunk.
|
||||
*/
|
||||
answer: string
|
||||
event: 'message'
|
||||
}
|
||||
|
||||
export type StreamEventChatAgentMessage = Omit<ChunkChatEvent, 'event'> & StreamEventBase & {
|
||||
/**
|
||||
* LLM returned text chunk (Agent mode).
|
||||
*/
|
||||
answer: string
|
||||
event: 'agent_message'
|
||||
}
|
||||
|
||||
export type StreamEventChatTtsMessage = Omit<ChunkChatEvent, 'event'> & StreamEventBase & {
|
||||
/**
|
||||
* Base64 encoded audio chunk.
|
||||
*/
|
||||
audio: string
|
||||
event: 'tts_message'
|
||||
}
|
||||
|
||||
export type StreamEventChatTtsMessageEnd = Omit<ChunkChatEvent, 'event'> & StreamEventBase & {
|
||||
/**
|
||||
* Empty string for end event.
|
||||
*/
|
||||
audio: string
|
||||
event: 'tts_message_end'
|
||||
}
|
||||
|
||||
export type StreamEventChatAgentThought = Omit<ChunkChatEvent, 'event'> & StreamEventBase & {
|
||||
/**
|
||||
* Agent thought ID.
|
||||
*/
|
||||
id: string
|
||||
/**
|
||||
* Position of this thought in the sequence for the message.
|
||||
*/
|
||||
position: number
|
||||
/**
|
||||
* What LLM is thinking.
|
||||
*/
|
||||
thought?: string
|
||||
/**
|
||||
* Response from tool calls.
|
||||
*/
|
||||
observation?: string
|
||||
/**
|
||||
* List of tools called, split by ';'.
|
||||
*/
|
||||
tool?: string
|
||||
/**
|
||||
* Input of tools in JSON format. Example: {"dalle3": {"prompt": "a cute cat"}}.
|
||||
*/
|
||||
tool_input?: string
|
||||
/**
|
||||
* File IDs of files related to this thought (e.g., generated by a tool).
|
||||
*/
|
||||
message_files?: Array<string>
|
||||
event: 'agent_thought'
|
||||
}
|
||||
|
||||
export type StreamEventChatMessageFile = Omit<ChunkChatEvent, 'event'> & {
|
||||
/**
|
||||
* File unique ID.
|
||||
*/
|
||||
id: string
|
||||
/**
|
||||
* File type, currently only 'image'.
|
||||
*/
|
||||
type: 'image'
|
||||
/**
|
||||
* Who this file belongs to, always 'assistant' here.
|
||||
*/
|
||||
belongs_to: 'assistant'
|
||||
/**
|
||||
* Remote URL of the file.
|
||||
*/
|
||||
url: string
|
||||
/**
|
||||
* Conversation ID.
|
||||
*/
|
||||
conversation_id: string
|
||||
event: 'message_file'
|
||||
}
|
||||
|
||||
export type StreamEventChatMessageEnd = Omit<ChunkChatEvent, 'event'> & StreamEventBase & {
|
||||
metadata: {
|
||||
usage?: Usage
|
||||
retriever_resources?: Array<RetrieverResource>
|
||||
}
|
||||
event: 'message_end'
|
||||
}
|
||||
|
||||
export type StreamEventChatMessageReplace = Omit<ChunkChatEvent, 'event'> & StreamEventBase & {
|
||||
/**
|
||||
* Replacement content.
|
||||
*/
|
||||
answer: string
|
||||
event: 'message_replace'
|
||||
}
|
||||
|
||||
export type StreamEventChatError = Omit<ChunkChatEvent, 'event'> & StreamEventBase & {
|
||||
/**
|
||||
* HTTP status code.
|
||||
*/
|
||||
status: number
|
||||
/**
|
||||
* Error code.
|
||||
*/
|
||||
code: string
|
||||
/**
|
||||
* Error message.
|
||||
*/
|
||||
message: string
|
||||
event: 'error'
|
||||
}
|
||||
|
||||
export type StreamEventChatPing = Omit<ChunkChatEvent, 'event'> & {
|
||||
event: 'ping'
|
||||
[key: string]: unknown | 'ping'
|
||||
}
|
||||
6
web/gen/types/models/suggested.ts
Normal file
6
web/gen/types/models/suggested.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type SuggestedQuestionsResponse = {
|
||||
result?: string
|
||||
data?: Array<string>
|
||||
}
|
||||
30
web/gen/types/models/text.ts
Normal file
30
web/gen/types/models/text.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
/**
|
||||
* Requires `user`. Provide either `message_id` or `text`.
|
||||
*/
|
||||
export type TextToAudioFormRequest = {
|
||||
/**
|
||||
* Message ID (priority if both text and message_id provided).
|
||||
*/
|
||||
message_id?: string
|
||||
/**
|
||||
* Speech content.
|
||||
*/
|
||||
text?: string
|
||||
/**
|
||||
* User identifier.
|
||||
*/
|
||||
user: string
|
||||
}
|
||||
|
||||
export type TextInputControlWrapper = {
|
||||
'text-input': TextInputControl
|
||||
}
|
||||
|
||||
export type TextInputControl = {
|
||||
label: string
|
||||
variable: string
|
||||
required: boolean
|
||||
default?: string
|
||||
}
|
||||
12
web/gen/types/models/tool.ts
Normal file
12
web/gen/types/models/tool.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ToolIconDetail = {
|
||||
/**
|
||||
* Background color in hex format.
|
||||
*/
|
||||
background?: string
|
||||
/**
|
||||
* Emoji content.
|
||||
*/
|
||||
content?: string
|
||||
}
|
||||
6
web/gen/types/models/update.ts
Normal file
6
web/gen/types/models/update.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type UpdateAnnotationRequest = {
|
||||
question: string
|
||||
answer: string
|
||||
}
|
||||
19
web/gen/types/models/usage.ts
Normal file
19
web/gen/types/models/usage.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
/**
|
||||
* Model usage information.
|
||||
*/
|
||||
export type Usage = {
|
||||
prompt_tokens?: number
|
||||
prompt_unit_price?: string
|
||||
prompt_price_unit?: string
|
||||
prompt_price?: string
|
||||
completion_tokens?: number
|
||||
completion_unit_price?: string
|
||||
completion_price_unit?: string
|
||||
completion_price?: string
|
||||
total_tokens?: number
|
||||
total_price?: string
|
||||
currency?: string
|
||||
latency?: number
|
||||
}
|
||||
7
web/gen/types/models/user.ts
Normal file
7
web/gen/types/models/user.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { ParagraphControlWrapper } from './paragraph'
|
||||
import type { SelectControlWrapper } from './select'
|
||||
import type { TextInputControlWrapper } from './text'
|
||||
|
||||
export type UserInputFormItem = TextInputControlWrapper | ParagraphControlWrapper | SelectControlWrapper
|
||||
18
web/gen/types/models/web.ts
Normal file
18
web/gen/types/models/web.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type WebAppSettingsResponse = {
|
||||
title?: string
|
||||
chat_color_theme?: string
|
||||
chat_color_theme_inverted?: boolean
|
||||
icon_type?: 'emoji' | 'image'
|
||||
icon?: string
|
||||
icon_background?: string
|
||||
icon_url?: string | null
|
||||
description?: string
|
||||
copyright?: string
|
||||
privacy_policy?: string
|
||||
custom_disclaimer?: string
|
||||
default_language?: string
|
||||
show_workflow_steps?: boolean
|
||||
use_icon_as_answer_icon?: boolean
|
||||
}
|
||||
1017
web/gen/zod.ts
Normal file
1017
web/gen/zod.ts
Normal file
File diff suppressed because it is too large
Load Diff
23
web/gen/zod/api/app.ts
Normal file
23
web/gen/zod/api/app.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zAppFeedbacksResponse } from '../models/app'
|
||||
|
||||
export const zGetChatAppFeedbacksData = z.object({
|
||||
body: z.never().optional(),
|
||||
path: z.never().optional(),
|
||||
query: z.object({
|
||||
page: z.number().int().describe('(optional) Pagination page number. Default: 1').optional().default(1),
|
||||
limit: z.number().int().describe('(optional) Records per page. Default: 20').optional().default(20),
|
||||
}).optional(),
|
||||
})
|
||||
|
||||
export type GetChatAppFeedbacksDataZodType = z.infer<typeof zGetChatAppFeedbacksData>
|
||||
|
||||
/**
|
||||
* A list of application feedbacks.
|
||||
*/
|
||||
export const zGetChatAppFeedbacksResponse = zAppFeedbacksResponse
|
||||
|
||||
export type GetChatAppFeedbacksResponseZodType = z.infer<typeof zGetChatAppFeedbacksResponse>
|
||||
110
web/gen/zod/api/apps.ts
Normal file
110
web/gen/zod/api/apps.ts
Normal file
@@ -0,0 +1,110 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zAnnotationItem, zAnnotationListResponse } from '../models/annotation'
|
||||
import { zCreateAnnotationRequest } from '../models/create'
|
||||
import { zInitialAnnotationReplySettingsRequest, zInitialAnnotationReplySettingsResponse as zInitialAnnotationReplySettingsResponse2, zInitialAnnotationReplySettingsStatusResponse } from '../models/initial'
|
||||
import { zUpdateAnnotationRequest } from '../models/update'
|
||||
|
||||
export const zGetAnnotationListData = z.object({
|
||||
body: z.never().optional(),
|
||||
path: z.never().optional(),
|
||||
query: z.object({
|
||||
page: z.number().int().describe('Page number.').optional().default(1),
|
||||
limit: z.number().int().gte(1).lte(100).describe('Number of items returned, default 20, range 1-100.').optional().default(20),
|
||||
}).optional(),
|
||||
})
|
||||
|
||||
export type GetAnnotationListDataZodType = z.infer<typeof zGetAnnotationListData>
|
||||
|
||||
/**
|
||||
* Successfully retrieved annotation list.
|
||||
*/
|
||||
export const zGetAnnotationListResponse = zAnnotationListResponse
|
||||
|
||||
export type GetAnnotationListResponseZodType = z.infer<typeof zGetAnnotationListResponse>
|
||||
|
||||
export const zCreateAnnotationData = z.object({
|
||||
body: zCreateAnnotationRequest,
|
||||
path: z.never().optional(),
|
||||
query: z.never().optional(),
|
||||
})
|
||||
|
||||
export type CreateAnnotationDataZodType = z.infer<typeof zCreateAnnotationData>
|
||||
|
||||
/**
|
||||
* Annotation created successfully.
|
||||
*/
|
||||
export const zCreateAnnotationResponse = zAnnotationItem
|
||||
|
||||
export type CreateAnnotationResponseZodType = z.infer<typeof zCreateAnnotationResponse>
|
||||
|
||||
export const zDeleteAnnotationData = z.object({
|
||||
body: z.never().optional(),
|
||||
path: z.object({
|
||||
annotation_id: z.string().describe('Annotation ID.'),
|
||||
}),
|
||||
query: z.never().optional(),
|
||||
})
|
||||
|
||||
export type DeleteAnnotationDataZodType = z.infer<typeof zDeleteAnnotationData>
|
||||
|
||||
/**
|
||||
* Annotation deleted successfully. No Content.
|
||||
*/
|
||||
export const zDeleteAnnotationResponse = z.void().describe('Annotation deleted successfully. No Content.')
|
||||
|
||||
export type DeleteAnnotationResponseZodType = z.infer<typeof zDeleteAnnotationResponse>
|
||||
|
||||
export const zUpdateAnnotationData = z.object({
|
||||
body: zUpdateAnnotationRequest,
|
||||
path: z.object({
|
||||
annotation_id: z.string().describe('Annotation ID.'),
|
||||
}),
|
||||
query: z.never().optional(),
|
||||
})
|
||||
|
||||
export type UpdateAnnotationDataZodType = z.infer<typeof zUpdateAnnotationData>
|
||||
|
||||
/**
|
||||
* Annotation updated successfully.
|
||||
*/
|
||||
export const zUpdateAnnotationResponse = zAnnotationItem
|
||||
|
||||
export type UpdateAnnotationResponseZodType = z.infer<typeof zUpdateAnnotationResponse>
|
||||
|
||||
export const zInitialAnnotationReplySettingsData = z.object({
|
||||
body: zInitialAnnotationReplySettingsRequest,
|
||||
path: z.object({
|
||||
action: z.enum(['enable', 'disable']).describe('Action, can only be \'enable\' or \'disable\'.'),
|
||||
}),
|
||||
query: z.never().optional(),
|
||||
})
|
||||
|
||||
export type InitialAnnotationReplySettingsDataZodType = z.infer<typeof zInitialAnnotationReplySettingsData>
|
||||
|
||||
/**
|
||||
* Annotation reply settings task initiated.
|
||||
*/
|
||||
export const zInitialAnnotationReplySettingsResponse = zInitialAnnotationReplySettingsResponse2
|
||||
|
||||
export type InitialAnnotationReplySettingsResponseZodType = z.infer<typeof zInitialAnnotationReplySettingsResponse>
|
||||
|
||||
export const zGetInitialAnnotationReplySettingsStatusData = z.object({
|
||||
body: z.never().optional(),
|
||||
path: z.object({
|
||||
action: z.enum(['enable', 'disable']).describe('Action, must be the same as in the initial settings call (\'enable\' or \'disable\').'),
|
||||
job_id: z.string().describe('Job ID obtained from the initial settings call.'),
|
||||
}),
|
||||
query: z.never().optional(),
|
||||
})
|
||||
|
||||
export type GetInitialAnnotationReplySettingsStatusDataZodType = z.infer<typeof zGetInitialAnnotationReplySettingsStatusData>
|
||||
|
||||
/**
|
||||
* Successfully retrieved task status.
|
||||
*/
|
||||
export const zGetInitialAnnotationReplySettingsStatusResponse = zInitialAnnotationReplySettingsStatusResponse
|
||||
|
||||
export type GetInitialAnnotationReplySettingsStatusResponseZodType = z.infer<typeof zGetInitialAnnotationReplySettingsStatusResponse>
|
||||
20
web/gen/zod/api/audio-to-text.ts
Normal file
20
web/gen/zod/api/audio-to-text.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zAudioToTextRequest, zAudioToTextResponse as zAudioToTextResponse2 } from '../models/audio'
|
||||
|
||||
export const zAudioToTextData = z.object({
|
||||
body: zAudioToTextRequest,
|
||||
path: z.never().optional(),
|
||||
query: z.never().optional(),
|
||||
})
|
||||
|
||||
export type AudioToTextDataZodType = z.infer<typeof zAudioToTextData>
|
||||
|
||||
/**
|
||||
* Successfully converted audio to text.
|
||||
*/
|
||||
export const zAudioToTextResponse = zAudioToTextResponse2
|
||||
|
||||
export type AudioToTextResponseZodType = z.infer<typeof zAudioToTextResponse>
|
||||
43
web/gen/zod/api/chat-messages.ts
Normal file
43
web/gen/zod/api/chat-messages.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zChatCompletionResponse, zChatRequest } from '../models/chat'
|
||||
|
||||
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>
|
||||
89
web/gen/zod/api/conversations.ts
Normal file
89
web/gen/zod/api/conversations.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zConversationListItem, zConversationRenameRequest, zConversationVariablesResponse } from '../models/conversation'
|
||||
import { zConversationsListResponse } from '../models/conversations'
|
||||
|
||||
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>
|
||||
42
web/gen/zod/api/files.ts
Normal file
42
web/gen/zod/api/files.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zFileUploadResponse } from '../models/file'
|
||||
|
||||
export const zUploadChatFileData = z.object({
|
||||
body: z.object({
|
||||
file: z.string().describe('The file to be uploaded. Supported image types: png, jpg, jpeg, webp, gif.'),
|
||||
user: z.string().describe('User identifier, defined by the developer\'s rules, must be unique within the application. **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.'),
|
||||
}).describe('File upload request. Requires multipart/form-data.'),
|
||||
path: z.never().optional(),
|
||||
query: z.never().optional(),
|
||||
})
|
||||
|
||||
export type UploadChatFileDataZodType = z.infer<typeof zUploadChatFileData>
|
||||
|
||||
/**
|
||||
* File uploaded successfully.
|
||||
*/
|
||||
export const zUploadChatFileResponse = zFileUploadResponse
|
||||
|
||||
export type UploadChatFileResponseZodType = z.infer<typeof zUploadChatFileResponse>
|
||||
|
||||
export const zPreviewChatFileData = z.object({
|
||||
body: z.never().optional(),
|
||||
path: z.object({
|
||||
file_id: z.string().uuid().describe('The unique identifier of the file to preview, obtained from the File Upload API response.'),
|
||||
}),
|
||||
query: z.object({
|
||||
as_attachment: z.boolean().describe('Whether to force download the file as an attachment. Default is `false` (preview in browser).').optional().default(false),
|
||||
}).optional(),
|
||||
})
|
||||
|
||||
export type PreviewChatFileDataZodType = z.infer<typeof zPreviewChatFileData>
|
||||
|
||||
/**
|
||||
* File content returned successfully. Headers set based on file type and request parameters.
|
||||
*/
|
||||
export const zPreviewChatFileResponse = z.string().describe('File content returned successfully. Headers set based on file type and request parameters.')
|
||||
|
||||
export type PreviewChatFileResponseZodType = z.infer<typeof zPreviewChatFileResponse>
|
||||
20
web/gen/zod/api/info.ts
Normal file
20
web/gen/zod/api/info.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zAppInfoResponse } from '../models/app'
|
||||
|
||||
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>
|
||||
65
web/gen/zod/api/messages.ts
Normal file
65
web/gen/zod/api/messages.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zConversationHistoryResponse } from '../models/conversation'
|
||||
import { zMessageFeedbackRequest } from '../models/message'
|
||||
import { zSuggestedQuestionsResponse } from '../models/suggested'
|
||||
|
||||
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>
|
||||
20
web/gen/zod/api/meta.ts
Normal file
20
web/gen/zod/api/meta.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zAppMetaResponse } from '../models/app'
|
||||
|
||||
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>
|
||||
22
web/gen/zod/api/parameters.ts
Normal file
22
web/gen/zod/api/parameters.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zChatAppParametersResponse } from '../models/chat'
|
||||
|
||||
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>
|
||||
20
web/gen/zod/api/site.ts
Normal file
20
web/gen/zod/api/site.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zWebAppSettingsResponse } from '../models/web'
|
||||
|
||||
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>
|
||||
20
web/gen/zod/api/text-to-audio.ts
Normal file
20
web/gen/zod/api/text-to-audio.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zTextToAudioFormRequest } from '../models/text'
|
||||
|
||||
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>
|
||||
17
web/gen/zod/models/agent.ts
Normal file
17
web/gen/zod/models/agent.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zAgentThoughtItem = z.object({
|
||||
id: z.string().uuid().describe('Agent thought ID.').optional(),
|
||||
message_id: z.string().uuid().describe('Unique message ID this thought belongs to.').optional(),
|
||||
position: z.number().int().describe('Position of this thought.').optional(),
|
||||
thought: z.string().describe('What LLM is thinking.').optional(),
|
||||
tool: z.string().describe('Tools called, split by \';\'.').optional(),
|
||||
tool_input: z.string().describe('Input of tools in JSON format.').optional(),
|
||||
observation: z.string().describe('Response from tool calls.').optional(),
|
||||
files: z.array(z.string().uuid()).describe('File IDs related to this thought (from example, Markdown text says \'message_files\').').optional(),
|
||||
created_at: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).describe('Creation timestamp.').optional(),
|
||||
})
|
||||
|
||||
export type AgentThoughtItemZodType = z.infer<typeof zAgentThoughtItem>
|
||||
23
web/gen/zod/models/annotation.ts
Normal file
23
web/gen/zod/models/annotation.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zAnnotationItem = z.object({
|
||||
id: z.string().uuid().optional(),
|
||||
question: z.string().optional(),
|
||||
answer: z.string().optional(),
|
||||
hit_count: z.number().int().optional(),
|
||||
created_at: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(),
|
||||
})
|
||||
|
||||
export type AnnotationItemZodType = z.infer<typeof zAnnotationItem>
|
||||
|
||||
export const zAnnotationListResponse = z.object({
|
||||
data: z.array(zAnnotationItem).optional(),
|
||||
has_more: z.boolean().optional(),
|
||||
limit: z.number().int().optional(),
|
||||
total: z.number().int().optional(),
|
||||
page: z.number().int().optional(),
|
||||
})
|
||||
|
||||
export type AnnotationListResponseZodType = z.infer<typeof zAnnotationListResponse>
|
||||
29
web/gen/zod/models/app.ts
Normal file
29
web/gen/zod/models/app.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zFeedbackItem } from './feedback'
|
||||
import { zToolIconDetail } from './tool'
|
||||
|
||||
export const zAppFeedbacksResponse = z.object({
|
||||
data: z.array(zFeedbackItem).optional(),
|
||||
})
|
||||
|
||||
export type AppFeedbacksResponseZodType = z.infer<typeof zAppFeedbacksResponse>
|
||||
|
||||
export const zAppInfoResponse = z.object({
|
||||
name: z.string().optional(),
|
||||
description: z.string().optional(),
|
||||
tags: z.array(z.string()).optional(),
|
||||
})
|
||||
|
||||
export type AppInfoResponseZodType = z.infer<typeof zAppInfoResponse>
|
||||
|
||||
export const zAppMetaResponse = z.object({
|
||||
tool_icons: z.record(z.union([
|
||||
z.string().describe('URL of the icon.'),
|
||||
zToolIconDetail,
|
||||
])).describe('Tool icons. Keys are tool names.').optional(),
|
||||
})
|
||||
|
||||
export type AppMetaResponseZodType = z.infer<typeof zAppMetaResponse>
|
||||
16
web/gen/zod/models/audio.ts
Normal file
16
web/gen/zod/models/audio.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zAudioToTextRequest = z.object({
|
||||
file: z.string().describe('Audio file. Supported: mp3, mp4, mpeg, mpga, m4a, wav, webm. Limit: 15MB.'),
|
||||
user: z.string().describe('User identifier.'),
|
||||
})
|
||||
|
||||
export type AudioToTextRequestZodType = z.infer<typeof zAudioToTextRequest>
|
||||
|
||||
export const zAudioToTextResponse = z.object({
|
||||
text: z.string().describe('Output text from speech recognition.').optional(),
|
||||
})
|
||||
|
||||
export type AudioToTextResponseZodType = z.infer<typeof zAudioToTextResponse>
|
||||
80
web/gen/zod/models/chat.ts
Normal file
80
web/gen/zod/models/chat.ts
Normal file
@@ -0,0 +1,80 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zInputFileObject } from './input'
|
||||
import { zRetrieverResource } from './retriever'
|
||||
import { zUsage } from './usage'
|
||||
import { zUserInputFormItem } from './user'
|
||||
|
||||
export const zChatRequest = z.object({
|
||||
query: z.string().describe('User Input/Question content.'),
|
||||
inputs: z.record(z.unknown()).describe('Allows the entry of various variable values defined by the App. Contains key/value pairs. Default {}.').optional().default({}),
|
||||
response_mode: z.enum(['streaming', 'blocking']).describe('Mode of response return. `streaming` (recommended) uses SSE. `blocking` returns after completion (may be interrupted for long processes; not supported in Agent Assistant mode). Cloudflare timeout is 100s.').optional(),
|
||||
user: z.string().describe('User identifier, unique within the application. **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.'),
|
||||
conversation_id: z.string().describe('Conversation ID to continue a conversation. Pass the previous message\'s conversation_id.').optional(),
|
||||
files: z.array(zInputFileObject).describe('File list (images) for Vision-capable models.').optional(),
|
||||
auto_generate_name: z.boolean().describe('Auto-generate conversation title. Default `true`. If `false`, use conversation rename API with `auto_generate: true` for async title generation.').optional().default(true),
|
||||
})
|
||||
|
||||
export type ChatRequestZodType = z.infer<typeof zChatRequest>
|
||||
|
||||
/**
|
||||
* Response object for blocking mode chat completion.
|
||||
*/
|
||||
export const zChatCompletionResponse = z.object({
|
||||
event: z.string().describe('Event type, fixed as `message`.').optional(),
|
||||
task_id: z.string().uuid().describe('Task ID for request tracking and stop response API.').optional(),
|
||||
id: z.string().uuid().describe('Unique ID of this response/message event.').optional(),
|
||||
message_id: z.string().uuid().describe('Unique message ID.').optional(),
|
||||
conversation_id: z.string().uuid().describe('Conversation ID.').optional(),
|
||||
mode: z.string().describe('App mode, fixed as `chat`.').optional(),
|
||||
answer: z.string().describe('Complete response content.').optional(),
|
||||
metadata: z.object({
|
||||
usage: zUsage.optional(),
|
||||
retriever_resources: z.array(zRetrieverResource).optional(),
|
||||
}).optional(),
|
||||
created_at: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).describe('Message creation timestamp (Unix epoch seconds).').optional(),
|
||||
}).describe('Response object for blocking mode chat completion.')
|
||||
|
||||
export type ChatCompletionResponseZodType = z.infer<typeof zChatCompletionResponse>
|
||||
|
||||
export const zChatAppParametersResponse = z.object({
|
||||
opening_statement: z.string().optional(),
|
||||
suggested_questions: z.array(z.string()).optional(),
|
||||
suggested_questions_after_answer: z.object({
|
||||
enabled: z.boolean().optional(),
|
||||
}).optional(),
|
||||
speech_to_text: z.object({
|
||||
enabled: z.boolean().optional(),
|
||||
}).optional(),
|
||||
text_to_speech: z.object({
|
||||
enabled: z.boolean().optional(),
|
||||
voice: z.string().optional(),
|
||||
language: z.string().optional(),
|
||||
autoPlay: z.enum(['enabled', 'disabled']).optional(),
|
||||
}).optional(),
|
||||
retriever_resource: z.object({
|
||||
enabled: z.boolean().optional(),
|
||||
}).optional(),
|
||||
annotation_reply: z.object({
|
||||
enabled: z.boolean().optional(),
|
||||
}).optional(),
|
||||
user_input_form: z.array(zUserInputFormItem).optional(),
|
||||
file_upload: z.object({
|
||||
image: z.object({
|
||||
enabled: z.boolean().optional(),
|
||||
number_limits: z.number().int().optional(),
|
||||
detail: z.string().optional(),
|
||||
transfer_methods: z.array(z.enum(['remote_url', 'local_file'])).optional(),
|
||||
}).optional(),
|
||||
}).optional(),
|
||||
system_parameters: z.object({
|
||||
file_size_limit: z.number().int().optional(),
|
||||
image_file_size_limit: z.number().int().optional(),
|
||||
audio_file_size_limit: z.number().int().optional(),
|
||||
video_file_size_limit: z.number().int().optional(),
|
||||
}).optional(),
|
||||
})
|
||||
|
||||
export type ChatAppParametersResponseZodType = z.infer<typeof zChatAppParametersResponse>
|
||||
23
web/gen/zod/models/chunk.ts
Normal file
23
web/gen/zod/models/chunk.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
/**
|
||||
* Base schema for Server-Sent Event chunks in streaming mode.
|
||||
*/
|
||||
export const zChunkChatEvent = z.object({
|
||||
event: z.enum([
|
||||
'message',
|
||||
'agent_message',
|
||||
'tts_message',
|
||||
'tts_message_end',
|
||||
'agent_thought',
|
||||
'message_file',
|
||||
'message_end',
|
||||
'message_replace',
|
||||
'error',
|
||||
'ping',
|
||||
]).describe('The type of event.'),
|
||||
}).describe('Base schema for Server-Sent Event chunks in streaming mode.')
|
||||
|
||||
export type ChunkChatEventZodType = z.infer<typeof zChunkChatEvent>
|
||||
79
web/gen/zod/models/conversation.ts
Normal file
79
web/gen/zod/models/conversation.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zAgentThoughtItem } from './agent'
|
||||
import { zMessageFileItem } from './message'
|
||||
import { zRetrieverResource } from './retriever'
|
||||
|
||||
export const zConversationMessageItem = z.object({
|
||||
id: z.string().uuid().optional(),
|
||||
conversation_id: z.string().uuid().optional(),
|
||||
inputs: z.record(z.unknown()).optional(),
|
||||
query: z.string().optional(),
|
||||
answer: z.string().optional(),
|
||||
message_files: z.array(zMessageFileItem).optional(),
|
||||
feedback: z.union([
|
||||
z.object({
|
||||
rating: z.enum(['like', 'dislike']).optional(),
|
||||
}),
|
||||
z.null(),
|
||||
]).optional(),
|
||||
retriever_resources: z.array(zRetrieverResource).optional(),
|
||||
agent_thoughts: z.array(zAgentThoughtItem).optional(),
|
||||
created_at: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(),
|
||||
})
|
||||
|
||||
export type ConversationMessageItemZodType = z.infer<typeof zConversationMessageItem>
|
||||
|
||||
export const zConversationHistoryResponse = z.object({
|
||||
limit: z.number().int().optional(),
|
||||
has_more: z.boolean().optional(),
|
||||
data: z.array(zConversationMessageItem).optional(),
|
||||
})
|
||||
|
||||
export type ConversationHistoryResponseZodType = z.infer<typeof zConversationHistoryResponse>
|
||||
|
||||
export const zConversationListItem = z.object({
|
||||
id: z.string().uuid().optional(),
|
||||
name: z.string().optional(),
|
||||
inputs: z.record(z.unknown()).optional(),
|
||||
status: z.string().optional(),
|
||||
introduction: z.string().optional(),
|
||||
created_at: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(),
|
||||
updated_at: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(),
|
||||
})
|
||||
|
||||
export type ConversationListItemZodType = z.infer<typeof zConversationListItem>
|
||||
|
||||
export const zConversationRenameRequest = z.object({
|
||||
name: z.string().describe('(Optional) The name of the conversation. Omit if auto_generate is true.').optional(),
|
||||
auto_generate: z.boolean().describe('(Optional) Automatically generate the title. Default false.').optional().default(false),
|
||||
user: z.string().describe('The user identifier.'),
|
||||
})
|
||||
|
||||
export type ConversationRenameRequestZodType = z.infer<typeof zConversationRenameRequest>
|
||||
|
||||
export const zConversationRenameResponse = zConversationListItem
|
||||
|
||||
export type ConversationRenameResponseZodType = z.infer<typeof zConversationRenameResponse>
|
||||
|
||||
export const zConversationVariableItem = z.object({
|
||||
id: z.string().uuid().describe('Variable ID.').optional(),
|
||||
name: z.string().describe('Variable name.').optional(),
|
||||
value_type: z.string().describe('Variable type (string, number, object, json, etc.).').optional(),
|
||||
value: z.string().describe('Variable value (can be a JSON string for complex types).').optional(),
|
||||
description: z.string().describe('Variable description.').optional(),
|
||||
created_at: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).describe('Creation timestamp.').optional(),
|
||||
updated_at: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).describe('Last update timestamp.').optional(),
|
||||
})
|
||||
|
||||
export type ConversationVariableItemZodType = z.infer<typeof zConversationVariableItem>
|
||||
|
||||
export const zConversationVariablesResponse = z.object({
|
||||
limit: z.number().int().describe('Number of items per page.').optional(),
|
||||
has_more: z.boolean().describe('Whether there is a next page.').optional(),
|
||||
data: z.array(zConversationVariableItem).optional(),
|
||||
})
|
||||
|
||||
export type ConversationVariablesResponseZodType = z.infer<typeof zConversationVariablesResponse>
|
||||
13
web/gen/zod/models/conversations.ts
Normal file
13
web/gen/zod/models/conversations.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zConversationListItem } from './conversation'
|
||||
|
||||
export const zConversationsListResponse = z.object({
|
||||
limit: z.number().int().optional(),
|
||||
has_more: z.boolean().optional(),
|
||||
data: z.array(zConversationListItem).optional(),
|
||||
})
|
||||
|
||||
export type ConversationsListResponseZodType = z.infer<typeof zConversationsListResponse>
|
||||
10
web/gen/zod/models/create.ts
Normal file
10
web/gen/zod/models/create.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zCreateAnnotationRequest = z.object({
|
||||
question: z.string(),
|
||||
answer: z.string(),
|
||||
})
|
||||
|
||||
export type CreateAnnotationRequestZodType = z.infer<typeof zCreateAnnotationRequest>
|
||||
11
web/gen/zod/models/error.ts
Normal file
11
web/gen/zod/models/error.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zErrorResponse = z.object({
|
||||
status: z.number().int().optional(),
|
||||
code: z.string().optional(),
|
||||
message: z.string().optional(),
|
||||
})
|
||||
|
||||
export type ErrorResponseZodType = z.infer<typeof zErrorResponse>
|
||||
22
web/gen/zod/models/feedback.ts
Normal file
22
web/gen/zod/models/feedback.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zFeedbackItem = z.object({
|
||||
id: z.string().uuid().optional(),
|
||||
app_id: z.string().uuid().optional(),
|
||||
conversation_id: z.string().uuid().optional(),
|
||||
message_id: z.string().uuid().optional(),
|
||||
rating: z.enum(['like', 'dislike']).nullable().optional(),
|
||||
content: z.string().optional(),
|
||||
from_source: z.string().optional(),
|
||||
from_end_user_id: z.string().uuid().optional(),
|
||||
from_account_id: z.union([
|
||||
z.string().uuid(),
|
||||
z.null(),
|
||||
]).optional(),
|
||||
created_at: z.string().datetime().optional(),
|
||||
updated_at: z.string().datetime().optional(),
|
||||
})
|
||||
|
||||
export type FeedbackItemZodType = z.infer<typeof zFeedbackItem>
|
||||
15
web/gen/zod/models/file.ts
Normal file
15
web/gen/zod/models/file.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zFileUploadResponse = z.object({
|
||||
id: z.string().uuid().optional(),
|
||||
name: z.string().optional(),
|
||||
size: z.number().int().optional(),
|
||||
extension: z.string().optional(),
|
||||
mime_type: z.string().optional(),
|
||||
created_by: z.string().uuid().optional(),
|
||||
created_at: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(),
|
||||
})
|
||||
|
||||
export type FileUploadResponseZodType = z.infer<typeof zFileUploadResponse>
|
||||
29
web/gen/zod/models/initial.ts
Normal file
29
web/gen/zod/models/initial.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zInitialAnnotationReplySettingsRequest = z.object({
|
||||
embedding_provider_name: z.string().describe('Specified embedding model provider name (Optional).').optional(),
|
||||
embedding_model_name: z.string().describe('Specified embedding model name (Optional).').optional(),
|
||||
score_threshold: z.number().describe('Similarity threshold for matching annotated replies.'),
|
||||
})
|
||||
|
||||
export type InitialAnnotationReplySettingsRequestZodType = z.infer<typeof zInitialAnnotationReplySettingsRequest>
|
||||
|
||||
export const zInitialAnnotationReplySettingsResponse = z.object({
|
||||
job_id: z.string().uuid().optional(),
|
||||
job_status: z.string().optional(),
|
||||
})
|
||||
|
||||
export type InitialAnnotationReplySettingsResponseZodType = z.infer<typeof zInitialAnnotationReplySettingsResponse>
|
||||
|
||||
export const zInitialAnnotationReplySettingsStatusResponse = z.object({
|
||||
job_id: z.string().uuid().optional(),
|
||||
job_status: z.string().optional(),
|
||||
error_msg: z.union([
|
||||
z.string(),
|
||||
z.null(),
|
||||
]).optional(),
|
||||
})
|
||||
|
||||
export type InitialAnnotationReplySettingsStatusResponseZodType = z.infer<typeof zInitialAnnotationReplySettingsStatusResponse>
|
||||
21
web/gen/zod/models/input.ts
Normal file
21
web/gen/zod/models/input.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zInputFileObject = z.intersection(z.union([
|
||||
z.object({
|
||||
transfer_method: z.enum(['remote_url']).optional(),
|
||||
url: z.string(),
|
||||
}),
|
||||
z.object({
|
||||
transfer_method: z.enum(['local_file']).optional(),
|
||||
upload_file_id: z.string(),
|
||||
}),
|
||||
]), z.object({
|
||||
type: z.enum(['image']).describe('Supported type: `image`.'),
|
||||
transfer_method: z.enum(['remote_url', 'local_file']).describe('Transfer method, `remote_url` for image URL / `local_file` for file upload'),
|
||||
url: z.string().describe('Image URL (when the transfer method is `remote_url`)').optional(),
|
||||
upload_file_id: z.string().describe('Uploaded file ID, which must be obtained by uploading through the File Upload API in advance (when the transfer method is `local_file`)').optional(),
|
||||
}))
|
||||
|
||||
export type InputFileObjectZodType = z.infer<typeof zInputFileObject>
|
||||
20
web/gen/zod/models/message.ts
Normal file
20
web/gen/zod/models/message.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zMessageFeedbackRequest = z.object({
|
||||
rating: z.enum(['like', 'dislike']).nullable().optional(),
|
||||
user: z.string(),
|
||||
content: z.string().optional(),
|
||||
})
|
||||
|
||||
export type MessageFeedbackRequestZodType = z.infer<typeof zMessageFeedbackRequest>
|
||||
|
||||
export const zMessageFileItem = z.object({
|
||||
id: z.string().uuid().optional(),
|
||||
type: z.string().describe('File type, e.g., \'image\'.').optional(),
|
||||
url: z.string().describe('Preview image URL.').optional(),
|
||||
belongs_to: z.enum(['user', 'assistant']).describe('Who this file belongs to.').optional(),
|
||||
})
|
||||
|
||||
export type MessageFileItemZodType = z.infer<typeof zMessageFileItem>
|
||||
18
web/gen/zod/models/paragraph.ts
Normal file
18
web/gen/zod/models/paragraph.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zParagraphControl = z.object({
|
||||
label: z.string(),
|
||||
variable: z.string(),
|
||||
required: z.boolean(),
|
||||
default: z.string().optional(),
|
||||
})
|
||||
|
||||
export type ParagraphControlZodType = z.infer<typeof zParagraphControl>
|
||||
|
||||
export const zParagraphControlWrapper = z.object({
|
||||
paragraph: zParagraphControl,
|
||||
})
|
||||
|
||||
export type ParagraphControlWrapperZodType = z.infer<typeof zParagraphControlWrapper>
|
||||
19
web/gen/zod/models/retriever.ts
Normal file
19
web/gen/zod/models/retriever.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
/**
|
||||
* Citation and Attribution information for a resource.
|
||||
*/
|
||||
export const zRetrieverResource = z.object({
|
||||
position: z.number().int().describe('Position of the resource in the list.').optional(),
|
||||
dataset_id: z.string().uuid().describe('ID of the dataset.').optional(),
|
||||
dataset_name: z.string().describe('Name of the dataset.').optional(),
|
||||
document_id: z.string().uuid().describe('ID of the document.').optional(),
|
||||
document_name: z.string().describe('Name of the document.').optional(),
|
||||
segment_id: z.string().uuid().describe('ID of the specific segment within the document.').optional(),
|
||||
score: z.number().describe('Relevance score of the resource.').optional(),
|
||||
content: z.string().describe('Content snippet from the resource.').optional(),
|
||||
}).describe('Citation and Attribution information for a resource.')
|
||||
|
||||
export type RetrieverResourceZodType = z.infer<typeof zRetrieverResource>
|
||||
19
web/gen/zod/models/select.ts
Normal file
19
web/gen/zod/models/select.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zSelectControl = z.object({
|
||||
label: z.string(),
|
||||
variable: z.string(),
|
||||
required: z.boolean(),
|
||||
default: z.string().optional(),
|
||||
options: z.array(z.string()),
|
||||
})
|
||||
|
||||
export type SelectControlZodType = z.infer<typeof zSelectControl>
|
||||
|
||||
export const zSelectControlWrapper = z.object({
|
||||
select: zSelectControl,
|
||||
})
|
||||
|
||||
export type SelectControlWrapperZodType = z.infer<typeof zSelectControlWrapper>
|
||||
100
web/gen/zod/models/stream.ts
Normal file
100
web/gen/zod/models/stream.ts
Normal file
@@ -0,0 +1,100 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zChunkChatEvent } from './chunk'
|
||||
import { zRetrieverResource } from './retriever'
|
||||
import { zUsage } from './usage'
|
||||
|
||||
export const zStreamEventBase = z.object({
|
||||
task_id: z.string().uuid().describe('Task ID.').optional(),
|
||||
message_id: z.string().uuid().describe('Unique message ID.').optional(),
|
||||
conversation_id: z.string().uuid().describe('Conversation ID.').optional(),
|
||||
created_at: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).describe('Creation timestamp.').optional(),
|
||||
})
|
||||
|
||||
export type StreamEventBaseZodType = z.infer<typeof zStreamEventBase>
|
||||
|
||||
export const zStreamEventChatMessage = zChunkChatEvent.and(zStreamEventBase).and(z.object({
|
||||
answer: z.string().describe('LLM returned text chunk.'),
|
||||
event: z.literal('message'),
|
||||
}))
|
||||
|
||||
export type StreamEventChatMessageZodType = z.infer<typeof zStreamEventChatMessage>
|
||||
|
||||
export const zStreamEventChatAgentMessage = zChunkChatEvent.and(zStreamEventBase).and(z.object({
|
||||
answer: z.string().describe('LLM returned text chunk (Agent mode).'),
|
||||
event: z.literal('agent_message'),
|
||||
}))
|
||||
|
||||
export type StreamEventChatAgentMessageZodType = z.infer<typeof zStreamEventChatAgentMessage>
|
||||
|
||||
export const zStreamEventChatTtsMessage = zChunkChatEvent.and(zStreamEventBase).and(z.object({
|
||||
audio: z.string().describe('Base64 encoded audio chunk.'),
|
||||
event: z.literal('tts_message'),
|
||||
}).describe('TTS audio stream event (base64 encoded Mp3). Available if auto-play enabled.'))
|
||||
|
||||
export type StreamEventChatTtsMessageZodType = z.infer<typeof zStreamEventChatTtsMessage>
|
||||
|
||||
export const zStreamEventChatTtsMessageEnd = zChunkChatEvent.and(zStreamEventBase).and(z.object({
|
||||
audio: z.string().describe('Empty string for end event.'),
|
||||
event: z.literal('tts_message_end'),
|
||||
}).describe('TTS audio stream end event.'))
|
||||
|
||||
export type StreamEventChatTtsMessageEndZodType = z.infer<typeof zStreamEventChatTtsMessageEnd>
|
||||
|
||||
export const zStreamEventChatAgentThought = zChunkChatEvent.and(zStreamEventBase).and(z.object({
|
||||
id: z.string().uuid().describe('Agent thought ID.'),
|
||||
position: z.number().int().describe('Position of this thought in the sequence for the message.'),
|
||||
thought: z.string().describe('What LLM is thinking.').optional(),
|
||||
observation: z.string().describe('Response from tool calls.').optional(),
|
||||
tool: z.string().describe('List of tools called, split by \';\'.').optional(),
|
||||
tool_input: z.string().describe('Input of tools in JSON format. Example: {"dalle3": {"prompt": "a cute cat"}}.').optional(),
|
||||
message_files: z.array(z.string().uuid()).describe('File IDs of files related to this thought (e.g., generated by a tool).').optional(),
|
||||
event: z.literal('agent_thought'),
|
||||
}).describe('Agent thought, LLM thinking, tool call details (Agent mode).'))
|
||||
|
||||
export type StreamEventChatAgentThoughtZodType = z.infer<typeof zStreamEventChatAgentThought>
|
||||
|
||||
export const zStreamEventChatMessageFile = zChunkChatEvent.and(z.object({
|
||||
id: z.string().uuid().describe('File unique ID.'),
|
||||
type: z.enum(['image']).describe('File type, currently only \'image\'.'),
|
||||
belongs_to: z.enum(['assistant']).describe('Who this file belongs to, always \'assistant\' here.'),
|
||||
url: z.string().describe('Remote URL of the file.'),
|
||||
conversation_id: z.string().uuid().describe('Conversation ID.'),
|
||||
event: z.literal('message_file'),
|
||||
}).describe('Message file event, a new file created by a tool.'))
|
||||
|
||||
export type StreamEventChatMessageFileZodType = z.infer<typeof zStreamEventChatMessageFile>
|
||||
|
||||
export const zStreamEventChatMessageReplace = zChunkChatEvent.and(zStreamEventBase).and(z.object({
|
||||
answer: z.string().describe('Replacement content.'),
|
||||
event: z.literal('message_replace'),
|
||||
}).describe('Message content replacement event (e.g., due to content moderation).'))
|
||||
|
||||
export type StreamEventChatMessageReplaceZodType = z.infer<typeof zStreamEventChatMessageReplace>
|
||||
|
||||
export const zStreamEventChatError = zChunkChatEvent.and(zStreamEventBase).and(z.object({
|
||||
status: z.number().int().describe('HTTP status code.'),
|
||||
code: z.string().describe('Error code.'),
|
||||
message: z.string().describe('Error message.'),
|
||||
event: z.literal('error'),
|
||||
}).describe('Error event during streaming.'))
|
||||
|
||||
export type StreamEventChatErrorZodType = z.infer<typeof zStreamEventChatError>
|
||||
|
||||
export const zStreamEventChatPing = zChunkChatEvent.and(z.object({
|
||||
event: z.literal('ping'),
|
||||
}).describe('Ping event to keep connection alive.'))
|
||||
|
||||
export type StreamEventChatPingZodType = z.infer<typeof zStreamEventChatPing>
|
||||
|
||||
export const zStreamEventChatMessageEnd = zChunkChatEvent.and(zStreamEventBase).and(z.object({
|
||||
metadata: z.object({
|
||||
usage: zUsage.optional(),
|
||||
retriever_resources: z.array(zRetrieverResource).optional(),
|
||||
}),
|
||||
event: z.literal('message_end'),
|
||||
}).describe('Message end event, streaming has ended.'))
|
||||
|
||||
export type StreamEventChatMessageEndZodType = z.infer<typeof zStreamEventChatMessageEnd>
|
||||
10
web/gen/zod/models/suggested.ts
Normal file
10
web/gen/zod/models/suggested.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zSuggestedQuestionsResponse = z.object({
|
||||
result: z.string().optional(),
|
||||
data: z.array(z.string()).optional(),
|
||||
})
|
||||
|
||||
export type SuggestedQuestionsResponseZodType = z.infer<typeof zSuggestedQuestionsResponse>
|
||||
29
web/gen/zod/models/text.ts
Normal file
29
web/gen/zod/models/text.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
/**
|
||||
* Requires `user`. Provide either `message_id` or `text`.
|
||||
*/
|
||||
export const zTextToAudioFormRequest = z.object({
|
||||
message_id: z.string().uuid().describe('Message ID (priority if both text and message_id provided).').optional(),
|
||||
text: z.string().describe('Speech content.').optional(),
|
||||
user: z.string().describe('User identifier.'),
|
||||
}).describe('Requires `user`. Provide either `message_id` or `text`.')
|
||||
|
||||
export type TextToAudioFormRequestZodType = z.infer<typeof zTextToAudioFormRequest>
|
||||
|
||||
export const zTextInputControl = z.object({
|
||||
label: z.string(),
|
||||
variable: z.string(),
|
||||
required: z.boolean(),
|
||||
default: z.string().optional(),
|
||||
})
|
||||
|
||||
export type TextInputControlZodType = z.infer<typeof zTextInputControl>
|
||||
|
||||
export const zTextInputControlWrapper = z.object({
|
||||
'text-input': zTextInputControl,
|
||||
})
|
||||
|
||||
export type TextInputControlWrapperZodType = z.infer<typeof zTextInputControlWrapper>
|
||||
10
web/gen/zod/models/tool.ts
Normal file
10
web/gen/zod/models/tool.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zToolIconDetail = z.object({
|
||||
background: z.string().describe('Background color in hex format.').optional(),
|
||||
content: z.string().describe('Emoji content.').optional(),
|
||||
})
|
||||
|
||||
export type ToolIconDetailZodType = z.infer<typeof zToolIconDetail>
|
||||
10
web/gen/zod/models/update.ts
Normal file
10
web/gen/zod/models/update.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zUpdateAnnotationRequest = z.object({
|
||||
question: z.string(),
|
||||
answer: z.string(),
|
||||
})
|
||||
|
||||
export type UpdateAnnotationRequestZodType = z.infer<typeof zUpdateAnnotationRequest>
|
||||
23
web/gen/zod/models/usage.ts
Normal file
23
web/gen/zod/models/usage.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
/**
|
||||
* Model usage information.
|
||||
*/
|
||||
export const zUsage = z.object({
|
||||
prompt_tokens: z.number().int().optional(),
|
||||
prompt_unit_price: z.string().optional(),
|
||||
prompt_price_unit: z.string().optional(),
|
||||
prompt_price: z.string().optional(),
|
||||
completion_tokens: z.number().int().optional(),
|
||||
completion_unit_price: z.string().optional(),
|
||||
completion_price_unit: z.string().optional(),
|
||||
completion_price: z.string().optional(),
|
||||
total_tokens: z.number().int().optional(),
|
||||
total_price: z.string().optional(),
|
||||
currency: z.string().optional(),
|
||||
latency: z.number().optional(),
|
||||
}).describe('Model usage information.')
|
||||
|
||||
export type UsageZodType = z.infer<typeof zUsage>
|
||||
15
web/gen/zod/models/user.ts
Normal file
15
web/gen/zod/models/user.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
import { zParagraphControlWrapper } from './paragraph'
|
||||
import { zSelectControlWrapper } from './select'
|
||||
import { zTextInputControlWrapper } from './text'
|
||||
|
||||
export const zUserInputFormItem = z.union([
|
||||
zTextInputControlWrapper,
|
||||
zParagraphControlWrapper,
|
||||
zSelectControlWrapper,
|
||||
])
|
||||
|
||||
export type UserInputFormItemZodType = z.infer<typeof zUserInputFormItem>
|
||||
25
web/gen/zod/models/web.ts
Normal file
25
web/gen/zod/models/web.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { z } from 'zod'
|
||||
|
||||
export const zWebAppSettingsResponse = z.object({
|
||||
title: z.string().optional(),
|
||||
chat_color_theme: z.string().optional(),
|
||||
chat_color_theme_inverted: z.boolean().optional(),
|
||||
icon_type: z.enum(['emoji', 'image']).optional(),
|
||||
icon: z.string().optional(),
|
||||
icon_background: z.string().optional(),
|
||||
icon_url: z.union([
|
||||
z.string(),
|
||||
z.null(),
|
||||
]).optional(),
|
||||
description: z.string().optional(),
|
||||
copyright: z.string().optional(),
|
||||
privacy_policy: z.string().optional(),
|
||||
custom_disclaimer: z.string().optional(),
|
||||
default_language: z.string().optional(),
|
||||
show_workflow_steps: z.boolean().optional(),
|
||||
use_icon_as_answer_icon: z.boolean().optional(),
|
||||
})
|
||||
|
||||
export type WebAppSettingsResponseZodType = z.infer<typeof zWebAppSettingsResponse>
|
||||
128
web/openapi-ts.config.ts
Normal file
128
web/openapi-ts.config.ts
Normal file
@@ -0,0 +1,128 @@
|
||||
import type { UserConfig } from '@hey-api/openapi-ts'
|
||||
import { defineConfig } from '@hey-api/openapi-ts'
|
||||
|
||||
import { defineConfig as defineOrpcConfig } from './plugins/hey-api-orpc/config'
|
||||
|
||||
const split = false
|
||||
|
||||
// Symbol type for the getFilePath hook (not publicly exported by hey-api)
|
||||
type SymbolMeta = Record<string, unknown> & {
|
||||
tags?: readonly string[]
|
||||
tool?: string
|
||||
resource?: string
|
||||
pluginName?: string
|
||||
path?: readonly (string | number)[]
|
||||
}
|
||||
|
||||
// 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]
|
||||
}
|
||||
|
||||
// Extract schema name prefix from path array
|
||||
// e.g., ["components", "schemas", "ChatRequest"] → "chat"
|
||||
// e.g., ["components", "schemas", "StreamEventBase"] → "stream"
|
||||
// e.g., ["components", "schemas", "ErrorResponse"] → "error"
|
||||
function getSchemaPrefix(path: readonly (string | number)[] | undefined): string | undefined {
|
||||
if (!path || path[0] !== 'components' || path[1] !== 'schemas')
|
||||
return undefined
|
||||
const schemaName = path[2]
|
||||
if (typeof schemaName !== 'string')
|
||||
return undefined
|
||||
// Split PascalCase into words and take the first word
|
||||
// e.g., "ChatRequest" → ["Chat", "Request"] → "chat"
|
||||
const match = schemaName.match(/^[A-Z][a-z]*/)
|
||||
return match?.[0]?.toLowerCase()
|
||||
}
|
||||
|
||||
// Get file path based on symbol metadata (mixed strategy)
|
||||
function getFilePath(symbol: { meta?: SymbolMeta }): string | undefined {
|
||||
const meta = symbol.meta
|
||||
if (!meta)
|
||||
return undefined
|
||||
|
||||
// Handle typescript plugin symbols
|
||||
if (meta.tool === 'typescript') {
|
||||
if (meta.resource === 'definition') {
|
||||
const prefix = getSchemaPrefix(meta.path)
|
||||
return `types/models/${prefix ?? 'common'}`
|
||||
}
|
||||
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') {
|
||||
if (meta.resource === 'definition') {
|
||||
const prefix = getSchemaPrefix(meta.path)
|
||||
return `zod/models/${prefix ?? 'common'}`
|
||||
}
|
||||
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') {
|
||||
if (meta.resource === 'router') {
|
||||
return 'orpc/router'
|
||||
}
|
||||
if (meta.resource === 'operation') {
|
||||
const segment = getApiSegment(meta.path)
|
||||
return `orpc/api/${segment ?? 'common'}`
|
||||
}
|
||||
return 'orpc/common'
|
||||
}
|
||||
|
||||
return undefined
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
input: './openapi_chat.json',
|
||||
output: {
|
||||
indexFile: false,
|
||||
path: './gen',
|
||||
fileName: {
|
||||
suffix: null,
|
||||
},
|
||||
clean: false,
|
||||
},
|
||||
plugins: [
|
||||
'@hey-api/typescript',
|
||||
{
|
||||
name: 'zod',
|
||||
requests: true,
|
||||
responses: true,
|
||||
metadata: true,
|
||||
definitions: true,
|
||||
types: {
|
||||
infer: true,
|
||||
},
|
||||
},
|
||||
defineOrpcConfig({
|
||||
output: 'orpc',
|
||||
}),
|
||||
],
|
||||
parser: split
|
||||
? {
|
||||
hooks: {
|
||||
symbols: {
|
||||
getFilePath,
|
||||
},
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
} satisfies UserConfig)
|
||||
1935
web/openapi_chat.json
Normal file
1935
web/openapi_chat.json
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user