// This file is auto-generated by @hey-api/openapi-ts import { oc } from '@orpc/contract' import * as z from 'zod' import { zDeleteAppsAnnotationsByAnnotationIdPath, zDeleteAppsAnnotationsByAnnotationIdResponse, zDeleteConversationsByCIdBody, zDeleteConversationsByCIdPath, zDeleteConversationsByCIdResponse, zDeleteDatasetsByDatasetIdDocumentsByDocumentIdPath, zDeleteDatasetsByDatasetIdDocumentsByDocumentIdResponse, zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath, zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse, zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath, zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse, zDeleteDatasetsByDatasetIdMetadataByMetadataIdPath, zDeleteDatasetsByDatasetIdMetadataByMetadataIdResponse, zDeleteDatasetsByDatasetIdPath, zDeleteDatasetsByDatasetIdResponse, zDeleteDatasetsTagsBody, zDeleteDatasetsTagsResponse, zGetAppFeedbacksQuery, zGetAppFeedbacksResponse, zGetAppsAnnotationReplyByActionStatusByJobIdPath, zGetAppsAnnotationReplyByActionStatusByJobIdResponse, zGetAppsAnnotationsQuery, zGetAppsAnnotationsResponse, zGetConversationsByCIdVariablesPath, zGetConversationsByCIdVariablesQuery, zGetConversationsByCIdVariablesResponse, zGetConversationsQuery, zGetConversationsResponse, zGetDatasetsByDatasetIdDocumentsByBatchIndexingStatusPath, zGetDatasetsByDatasetIdDocumentsByBatchIndexingStatusResponse, zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadPath, zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadResponse, zGetDatasetsByDatasetIdDocumentsByDocumentIdPath, zGetDatasetsByDatasetIdDocumentsByDocumentIdQuery, zGetDatasetsByDatasetIdDocumentsByDocumentIdResponse, zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksPath, zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksQuery, zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse, zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath, zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse, zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsPath, zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsQuery, zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponse, zGetDatasetsByDatasetIdDocumentsPath, zGetDatasetsByDatasetIdDocumentsQuery, zGetDatasetsByDatasetIdDocumentsResponse, zGetDatasetsByDatasetIdMetadataBuiltInPath, zGetDatasetsByDatasetIdMetadataBuiltInResponse, zGetDatasetsByDatasetIdMetadataPath, zGetDatasetsByDatasetIdMetadataResponse, zGetDatasetsByDatasetIdPath, zGetDatasetsByDatasetIdPipelineDatasourcePluginsPath, zGetDatasetsByDatasetIdPipelineDatasourcePluginsQuery, zGetDatasetsByDatasetIdPipelineDatasourcePluginsResponse, zGetDatasetsByDatasetIdResponse, zGetDatasetsByDatasetIdTagsPath, zGetDatasetsByDatasetIdTagsResponse, zGetDatasetsQuery, zGetDatasetsResponse, zGetDatasetsTagsResponse, zGetEndUsersByEndUserIdPath, zGetEndUsersByEndUserIdResponse, zGetFilesByFileIdPreviewPath, zGetFilesByFileIdPreviewQuery, zGetFilesByFileIdPreviewResponse, zGetFormHumanInputByFormTokenPath, zGetFormHumanInputByFormTokenResponse, zGetInfoResponse, zGetMessagesByMessageIdSuggestedPath, zGetMessagesByMessageIdSuggestedQuery, zGetMessagesByMessageIdSuggestedResponse, zGetMessagesQuery, zGetMessagesResponse, zGetMetaResponse, zGetParametersResponse, zGetRootResponse, zGetSiteResponse, zGetWorkflowByTaskIdEventsPath, zGetWorkflowByTaskIdEventsQuery, zGetWorkflowByTaskIdEventsResponse, zGetWorkflowsLogsQuery, zGetWorkflowsLogsResponse, zGetWorkflowsRunByWorkflowRunIdPath, zGetWorkflowsRunByWorkflowRunIdResponse, zGetWorkspacesCurrentModelsModelTypesByModelTypePath, zGetWorkspacesCurrentModelsModelTypesByModelTypeResponse, zPatchDatasetsByDatasetIdBody, zPatchDatasetsByDatasetIdDocumentsByDocumentIdBody, zPatchDatasetsByDatasetIdDocumentsByDocumentIdPath, zPatchDatasetsByDatasetIdDocumentsByDocumentIdResponse, zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdBody, zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath, zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse, zPatchDatasetsByDatasetIdDocumentsStatusByActionBody, zPatchDatasetsByDatasetIdDocumentsStatusByActionPath, zPatchDatasetsByDatasetIdDocumentsStatusByActionResponse, zPatchDatasetsByDatasetIdMetadataByMetadataIdBody, zPatchDatasetsByDatasetIdMetadataByMetadataIdPath, zPatchDatasetsByDatasetIdMetadataByMetadataIdResponse, zPatchDatasetsByDatasetIdPath, zPatchDatasetsByDatasetIdResponse, zPatchDatasetsTagsBody, zPatchDatasetsTagsResponse, zPostAppsAnnotationReplyByActionBody, zPostAppsAnnotationReplyByActionPath, zPostAppsAnnotationReplyByActionResponse, zPostAppsAnnotationsBody, zPostAppsAnnotationsResponse, zPostAudioToTextBody, zPostAudioToTextResponse, zPostChatMessagesBody, zPostChatMessagesByTaskIdStopBody, zPostChatMessagesByTaskIdStopPath, zPostChatMessagesByTaskIdStopResponse, zPostChatMessagesResponse, zPostCompletionMessagesBody, zPostCompletionMessagesByTaskIdStopBody, zPostCompletionMessagesByTaskIdStopPath, zPostCompletionMessagesByTaskIdStopResponse, zPostCompletionMessagesResponse, zPostConversationsByCIdNameBody, zPostConversationsByCIdNamePath, zPostConversationsByCIdNameResponse, zPostDatasetsBody, zPostDatasetsByDatasetIdDocumentCreateByFile2Body, zPostDatasetsByDatasetIdDocumentCreateByFile2Path, zPostDatasetsByDatasetIdDocumentCreateByFile2Response, zPostDatasetsByDatasetIdDocumentCreateByFileBody, zPostDatasetsByDatasetIdDocumentCreateByFilePath, zPostDatasetsByDatasetIdDocumentCreateByFileResponse, zPostDatasetsByDatasetIdDocumentCreateByText2Body, zPostDatasetsByDatasetIdDocumentCreateByText2Path, zPostDatasetsByDatasetIdDocumentCreateByText2Response, zPostDatasetsByDatasetIdDocumentCreateByTextBody, zPostDatasetsByDatasetIdDocumentCreateByTextPath, zPostDatasetsByDatasetIdDocumentCreateByTextResponse, zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBody, zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdBody, zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksBody, zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksPath, zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse, zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath, zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse, zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsPath, zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponse, zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Body, zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Path, zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Response, zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFileBody, zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFilePath, zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFileResponse, zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Body, zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Path, zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Response, zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextBody, zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextPath, zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextResponse, zPostDatasetsByDatasetIdDocumentsDownloadZipBody, zPostDatasetsByDatasetIdDocumentsDownloadZipPath, zPostDatasetsByDatasetIdDocumentsDownloadZipResponse, zPostDatasetsByDatasetIdDocumentsMetadataBody, zPostDatasetsByDatasetIdDocumentsMetadataPath, zPostDatasetsByDatasetIdDocumentsMetadataResponse, zPostDatasetsByDatasetIdHitTestingBody, zPostDatasetsByDatasetIdHitTestingPath, zPostDatasetsByDatasetIdHitTestingResponse, zPostDatasetsByDatasetIdMetadataBody, zPostDatasetsByDatasetIdMetadataBuiltInByActionPath, zPostDatasetsByDatasetIdMetadataBuiltInByActionResponse, zPostDatasetsByDatasetIdMetadataPath, zPostDatasetsByDatasetIdMetadataResponse, zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunBody, zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunPath, zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunResponse, zPostDatasetsByDatasetIdPipelineRunBody, zPostDatasetsByDatasetIdPipelineRunPath, zPostDatasetsByDatasetIdPipelineRunResponse, zPostDatasetsByDatasetIdRetrieveBody, zPostDatasetsByDatasetIdRetrievePath, zPostDatasetsByDatasetIdRetrieveResponse, zPostDatasetsPipelineFileUploadBody, zPostDatasetsPipelineFileUploadResponse, zPostDatasetsResponse, zPostDatasetsTagsBindingBody, zPostDatasetsTagsBindingResponse, zPostDatasetsTagsBody, zPostDatasetsTagsResponse, zPostDatasetsTagsUnbindingBody, zPostDatasetsTagsUnbindingResponse, zPostFilesUploadBody, zPostFilesUploadResponse, zPostFormHumanInputByFormTokenBody, zPostFormHumanInputByFormTokenPath, zPostFormHumanInputByFormTokenResponse, zPostMessagesByMessageIdFeedbacksBody, zPostMessagesByMessageIdFeedbacksPath, zPostMessagesByMessageIdFeedbacksResponse, zPostTextToAudioBody, zPostTextToAudioResponse, zPostWorkflowsByWorkflowIdRunBody, zPostWorkflowsByWorkflowIdRunPath, zPostWorkflowsByWorkflowIdRunResponse, zPostWorkflowsRunBody, zPostWorkflowsRunResponse, zPostWorkflowsTasksByTaskIdStopBody, zPostWorkflowsTasksByTaskIdStopPath, zPostWorkflowsTasksByTaskIdStopResponse, zPutAppsAnnotationsByAnnotationIdBody, zPutAppsAnnotationsByAnnotationIdPath, zPutAppsAnnotationsByAnnotationIdResponse, zPutConversationsByCIdVariablesByVariableIdBody, zPutConversationsByCIdVariablesByVariableIdPath, zPutConversationsByCIdVariablesByVariableIdResponse, } from './zod.gen' export const get = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getRoot', path: '/', tags: ['service_api'], }) .output(zGetRootResponse) export const root = { get, } /** * List App Feedbacks * * Retrieve a paginated list of all feedback submitted for messages in this application, including both end-user and admin feedback. */ export const get2 = oc .route({ description: 'Retrieve a paginated list of all feedback submitted for messages in this application, including both end-user and admin feedback.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppFeedbacks', path: '/app/feedbacks', summary: 'List App Feedbacks', tags: ['Feedback'], }) .input(z.object({ query: zGetAppFeedbacksQuery.optional() })) .output(zGetAppFeedbacksResponse) export const feedbacks = { get: get2, } export const app = { feedbacks, } /** * Get Annotation Reply Job Status * * Retrieves the status of an asynchronous annotation reply configuration job started by [Configure Annotation Reply](/api-reference/annotations/configure-annotation-reply). */ export const get3 = oc .route({ description: 'Retrieves the status of an asynchronous annotation reply configuration job started by [Configure Annotation Reply](/api-reference/annotations/configure-annotation-reply).', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsAnnotationReplyByActionStatusByJobId', path: '/apps/annotation-reply/{action}/status/{job_id}', summary: 'Get Annotation Reply Job Status', tags: ['Annotations'], }) .input(z.object({ params: zGetAppsAnnotationReplyByActionStatusByJobIdPath })) .output(zGetAppsAnnotationReplyByActionStatusByJobIdResponse) export const byJobId = { get: get3, } export const status = { byJobId, } /** * Configure Annotation Reply * * Enables or disables the annotation reply feature. Requires embedding model configuration when enabling. Executes asynchronously — use [Get Annotation Reply Job Status](/api-reference/annotations/get-annotation-reply-job-status) to track progress. */ export const post = oc .route({ description: 'Enables or disables the annotation reply feature. Requires embedding model configuration when enabling. Executes asynchronously — use [Get Annotation Reply Job Status](/api-reference/annotations/get-annotation-reply-job-status) to track progress.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsAnnotationReplyByAction', path: '/apps/annotation-reply/{action}', summary: 'Configure Annotation Reply', tags: ['Annotations'], }) .input( z.object({ body: zPostAppsAnnotationReplyByActionBody, params: zPostAppsAnnotationReplyByActionPath, }), ) .output(zPostAppsAnnotationReplyByActionResponse) export const byAction = { post, status, } export const annotationReply = { byAction, } /** * Delete Annotation * * Deletes an annotation and its associated hit history. */ export const delete_ = oc .route({ description: 'Deletes an annotation and its associated hit history.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteAppsAnnotationsByAnnotationId', path: '/apps/annotations/{annotation_id}', successStatus: 204, summary: 'Delete Annotation', tags: ['Annotations'], }) .input(z.object({ params: zDeleteAppsAnnotationsByAnnotationIdPath })) .output(zDeleteAppsAnnotationsByAnnotationIdResponse) /** * Update Annotation * * Updates the question and answer of an existing annotation. */ export const put = oc .route({ description: 'Updates the question and answer of an existing annotation.', inputStructure: 'detailed', method: 'PUT', operationId: 'putAppsAnnotationsByAnnotationId', path: '/apps/annotations/{annotation_id}', summary: 'Update Annotation', tags: ['Annotations'], }) .input( z.object({ body: zPutAppsAnnotationsByAnnotationIdBody, params: zPutAppsAnnotationsByAnnotationIdPath, }), ) .output(zPutAppsAnnotationsByAnnotationIdResponse) export const byAnnotationId = { delete: delete_, put, } /** * List Annotations * * Retrieves a paginated list of annotations for the application. Supports keyword search filtering. */ export const get4 = oc .route({ description: 'Retrieves a paginated list of annotations for the application. Supports keyword search filtering.', inputStructure: 'detailed', method: 'GET', operationId: 'getAppsAnnotations', path: '/apps/annotations', summary: 'List Annotations', tags: ['Annotations'], }) .input(z.object({ query: zGetAppsAnnotationsQuery.optional() })) .output(zGetAppsAnnotationsResponse) /** * Create Annotation * * Creates a new annotation. Annotations provide predefined question-answer pairs that the app can match and return directly instead of generating a response. */ export const post2 = oc .route({ description: 'Creates a new annotation. Annotations provide predefined question-answer pairs that the app can match and return directly instead of generating a response.', inputStructure: 'detailed', method: 'POST', operationId: 'postAppsAnnotations', path: '/apps/annotations', successStatus: 201, summary: 'Create Annotation', tags: ['Annotations'], }) .input(z.object({ body: zPostAppsAnnotationsBody })) .output(zPostAppsAnnotationsResponse) export const annotations = { get: get4, post: post2, byAnnotationId, } export const apps = { annotationReply, annotations, } /** * Convert Audio to Text * * Convert audio file to text. Supported MIME types: `audio/mp3`, `audio/mpga`, `audio/m4a`, `audio/wav`, and `audio/amr`. File size limit is `30 MB`. */ export const post3 = oc .route({ description: 'Convert audio file to text. Supported MIME types: `audio/mp3`, `audio/mpga`, `audio/m4a`, `audio/wav`, and `audio/amr`. File size limit is `30 MB`.', inputStructure: 'detailed', method: 'POST', operationId: 'postAudioToText', path: '/audio-to-text', summary: 'Convert Audio to Text', tags: ['TTS'], }) .input(z.object({ body: zPostAudioToTextBody })) .output(zPostAudioToTextResponse) export const audioToText = { post: post3, } /** * Stop Chat Message Generation * * Stops a chat message generation task. Only supported in `streaming` mode. */ export const post4 = oc .route({ description: 'Stops a chat message generation task. Only supported in `streaming` mode.', inputStructure: 'detailed', method: 'POST', operationId: 'postChatMessagesByTaskIdStop', path: '/chat-messages/{task_id}/stop', summary: 'Stop Chat Message Generation', tags: ['Chatflows', 'Chats'], }) .input( z.object({ body: zPostChatMessagesByTaskIdStopBody, params: zPostChatMessagesByTaskIdStopPath, }), ) .output(zPostChatMessagesByTaskIdStopResponse) export const stop = { post: post4, } export const byTaskId = { stop, } /** * Send Chat Message * * Send a request to the chat application. */ export const post5 = oc .route({ description: 'Send a request to the chat application.', inputStructure: 'detailed', method: 'POST', operationId: 'postChatMessages', path: '/chat-messages', summary: 'Send Chat Message', tags: ['Chatflows', 'Chats'], }) .input(z.object({ body: zPostChatMessagesBody })) .output(zPostChatMessagesResponse) export const chatMessages = { post: post5, byTaskId, } /** * Stop Completion Message Generation * * Stops a completion message generation task. Only supported in `streaming` mode. */ export const post6 = oc .route({ description: 'Stops a completion message generation task. Only supported in `streaming` mode.', inputStructure: 'detailed', method: 'POST', operationId: 'postCompletionMessagesByTaskIdStop', path: '/completion-messages/{task_id}/stop', summary: 'Stop Completion Message Generation', tags: ['Completions'], }) .input( z.object({ body: zPostCompletionMessagesByTaskIdStopBody, params: zPostCompletionMessagesByTaskIdStopPath, }), ) .output(zPostCompletionMessagesByTaskIdStopResponse) export const stop2 = { post: post6, } export const byTaskId2 = { stop: stop2, } /** * Send Completion Message * * Send a request to the text generation application. */ export const post7 = oc .route({ description: 'Send a request to the text generation application.', inputStructure: 'detailed', method: 'POST', operationId: 'postCompletionMessages', path: '/completion-messages', summary: 'Send Completion Message', tags: ['Completions'], }) .input(z.object({ body: zPostCompletionMessagesBody })) .output(zPostCompletionMessagesResponse) export const completionMessages = { post: post7, byTaskId: byTaskId2, } /** * Rename Conversation * * Rename a conversation or auto-generate a name. The conversation name is used for display on clients that support multiple conversations. */ export const post8 = oc .route({ description: 'Rename a conversation or auto-generate a name. The conversation name is used for display on clients that support multiple conversations.', inputStructure: 'detailed', method: 'POST', operationId: 'postConversationsByCIdName', path: '/conversations/{c_id}/name', summary: 'Rename Conversation', tags: ['Conversations'], }) .input( z.object({ body: zPostConversationsByCIdNameBody, params: zPostConversationsByCIdNamePath }), ) .output(zPostConversationsByCIdNameResponse) export const name = { post: post8, } /** * Update Conversation Variable * * Update the value of a specific conversation variable. The value must match the expected type. */ export const put2 = oc .route({ description: 'Update the value of a specific conversation variable. The value must match the expected type.', inputStructure: 'detailed', method: 'PUT', operationId: 'putConversationsByCIdVariablesByVariableId', path: '/conversations/{c_id}/variables/{variable_id}', summary: 'Update Conversation Variable', tags: ['Conversations'], }) .input( z.object({ body: zPutConversationsByCIdVariablesByVariableIdBody, params: zPutConversationsByCIdVariablesByVariableIdPath, }), ) .output(zPutConversationsByCIdVariablesByVariableIdResponse) export const byVariableId = { put: put2, } /** * List Conversation Variables * * Retrieve variables from a specific conversation. */ export const get5 = oc .route({ description: 'Retrieve variables from a specific conversation.', inputStructure: 'detailed', method: 'GET', operationId: 'getConversationsByCIdVariables', path: '/conversations/{c_id}/variables', summary: 'List Conversation Variables', tags: ['Conversations'], }) .input( z.object({ params: zGetConversationsByCIdVariablesPath, query: zGetConversationsByCIdVariablesQuery.optional(), }), ) .output(zGetConversationsByCIdVariablesResponse) export const variables = { get: get5, byVariableId, } /** * Delete Conversation * * Delete a conversation. */ export const delete2 = oc .route({ description: 'Delete a conversation.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteConversationsByCId', path: '/conversations/{c_id}', successStatus: 204, summary: 'Delete Conversation', tags: ['Conversations'], }) .input(z.object({ body: zDeleteConversationsByCIdBody, params: zDeleteConversationsByCIdPath })) .output(zDeleteConversationsByCIdResponse) export const byCId = { delete: delete2, name, variables, } /** * List Conversations * * Retrieve the conversation list for the current user, ordered by most recently active. */ export const get6 = oc .route({ description: 'Retrieve the conversation list for the current user, ordered by most recently active.', inputStructure: 'detailed', method: 'GET', operationId: 'getConversations', path: '/conversations', summary: 'List Conversations', tags: ['Conversations'], }) .input(z.object({ query: zGetConversationsQuery.optional() })) .output(zGetConversationsResponse) export const conversations = { get: get6, byCId, } /** * Upload Pipeline File * * Upload a file for use in a knowledge pipeline. Accepts a single file via `multipart/form-data`. */ export const post9 = oc .route({ description: 'Upload a file for use in a knowledge pipeline. Accepts a single file via `multipart/form-data`.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsPipelineFileUpload', path: '/datasets/pipeline/file-upload', successStatus: 201, summary: 'Upload Pipeline File', tags: ['Knowledge Pipeline'], }) .input(z.object({ body: zPostDatasetsPipelineFileUploadBody })) .output(zPostDatasetsPipelineFileUploadResponse) export const fileUpload = { post: post9, } export const pipeline = { fileUpload, } /** * Create Tag Binding * * Bind one or more tags to a knowledge base. A knowledge base can have multiple tags. */ export const post10 = oc .route({ description: 'Bind one or more tags to a knowledge base. A knowledge base can have multiple tags.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsTagsBinding', path: '/datasets/tags/binding', successStatus: 204, summary: 'Create Tag Binding', tags: ['Tags'], }) .input(z.object({ body: zPostDatasetsTagsBindingBody })) .output(zPostDatasetsTagsBindingResponse) export const binding = { post: post10, } /** * Delete Tag Binding * * Remove one or more tags from a knowledge base. */ export const post11 = oc .route({ description: 'Remove one or more tags from a knowledge base.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsTagsUnbinding', path: '/datasets/tags/unbinding', successStatus: 204, summary: 'Delete Tag Binding', tags: ['Tags'], }) .input(z.object({ body: zPostDatasetsTagsUnbindingBody })) .output(zPostDatasetsTagsUnbindingResponse) export const unbinding = { post: post11, } /** * Delete Knowledge Tag * * Permanently delete a knowledge base tag. Does not delete the knowledge bases that were tagged. */ export const delete3 = oc .route({ description: 'Permanently delete a knowledge base tag. Does not delete the knowledge bases that were tagged.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteDatasetsTags', path: '/datasets/tags', successStatus: 204, summary: 'Delete Knowledge Tag', tags: ['Tags'], }) .input(z.object({ body: zDeleteDatasetsTagsBody })) .output(zDeleteDatasetsTagsResponse) /** * List Knowledge Tags * * Returns the list of all knowledge base tags in the workspace. */ export const get7 = oc .route({ description: 'Returns the list of all knowledge base tags in the workspace.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsTags', path: '/datasets/tags', summary: 'List Knowledge Tags', tags: ['Tags'], }) .output(zGetDatasetsTagsResponse) /** * Update Knowledge Tag * * Rename an existing knowledge base tag. */ export const patch = oc .route({ description: 'Rename an existing knowledge base tag.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsTags', path: '/datasets/tags', summary: 'Update Knowledge Tag', tags: ['Tags'], }) .input(z.object({ body: zPatchDatasetsTagsBody })) .output(zPatchDatasetsTagsResponse) /** * Create Knowledge Tag * * Create a new tag for organizing knowledge bases. */ export const post12 = oc .route({ description: 'Create a new tag for organizing knowledge bases.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsTags', path: '/datasets/tags', summary: 'Create Knowledge Tag', tags: ['Tags'], }) .input(z.object({ body: zPostDatasetsTagsBody })) .output(zPostDatasetsTagsResponse) export const tags = { delete: delete3, get: get7, patch, post: post12, binding, unbinding, } /** * Create Document by File * * Create a document by uploading a file. Supports common document formats (PDF, TXT, DOCX, etc.). Processing is asynchronous — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress. */ export const post13 = oc .route({ description: 'Create a document by uploading a file. Supports common document formats (PDF, TXT, DOCX, etc.). Processing is asynchronous — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentCreateByFile', path: '/datasets/{dataset_id}/document/create-by-file', summary: 'Create Document by File', tags: ['Documents'], }) .input( z.object({ body: zPostDatasetsByDatasetIdDocumentCreateByFileBody, params: zPostDatasetsByDatasetIdDocumentCreateByFilePath, }), ) .output(zPostDatasetsByDatasetIdDocumentCreateByFileResponse) /** * Create Document by File * * Create a document by uploading a file. Supports common document formats (PDF, TXT, DOCX, etc.). Processing is asynchronous — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress. * * @deprecated */ export const post14 = oc .route({ deprecated: true, description: 'Create a document by uploading a file. Supports common document formats (PDF, TXT, DOCX, etc.). Processing is asynchronous — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentCreateByFile', path: '/datasets/{dataset_id}/document/create_by_file', summary: 'Create Document by File', tags: ['Documents'], }) .input( z.object({ body: zPostDatasetsByDatasetIdDocumentCreateByFile2Body, params: zPostDatasetsByDatasetIdDocumentCreateByFile2Path, }), ) .output(zPostDatasetsByDatasetIdDocumentCreateByFile2Response) export const createByFile = { post: post14, } /** * Create Document by Text * * Create a document from raw text content. The document is processed asynchronously — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress. */ export const post15 = oc .route({ description: 'Create a document from raw text content. The document is processed asynchronously — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentCreateByText', path: '/datasets/{dataset_id}/document/create-by-text', summary: 'Create Document by Text', tags: ['Documents'], }) .input( z.object({ body: zPostDatasetsByDatasetIdDocumentCreateByTextBody, params: zPostDatasetsByDatasetIdDocumentCreateByTextPath, }), ) .output(zPostDatasetsByDatasetIdDocumentCreateByTextResponse) /** * Deprecated legacy alias for creating a new document by providing text content. Use /datasets/{dataset_id}/document/create-by-text instead. * * @deprecated */ export const post16 = oc .route({ deprecated: true, description: 'Deprecated legacy alias for creating a new document by providing text content. Use /datasets/{dataset_id}/document/create-by-text instead.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentCreateByText', path: '/datasets/{dataset_id}/document/create_by_text', tags: ['service_api'], }) .input( z.object({ body: zPostDatasetsByDatasetIdDocumentCreateByText2Body, params: zPostDatasetsByDatasetIdDocumentCreateByText2Path, }), ) .output(zPostDatasetsByDatasetIdDocumentCreateByText2Response) export const createByText = { post: post16, } export const document_ = { createByFile, createByText, } /** * Download Documents as ZIP * * Download multiple uploaded-file documents as a single ZIP archive. Accepts up to `100` document IDs. */ export const post17 = oc .route({ description: 'Download multiple uploaded-file documents as a single ZIP archive. Accepts up to `100` document IDs.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsDownloadZip', path: '/datasets/{dataset_id}/documents/download-zip', summary: 'Download Documents as ZIP', tags: ['Documents'], }) .input( z.object({ body: zPostDatasetsByDatasetIdDocumentsDownloadZipBody, params: zPostDatasetsByDatasetIdDocumentsDownloadZipPath, }), ) .output(zPostDatasetsByDatasetIdDocumentsDownloadZipResponse) export const downloadZip = { post: post17, } /** * Update Document Metadata in Batch * * Update metadata values for multiple documents at once. Each document in the request receives the specified metadata key-value pairs. */ export const post18 = oc .route({ description: 'Update metadata values for multiple documents at once. Each document in the request receives the specified metadata key-value pairs.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsMetadata', path: '/datasets/{dataset_id}/documents/metadata', summary: 'Update Document Metadata in Batch', tags: ['Metadata'], }) .input( z.object({ body: zPostDatasetsByDatasetIdDocumentsMetadataBody, params: zPostDatasetsByDatasetIdDocumentsMetadataPath, }), ) .output(zPostDatasetsByDatasetIdDocumentsMetadataResponse) export const metadata = { post: post18, } /** * Update Document Status in Batch * * Enable, disable, archive, or unarchive multiple documents at once. */ export const patch2 = oc .route({ description: 'Enable, disable, archive, or unarchive multiple documents at once.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdDocumentsStatusByAction', path: '/datasets/{dataset_id}/documents/status/{action}', summary: 'Update Document Status in Batch', tags: ['Documents'], }) .input( z.object({ body: zPatchDatasetsByDatasetIdDocumentsStatusByActionBody, params: zPatchDatasetsByDatasetIdDocumentsStatusByActionPath, }), ) .output(zPatchDatasetsByDatasetIdDocumentsStatusByActionResponse) export const byAction2 = { patch: patch2, } export const status2 = { byAction: byAction2, } /** * Get Document Indexing Status * * Check the indexing progress of documents in a batch. Returns the current processing stage and chunk completion counts for each document. Poll this endpoint until `indexing_status` reaches `completed` or `error`. The status progresses through: `waiting` → `parsing` → `cleaning` → `splitting` → `indexing` → `completed`. */ export const get8 = oc .route({ description: 'Check the indexing progress of documents in a batch. Returns the current processing stage and chunk completion counts for each document. Poll this endpoint until `indexing_status` reaches `completed` or `error`. The status progresses through: `waiting` → `parsing` → `cleaning` → `splitting` → `indexing` → `completed`.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByBatchIndexingStatus', path: '/datasets/{dataset_id}/documents/{batch}/indexing-status', summary: 'Get Document Indexing Status', tags: ['Documents'], }) .input(z.object({ params: zGetDatasetsByDatasetIdDocumentsByBatchIndexingStatusPath })) .output(zGetDatasetsByDatasetIdDocumentsByBatchIndexingStatusResponse) export const indexingStatus = { get: get8, } export const byBatch = { indexingStatus, } /** * Download Document * * Get a signed download URL for a document's original uploaded file. */ export const get9 = oc .route({ description: "Get a signed download URL for a document's original uploaded file.", inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdDownload', path: '/datasets/{dataset_id}/documents/{document_id}/download', summary: 'Download Document', tags: ['Documents'], }) .input(z.object({ params: zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadPath })) .output(zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadResponse) export const download = { get: get9, } /** * Delete Child Chunk * * Permanently delete a child chunk from its parent chunk. */ export const delete4 = oc .route({ description: 'Permanently delete a child chunk from its parent chunk.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkId', path: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}', successStatus: 204, summary: 'Delete Child Chunk', tags: ['Chunks'], }) .input( z.object({ params: zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath, }), ) .output( zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse, ) /** * Update Child Chunk * * Update the content of an existing child chunk. */ export const patch3 = oc .route({ description: 'Update the content of an existing child chunk.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkId', path: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}', summary: 'Update Child Chunk', tags: ['Chunks'], }) .input( z.object({ body: zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdBody, params: zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath, }), ) .output( zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse, ) export const byChildChunkId = { delete: delete4, patch: patch3, } /** * List Child Chunks * * Returns a paginated list of child chunks under a specific parent chunk. */ export const get10 = oc .route({ description: 'Returns a paginated list of child chunks under a specific parent chunk.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunks', path: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks', summary: 'List Child Chunks', tags: ['Chunks'], }) .input( z.object({ params: zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksPath, query: zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksQuery.optional(), }), ) .output(zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse) /** * Create Child Chunk * * Create a child chunk under the specified segment. */ export const post19 = oc .route({ description: 'Create a child chunk under the specified segment.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunks', path: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks', summary: 'Create Child Chunk', tags: ['Chunks'], }) .input( z.object({ body: zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksBody, params: zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksPath, }), ) .output(zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse) export const childChunks = { get: get10, post: post19, byChildChunkId, } /** * Delete Chunk * * Permanently delete a chunk from the document. */ export const delete5 = oc .route({ description: 'Permanently delete a chunk from the document.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentId', path: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}', successStatus: 204, summary: 'Delete Chunk', tags: ['Chunks'], }) .input( z.object({ params: zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath }), ) .output(zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse) /** * Get Chunk * * Retrieve detailed information about a specific chunk, including its content, keywords, and indexing status. */ export const get11 = oc .route({ description: 'Retrieve detailed information about a specific chunk, including its content, keywords, and indexing status.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentId', path: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}', summary: 'Get Chunk', tags: ['Chunks'], }) .input(z.object({ params: zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath })) .output(zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse) /** * Update Chunk * * Update a chunk's content, keywords, or answer. Re-triggers indexing for the modified chunk. */ export const post20 = oc .route({ description: "Update a chunk's content, keywords, or answer. Re-triggers indexing for the modified chunk.", inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentId', path: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}', summary: 'Update Chunk', tags: ['Chunks'], }) .input( z.object({ body: zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdBody, params: zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath, }), ) .output(zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse) export const bySegmentId = { delete: delete5, get: get11, post: post20, childChunks, } /** * List Chunks * * Returns a paginated list of chunks within a document. Supports filtering by keyword and status. */ export const get12 = oc .route({ description: 'Returns a paginated list of chunks within a document. Supports filtering by keyword and status.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdSegments', path: '/datasets/{dataset_id}/documents/{document_id}/segments', summary: 'List Chunks', tags: ['Chunks'], }) .input( z.object({ params: zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsPath, query: zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsQuery.optional(), }), ) .output(zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponse) /** * Create Chunks * * Create one or more chunks within a document. Each chunk can include optional keywords and an answer field (for QA-mode documents). */ export const post21 = oc .route({ description: 'Create one or more chunks within a document. Each chunk can include optional keywords and an answer field (for QA-mode documents).', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdSegments', path: '/datasets/{dataset_id}/documents/{document_id}/segments', summary: 'Create Chunks', tags: ['Chunks'], }) .input( z.object({ body: zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBody, params: zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsPath, }), ) .output(zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponse) export const segments = { get: get12, post: post21, bySegmentId, } /** * Update Document by File * * Update an existing document by uploading a new file. Re-triggers indexing — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress. * * @deprecated */ export const post22 = oc .route({ deprecated: true, description: 'Update an existing document by uploading a new file. Re-triggers indexing — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile', path: '/datasets/{dataset_id}/documents/{document_id}/update-by-file', summary: 'Update Document by File', tags: ['Documents'], }) .input( z.object({ body: zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFileBody.optional(), params: zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFilePath, }), ) .output(zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFileResponse) /** * Update Document by File * * Update an existing document by uploading a new file. Re-triggers indexing — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress. * * @deprecated */ export const post23 = oc .route({ deprecated: true, description: 'Update an existing document by uploading a new file. Re-triggers indexing — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile', path: '/datasets/{dataset_id}/documents/{document_id}/update_by_file', summary: 'Update Document by File', tags: ['Documents'], }) .input( z.object({ body: zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Body.optional(), params: zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Path, }), ) .output(zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Response) export const updateByFile = { post: post23, } /** * Update Document by Text * * Update an existing document's text content, name, or processing configuration. Re-triggers indexing if content changes — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress. */ export const post24 = oc .route({ description: "Update an existing document's text content, name, or processing configuration. Re-triggers indexing if content changes — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress.", inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText', path: '/datasets/{dataset_id}/documents/{document_id}/update-by-text', summary: 'Update Document by Text', tags: ['Documents'], }) .input( z.object({ body: zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextBody, params: zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextPath, }), ) .output(zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextResponse) /** * Deprecated legacy alias for updating an existing document by providing text content. Use /datasets/{dataset_id}/documents/{document_id}/update-by-text instead. * * @deprecated */ export const post25 = oc .route({ deprecated: true, description: 'Deprecated legacy alias for updating an existing document by providing text content. Use /datasets/{dataset_id}/documents/{document_id}/update-by-text instead.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText', path: '/datasets/{dataset_id}/documents/{document_id}/update_by_text', tags: ['service_api'], }) .input( z.object({ body: zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Body, params: zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Path, }), ) .output(zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Response) export const updateByText = { post: post25, } /** * Delete Document * * Permanently delete a document and all its chunks from the knowledge base. */ export const delete6 = oc .route({ description: 'Permanently delete a document and all its chunks from the knowledge base.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteDatasetsByDatasetIdDocumentsByDocumentId', path: '/datasets/{dataset_id}/documents/{document_id}', successStatus: 204, summary: 'Delete Document', tags: ['Documents'], }) .input(z.object({ params: zDeleteDatasetsByDatasetIdDocumentsByDocumentIdPath })) .output(zDeleteDatasetsByDatasetIdDocumentsByDocumentIdResponse) /** * Get Document * * Retrieve detailed information about a specific document, including its indexing status, metadata, and processing statistics. */ export const get13 = oc .route({ description: 'Retrieve detailed information about a specific document, including its indexing status, metadata, and processing statistics.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocumentsByDocumentId', path: '/datasets/{dataset_id}/documents/{document_id}', summary: 'Get Document', tags: ['Documents'], }) .input( z.object({ params: zGetDatasetsByDatasetIdDocumentsByDocumentIdPath, query: zGetDatasetsByDatasetIdDocumentsByDocumentIdQuery.optional(), }), ) .output(zGetDatasetsByDatasetIdDocumentsByDocumentIdResponse) /** * Update Document by File * * Update an existing document by uploading a new file. Re-triggers indexing — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress. */ export const patch4 = oc .route({ description: 'Update an existing document by uploading a new file. Re-triggers indexing — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdDocumentsByDocumentId', path: '/datasets/{dataset_id}/documents/{document_id}', summary: 'Update Document by File', tags: ['Documents'], }) .input( z.object({ body: zPatchDatasetsByDatasetIdDocumentsByDocumentIdBody.optional(), params: zPatchDatasetsByDatasetIdDocumentsByDocumentIdPath, }), ) .output(zPatchDatasetsByDatasetIdDocumentsByDocumentIdResponse) export const byDocumentId = { delete: delete6, get: get13, patch: patch4, download, segments, updateByFile, updateByText, } /** * List Documents * * Returns a paginated list of documents in the knowledge base. Supports filtering by keyword and indexing status. */ export const get14 = oc .route({ description: 'Returns a paginated list of documents in the knowledge base. Supports filtering by keyword and indexing status.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdDocuments', path: '/datasets/{dataset_id}/documents', summary: 'List Documents', tags: ['Documents'], }) .input( z.object({ params: zGetDatasetsByDatasetIdDocumentsPath, query: zGetDatasetsByDatasetIdDocumentsQuery.optional(), }), ) .output(zGetDatasetsByDatasetIdDocumentsResponse) export const documents = { get: get14, downloadZip, metadata, status: status2, byBatch, byDocumentId, } /** * Retrieve Chunks from a Knowledge Base / Test Retrieval * * Performs a search query against a knowledge base to retrieve the most relevant chunks. This endpoint can be used for both production retrieval and test retrieval. */ export const post26 = oc .route({ description: 'Performs a search query against a knowledge base to retrieve the most relevant chunks. This endpoint can be used for both production retrieval and test retrieval.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdHitTesting', path: '/datasets/{dataset_id}/hit-testing', summary: 'Retrieve Chunks from a Knowledge Base / Test Retrieval', tags: ['Knowledge Bases'], }) .input( z.object({ body: zPostDatasetsByDatasetIdHitTestingBody, params: zPostDatasetsByDatasetIdHitTestingPath, }), ) .output(zPostDatasetsByDatasetIdHitTestingResponse) export const hitTesting = { post: post26, } /** * Update Built-in Metadata Field * * Enable or disable built-in metadata fields for the knowledge base. */ export const post27 = oc .route({ description: 'Enable or disable built-in metadata fields for the knowledge base.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdMetadataBuiltInByAction', path: '/datasets/{dataset_id}/metadata/built-in/{action}', summary: 'Update Built-in Metadata Field', tags: ['Metadata'], }) .input(z.object({ params: zPostDatasetsByDatasetIdMetadataBuiltInByActionPath })) .output(zPostDatasetsByDatasetIdMetadataBuiltInByActionResponse) export const byAction3 = { post: post27, } /** * Get Built-in Metadata Fields * * Returns the list of built-in metadata fields provided by the system (e.g., document type, source URL). */ export const get15 = oc .route({ description: 'Returns the list of built-in metadata fields provided by the system (e.g., document type, source URL).', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdMetadataBuiltIn', path: '/datasets/{dataset_id}/metadata/built-in', summary: 'Get Built-in Metadata Fields', tags: ['Metadata'], }) .input(z.object({ params: zGetDatasetsByDatasetIdMetadataBuiltInPath })) .output(zGetDatasetsByDatasetIdMetadataBuiltInResponse) export const builtIn = { get: get15, byAction: byAction3, } /** * Delete Metadata Field * * Permanently delete a custom metadata field. Documents using this field will lose their metadata values for it. */ export const delete7 = oc .route({ description: 'Permanently delete a custom metadata field. Documents using this field will lose their metadata values for it.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteDatasetsByDatasetIdMetadataByMetadataId', path: '/datasets/{dataset_id}/metadata/{metadata_id}', successStatus: 204, summary: 'Delete Metadata Field', tags: ['Metadata'], }) .input(z.object({ params: zDeleteDatasetsByDatasetIdMetadataByMetadataIdPath })) .output(zDeleteDatasetsByDatasetIdMetadataByMetadataIdResponse) /** * Update Metadata Field * * Rename a custom metadata field. */ export const patch5 = oc .route({ description: 'Rename a custom metadata field.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetIdMetadataByMetadataId', path: '/datasets/{dataset_id}/metadata/{metadata_id}', summary: 'Update Metadata Field', tags: ['Metadata'], }) .input( z.object({ body: zPatchDatasetsByDatasetIdMetadataByMetadataIdBody, params: zPatchDatasetsByDatasetIdMetadataByMetadataIdPath, }), ) .output(zPatchDatasetsByDatasetIdMetadataByMetadataIdResponse) export const byMetadataId = { delete: delete7, patch: patch5, } /** * List Metadata Fields * * Returns the list of all metadata fields (both custom and built-in) for the knowledge base, along with the count of documents using each field. */ export const get16 = oc .route({ description: 'Returns the list of all metadata fields (both custom and built-in) for the knowledge base, along with the count of documents using each field.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdMetadata', path: '/datasets/{dataset_id}/metadata', summary: 'List Metadata Fields', tags: ['Metadata'], }) .input(z.object({ params: zGetDatasetsByDatasetIdMetadataPath })) .output(zGetDatasetsByDatasetIdMetadataResponse) /** * Create Metadata Field * * Create a custom metadata field for the knowledge base. Metadata fields can be used to annotate documents with structured information. */ export const post28 = oc .route({ description: 'Create a custom metadata field for the knowledge base. Metadata fields can be used to annotate documents with structured information.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdMetadata', path: '/datasets/{dataset_id}/metadata', successStatus: 201, summary: 'Create Metadata Field', tags: ['Metadata'], }) .input( z.object({ body: zPostDatasetsByDatasetIdMetadataBody, params: zPostDatasetsByDatasetIdMetadataPath, }), ) .output(zPostDatasetsByDatasetIdMetadataResponse) export const metadata2 = { get: get16, post: post28, builtIn, byMetadataId, } /** * List Datasource Plugins * * List the datasource nodes configured in the knowledge pipeline. Each node includes the plugin it uses plus the metadata needed to run it. */ export const get17 = oc .route({ description: 'List the datasource nodes configured in the knowledge pipeline. Each node includes the plugin it uses plus the metadata needed to run it.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdPipelineDatasourcePlugins', path: '/datasets/{dataset_id}/pipeline/datasource-plugins', summary: 'List Datasource Plugins', tags: ['Knowledge Pipeline'], }) .input( z.object({ params: zGetDatasetsByDatasetIdPipelineDatasourcePluginsPath, query: zGetDatasetsByDatasetIdPipelineDatasourcePluginsQuery.optional(), }), ) .output(zGetDatasetsByDatasetIdPipelineDatasourcePluginsResponse) export const datasourcePlugins = { get: get17, } /** * Run Datasource Node * * Execute a single datasource node within the knowledge pipeline. Returns a streaming response with the node execution results. */ export const post29 = oc .route({ description: 'Execute a single datasource node within the knowledge pipeline. Returns a streaming response with the node execution results.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRun', path: '/datasets/{dataset_id}/pipeline/datasource/nodes/{node_id}/run', summary: 'Run Datasource Node', tags: ['Knowledge Pipeline'], }) .input( z.object({ body: zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunBody, params: zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunPath, }), ) .output(zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunResponse) export const run = { post: post29, } export const byNodeId = { run, } export const nodes = { byNodeId, } export const datasource = { nodes, } /** * Run Pipeline * * Execute the full knowledge pipeline for a knowledge base. Supports both streaming and blocking response modes. */ export const post30 = oc .route({ description: 'Execute the full knowledge pipeline for a knowledge base. Supports both streaming and blocking response modes.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdPipelineRun', path: '/datasets/{dataset_id}/pipeline/run', summary: 'Run Pipeline', tags: ['Knowledge Pipeline'], }) .input( z.object({ body: zPostDatasetsByDatasetIdPipelineRunBody, params: zPostDatasetsByDatasetIdPipelineRunPath, }), ) .output(zPostDatasetsByDatasetIdPipelineRunResponse) export const run2 = { post: post30, } export const pipeline2 = { datasourcePlugins, datasource, run: run2, } /** * Retrieve Chunks from a Knowledge Base / Test Retrieval * * Performs a search query against a knowledge base to retrieve the most relevant chunks. This endpoint can be used for both production retrieval and test retrieval. */ export const post31 = oc .route({ description: 'Performs a search query against a knowledge base to retrieve the most relevant chunks. This endpoint can be used for both production retrieval and test retrieval.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasetsByDatasetIdRetrieve', path: '/datasets/{dataset_id}/retrieve', summary: 'Retrieve Chunks from a Knowledge Base / Test Retrieval', tags: ['Knowledge Bases'], }) .input( z.object({ body: zPostDatasetsByDatasetIdRetrieveBody, params: zPostDatasetsByDatasetIdRetrievePath, }), ) .output(zPostDatasetsByDatasetIdRetrieveResponse) export const retrieve = { post: post31, } /** * Get Knowledge Base Tags * * Returns the list of tags bound to a specific knowledge base. */ export const get18 = oc .route({ description: 'Returns the list of tags bound to a specific knowledge base.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetIdTags', path: '/datasets/{dataset_id}/tags', summary: 'Get Knowledge Base Tags', tags: ['Tags'], }) .input(z.object({ params: zGetDatasetsByDatasetIdTagsPath })) .output(zGetDatasetsByDatasetIdTagsResponse) export const tags2 = { get: get18, } /** * Delete Knowledge Base * * Permanently delete a knowledge base and all its documents. The knowledge base must not be in use by any application. */ export const delete8 = oc .route({ description: 'Permanently delete a knowledge base and all its documents. The knowledge base must not be in use by any application.', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteDatasetsByDatasetId', path: '/datasets/{dataset_id}', successStatus: 204, summary: 'Delete Knowledge Base', tags: ['Knowledge Bases'], }) .input(z.object({ params: zDeleteDatasetsByDatasetIdPath })) .output(zDeleteDatasetsByDatasetIdResponse) /** * Get Knowledge Base * * Retrieve detailed information about a specific knowledge base, including its embedding model, retrieval configuration, and document statistics. */ export const get19 = oc .route({ description: 'Retrieve detailed information about a specific knowledge base, including its embedding model, retrieval configuration, and document statistics.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasetsByDatasetId', path: '/datasets/{dataset_id}', summary: 'Get Knowledge Base', tags: ['Knowledge Bases'], }) .input(z.object({ params: zGetDatasetsByDatasetIdPath })) .output(zGetDatasetsByDatasetIdResponse) /** * Update Knowledge Base * * Update the name, description, permissions, or retrieval settings of an existing knowledge base. Only the fields provided in the request body are updated. */ export const patch6 = oc .route({ description: 'Update the name, description, permissions, or retrieval settings of an existing knowledge base. Only the fields provided in the request body are updated.', inputStructure: 'detailed', method: 'PATCH', operationId: 'patchDatasetsByDatasetId', path: '/datasets/{dataset_id}', summary: 'Update Knowledge Base', tags: ['Knowledge Bases'], }) .input(z.object({ body: zPatchDatasetsByDatasetIdBody, params: zPatchDatasetsByDatasetIdPath })) .output(zPatchDatasetsByDatasetIdResponse) export const byDatasetId = { delete: delete8, get: get19, patch: patch6, document: document_, documents, hitTesting, metadata: metadata2, pipeline: pipeline2, retrieve, tags: tags2, } /** * List Knowledge Bases * * Returns a paginated list of knowledge bases. Supports filtering by keyword and tags. */ export const get20 = oc .route({ description: 'Returns a paginated list of knowledge bases. Supports filtering by keyword and tags.', inputStructure: 'detailed', method: 'GET', operationId: 'getDatasets', path: '/datasets', summary: 'List Knowledge Bases', tags: ['Knowledge Bases'], }) .input(z.object({ query: zGetDatasetsQuery.optional() })) .output(zGetDatasetsResponse) /** * Create an Empty Knowledge Base * * Create a new empty knowledge base. After creation, use [Create Document by Text](/api-reference/documents/create-document-by-text) or [Create Document by File](/api-reference/documents/create-document-by-file) to add documents. */ export const post32 = oc .route({ description: 'Create a new empty knowledge base. After creation, use [Create Document by Text](/api-reference/documents/create-document-by-text) or [Create Document by File](/api-reference/documents/create-document-by-file) to add documents.', inputStructure: 'detailed', method: 'POST', operationId: 'postDatasets', path: '/datasets', summary: 'Create an Empty Knowledge Base', tags: ['Knowledge Bases'], }) .input(z.object({ body: zPostDatasetsBody })) .output(zPostDatasetsResponse) export const datasets = { get: get20, post: post32, pipeline, tags, byDatasetId, } /** * Get End User Info * * Retrieve an end user by ID. Useful when other APIs return an end-user ID (e.g., `created_by` from [Upload File](/api-reference/files/upload-file)). */ export const get21 = oc .route({ description: 'Retrieve an end user by ID. Useful when other APIs return an end-user ID (e.g., `created_by` from [Upload File](/api-reference/files/upload-file)).', inputStructure: 'detailed', method: 'GET', operationId: 'getEndUsersByEndUserId', path: '/end-users/{end_user_id}', summary: 'Get End User Info', tags: ['End Users'], }) .input(z.object({ params: zGetEndUsersByEndUserIdPath })) .output(zGetEndUsersByEndUserIdResponse) export const byEndUserId = { get: get21, } export const endUsers = { byEndUserId, } /** * Upload File * * Upload a file for use when sending messages, enabling multimodal understanding of images, documents, audio, and video. Uploaded files are for use by the current end-user only. */ export const post33 = oc .route({ description: 'Upload a file for use when sending messages, enabling multimodal understanding of images, documents, audio, and video. Uploaded files are for use by the current end-user only.', inputStructure: 'detailed', method: 'POST', operationId: 'postFilesUpload', path: '/files/upload', successStatus: 201, summary: 'Upload File', tags: ['Files'], }) .input(z.object({ body: zPostFilesUploadBody })) .output(zPostFilesUploadResponse) export const upload = { post: post33, } /** * Download File * * Preview or download uploaded files previously uploaded via the [Upload File](/api-reference/files/upload-file) API. Files can only be accessed if they belong to messages within the requesting application. */ export const get22 = oc .route({ description: 'Preview or download uploaded files previously uploaded via the [Upload File](/api-reference/files/upload-file) API. Files can only be accessed if they belong to messages within the requesting application.', inputStructure: 'detailed', method: 'GET', operationId: 'getFilesByFileIdPreview', path: '/files/{file_id}/preview', summary: 'Download File', tags: ['Files'], }) .input( z.object({ params: zGetFilesByFileIdPreviewPath, query: zGetFilesByFileIdPreviewQuery.optional(), }), ) .output(zGetFilesByFileIdPreviewResponse) export const preview = { get: get22, } export const byFileId = { preview, } export const files = { upload, byFileId, } /** * Get Human Input Form * * Retrieve a paused Human Input form's contents using the `form_token` from a `human_input_required` event. Requires **WebApp** delivery. */ export const get23 = oc .route({ description: "Retrieve a paused Human Input form's contents using the `form_token` from a `human_input_required` event. Requires **WebApp** delivery.", inputStructure: 'detailed', method: 'GET', operationId: 'getFormHumanInputByFormToken', path: '/form/human_input/{form_token}', summary: 'Get Human Input Form', tags: ['Human Input'], }) .input(z.object({ params: zGetFormHumanInputByFormTokenPath })) .output(zGetFormHumanInputByFormTokenResponse) /** * Submit Human Input Form * * Submit the recipient's response to a paused Human Input form. The workflow resumes on acceptance; use [Stream Workflow Events](/api-reference/chatflows/stream-workflow-events) to follow subsequent events. Requires **WebApp** delivery. */ export const post34 = oc .route({ description: "Submit the recipient's response to a paused Human Input form. The workflow resumes on acceptance; use [Stream Workflow Events](/api-reference/chatflows/stream-workflow-events) to follow subsequent events. Requires **WebApp** delivery.", inputStructure: 'detailed', method: 'POST', operationId: 'postFormHumanInputByFormToken', path: '/form/human_input/{form_token}', summary: 'Submit Human Input Form', tags: ['Human Input'], }) .input( z.object({ body: zPostFormHumanInputByFormTokenBody, params: zPostFormHumanInputByFormTokenPath, }), ) .output(zPostFormHumanInputByFormTokenResponse) export const byFormToken = { get: get23, post: post34, } export const humanInput = { byFormToken, } export const form = { humanInput, } /** * Get App Info * * Retrieve basic information about this application, including name, description, tags, and mode. */ export const get24 = oc .route({ description: 'Retrieve basic information about this application, including name, description, tags, and mode.', inputStructure: 'detailed', method: 'GET', operationId: 'getInfo', path: '/info', summary: 'Get App Info', tags: ['Applications'], }) .output(zGetInfoResponse) export const info = { get: get24, } /** * Submit Message Feedback * * Submit feedback for a message. End users can rate messages as `like` or `dislike`, and optionally provide text feedback. Pass `null` for `rating` to revoke previously submitted feedback. */ export const post35 = oc .route({ description: 'Submit feedback for a message. End users can rate messages as `like` or `dislike`, and optionally provide text feedback. Pass `null` for `rating` to revoke previously submitted feedback.', inputStructure: 'detailed', method: 'POST', operationId: 'postMessagesByMessageIdFeedbacks', path: '/messages/{message_id}/feedbacks', summary: 'Submit Message Feedback', tags: ['Feedback'], }) .input( z.object({ body: zPostMessagesByMessageIdFeedbacksBody, params: zPostMessagesByMessageIdFeedbacksPath, }), ) .output(zPostMessagesByMessageIdFeedbacksResponse) export const feedbacks2 = { post: post35, } /** * Get Next Suggested Questions * * Get next questions suggestions for the current message. */ export const get25 = oc .route({ description: 'Get next questions suggestions for the current message.', inputStructure: 'detailed', method: 'GET', operationId: 'getMessagesByMessageIdSuggested', path: '/messages/{message_id}/suggested', summary: 'Get Next Suggested Questions', tags: ['Chatflows', 'Chats'], }) .input( z.object({ params: zGetMessagesByMessageIdSuggestedPath, query: zGetMessagesByMessageIdSuggestedQuery, }), ) .output(zGetMessagesByMessageIdSuggestedResponse) export const suggested = { get: get25, } export const byMessageId = { feedbacks: feedbacks2, suggested, } /** * List Conversation 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 get26 = oc .route({ description: 'Returns historical chat records in a scrolling load format, with the first page returning the latest `limit` messages, i.e., in reverse order.', inputStructure: 'detailed', method: 'GET', operationId: 'getMessages', path: '/messages', summary: 'List Conversation Messages', tags: ['Conversations'], }) .input(z.object({ query: zGetMessagesQuery })) .output(zGetMessagesResponse) export const messages = { get: get26, byMessageId, } /** * Get App Meta * * Retrieve metadata about this application, including tool icons and other configuration details. */ export const get27 = oc .route({ description: 'Retrieve metadata about this application, including tool icons and other configuration details.', inputStructure: 'detailed', method: 'GET', operationId: 'getMeta', path: '/meta', summary: 'Get App Meta', tags: ['Applications'], }) .output(zGetMetaResponse) export const meta = { get: get27, } /** * Get App Parameters * * Retrieve the application's input form configuration, including feature switches, input parameter names, types, and default values. */ export const get28 = oc .route({ description: "Retrieve the application's input form configuration, including feature switches, input parameter names, types, and default values.", inputStructure: 'detailed', method: 'GET', operationId: 'getParameters', path: '/parameters', summary: 'Get App Parameters', tags: ['Applications'], }) .output(zGetParametersResponse) export const parameters = { get: get28, } /** * Get App WebApp Settings * * Retrieve the WebApp settings of this application, including site configuration, theme, and customization options. */ export const get29 = oc .route({ description: 'Retrieve the WebApp settings of this application, including site configuration, theme, and customization options.', inputStructure: 'detailed', method: 'GET', operationId: 'getSite', path: '/site', summary: 'Get App WebApp Settings', tags: ['Applications'], }) .output(zGetSiteResponse) export const site = { get: get29, } /** * Convert Text to Audio * * Convert text to speech. */ export const post36 = oc .route({ description: 'Convert text to speech.', inputStructure: 'detailed', method: 'POST', operationId: 'postTextToAudio', path: '/text-to-audio', summary: 'Convert Text to Audio', tags: ['TTS'], }) .input(z.object({ body: zPostTextToAudioBody })) .output(zPostTextToAudioResponse) export const textToAudio = { post: post36, } /** * Stream Workflow Events * * Resume the Server-Sent Events stream for a workflow run after a pause or a dropped SSE connection. For runs that have already finished, the stream emits a single `workflow_finished` event and closes. */ export const get30 = oc .route({ description: 'Resume the Server-Sent Events stream for a workflow run after a pause or a dropped SSE connection. For runs that have already finished, the stream emits a single `workflow_finished` event and closes.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkflowByTaskIdEvents', path: '/workflow/{task_id}/events', summary: 'Stream Workflow Events', tags: ['Chatflows', 'Workflows'], }) .input( z.object({ params: zGetWorkflowByTaskIdEventsPath, query: zGetWorkflowByTaskIdEventsQuery }), ) .output(zGetWorkflowByTaskIdEventsResponse) export const events = { get: get30, } export const byTaskId3 = { events, } export const workflow = { byTaskId: byTaskId3, } /** * List Workflow Logs * * Retrieve paginated workflow execution logs with filtering options. */ export const get31 = oc .route({ description: 'Retrieve paginated workflow execution logs with filtering options.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkflowsLogs', path: '/workflows/logs', summary: 'List Workflow Logs', tags: ['Chatflows', 'Workflows'], }) .input(z.object({ query: zGetWorkflowsLogsQuery.optional() })) .output(zGetWorkflowsLogsResponse) export const logs = { get: get31, } /** * Get Workflow Run Detail * * Retrieve the current execution results of a workflow task based on the workflow execution ID. */ export const get32 = oc .route({ description: 'Retrieve the current execution results of a workflow task based on the workflow execution ID.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkflowsRunByWorkflowRunId', path: '/workflows/run/{workflow_run_id}', summary: 'Get Workflow Run Detail', tags: ['Chatflows', 'Workflows'], }) .input(z.object({ params: zGetWorkflowsRunByWorkflowRunIdPath })) .output(zGetWorkflowsRunByWorkflowRunIdResponse) export const byWorkflowRunId = { get: get32, } /** * Run Workflow * * Execute a workflow. Cannot be executed without a published workflow. */ export const post37 = oc .route({ description: 'Execute a workflow. Cannot be executed without a published workflow.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkflowsRun', path: '/workflows/run', summary: 'Run Workflow', tags: ['Workflows'], }) .input(z.object({ body: zPostWorkflowsRunBody })) .output(zPostWorkflowsRunResponse) export const run3 = { post: post37, byWorkflowRunId, } /** * Stop Workflow Task * * Stop a running workflow task. Only supported in `streaming` mode. */ export const post38 = oc .route({ description: 'Stop a running workflow task. Only supported in `streaming` mode.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkflowsTasksByTaskIdStop', path: '/workflows/tasks/{task_id}/stop', summary: 'Stop Workflow Task', tags: ['Workflows'], }) .input( z.object({ body: zPostWorkflowsTasksByTaskIdStopBody, params: zPostWorkflowsTasksByTaskIdStopPath, }), ) .output(zPostWorkflowsTasksByTaskIdStopResponse) export const stop3 = { post: post38, } export const byTaskId4 = { stop: stop3, } export const tasks = { byTaskId: byTaskId4, } /** * Run Workflow by ID * * Execute a specific workflow version identified by its ID. Useful for running a particular published version of the workflow. */ export const post39 = oc .route({ description: 'Execute a specific workflow version identified by its ID. Useful for running a particular published version of the workflow.', inputStructure: 'detailed', method: 'POST', operationId: 'postWorkflowsByWorkflowIdRun', path: '/workflows/{workflow_id}/run', summary: 'Run Workflow by ID', tags: ['Workflows'], }) .input( z.object({ body: zPostWorkflowsByWorkflowIdRunBody, params: zPostWorkflowsByWorkflowIdRunPath, }), ) .output(zPostWorkflowsByWorkflowIdRunResponse) export const run4 = { post: post39, } export const byWorkflowId = { run: run4, } export const workflows = { logs, run: run3, tasks, byWorkflowId, } /** * Get Available Models * * Retrieve the list of available models by type. Primarily used to query `text-embedding` and `rerank` models for knowledge base configuration. */ export const get33 = oc .route({ description: 'Retrieve the list of available models by type. Primarily used to query `text-embedding` and `rerank` models for knowledge base configuration.', inputStructure: 'detailed', method: 'GET', operationId: 'getWorkspacesCurrentModelsModelTypesByModelType', path: '/workspaces/current/models/model-types/{model_type}', summary: 'Get Available Models', tags: ['Models'], }) .input(z.object({ params: zGetWorkspacesCurrentModelsModelTypesByModelTypePath })) .output(zGetWorkspacesCurrentModelsModelTypesByModelTypeResponse) export const byModelType = { get: get33, } export const modelTypes = { byModelType, } export const models = { modelTypes, } export const current = { models, } export const workspaces = { current, } export const contract = { root, app, apps, audioToText, chatMessages, completionMessages, conversations, datasets, endUsers, files, form, info, messages, meta, parameters, site, textToAudio, workflow, workflows, workspaces, }