mirror of
https://github.com/langgenius/dify.git
synced 2026-05-10 22:28:55 +08:00
2406 lines
67 KiB
TypeScript
2406 lines
67 KiB
TypeScript
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
import { oc } from '@orpc/contract'
|
|
import * as z from 'zod'
|
|
|
|
import {
|
|
zDeleteAppsAnnotationsByAnnotationIdPath,
|
|
zDeleteAppsAnnotationsByAnnotationIdResponse,
|
|
zDeleteConversationsByCIdPath,
|
|
zDeleteConversationsByCIdResponse,
|
|
zDeleteDatasetsByDatasetIdDocumentsByDocumentIdPath,
|
|
zDeleteDatasetsByDatasetIdDocumentsByDocumentIdResponse,
|
|
zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath,
|
|
zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse,
|
|
zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath,
|
|
zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse,
|
|
zDeleteDatasetsByDatasetIdMetadataByMetadataIdPath,
|
|
zDeleteDatasetsByDatasetIdMetadataByMetadataIdResponse,
|
|
zDeleteDatasetsByDatasetIdPath,
|
|
zDeleteDatasetsByDatasetIdResponse,
|
|
zDeleteDatasetsTagsBody,
|
|
zDeleteDatasetsTagsResponse,
|
|
zGetAppFeedbacksQuery,
|
|
zGetAppFeedbacksResponse,
|
|
zGetAppsAnnotationReplyByActionStatusByJobIdPath,
|
|
zGetAppsAnnotationReplyByActionStatusByJobIdResponse,
|
|
zGetAppsAnnotationsResponse,
|
|
zGetConversationsByCIdVariablesPath,
|
|
zGetConversationsByCIdVariablesQuery,
|
|
zGetConversationsByCIdVariablesResponse,
|
|
zGetConversationsQuery,
|
|
zGetConversationsResponse,
|
|
zGetDatasetsByDatasetIdDocumentsByBatchIndexingStatusPath,
|
|
zGetDatasetsByDatasetIdDocumentsByBatchIndexingStatusResponse,
|
|
zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadPath,
|
|
zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadResponse,
|
|
zGetDatasetsByDatasetIdDocumentsByDocumentIdPath,
|
|
zGetDatasetsByDatasetIdDocumentsByDocumentIdResponse,
|
|
zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksPath,
|
|
zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksQuery,
|
|
zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse,
|
|
zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath,
|
|
zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse,
|
|
zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsPath,
|
|
zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsQuery,
|
|
zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponse,
|
|
zGetDatasetsByDatasetIdDocumentsPath,
|
|
zGetDatasetsByDatasetIdDocumentsResponse,
|
|
zGetDatasetsByDatasetIdMetadataBuiltInPath,
|
|
zGetDatasetsByDatasetIdMetadataBuiltInResponse,
|
|
zGetDatasetsByDatasetIdMetadataPath,
|
|
zGetDatasetsByDatasetIdMetadataResponse,
|
|
zGetDatasetsByDatasetIdPath,
|
|
zGetDatasetsByDatasetIdPipelineDatasourcePluginsPath,
|
|
zGetDatasetsByDatasetIdPipelineDatasourcePluginsQuery,
|
|
zGetDatasetsByDatasetIdPipelineDatasourcePluginsResponse,
|
|
zGetDatasetsByDatasetIdResponse,
|
|
zGetDatasetsByDatasetIdTagsPath,
|
|
zGetDatasetsByDatasetIdTagsResponse,
|
|
zGetDatasetsResponse,
|
|
zGetDatasetsTagsResponse,
|
|
zGetEndUsersByEndUserIdPath,
|
|
zGetEndUsersByEndUserIdResponse,
|
|
zGetFilesByFileIdPreviewPath,
|
|
zGetFilesByFileIdPreviewQuery,
|
|
zGetFilesByFileIdPreviewResponse,
|
|
zGetFormHumanInputByFormTokenPath,
|
|
zGetFormHumanInputByFormTokenResponse,
|
|
zGetInfoResponse,
|
|
zGetMessagesByMessageIdSuggestedPath,
|
|
zGetMessagesByMessageIdSuggestedResponse,
|
|
zGetMessagesQuery,
|
|
zGetMessagesResponse,
|
|
zGetMetaResponse,
|
|
zGetParametersResponse,
|
|
zGetRootResponse,
|
|
zGetSiteResponse,
|
|
zGetWorkflowByTaskIdEventsPath,
|
|
zGetWorkflowByTaskIdEventsQuery,
|
|
zGetWorkflowByTaskIdEventsResponse,
|
|
zGetWorkflowsLogsQuery,
|
|
zGetWorkflowsLogsResponse,
|
|
zGetWorkflowsRunByWorkflowRunIdPath,
|
|
zGetWorkflowsRunByWorkflowRunIdResponse,
|
|
zGetWorkspacesCurrentModelsModelTypesByModelTypePath,
|
|
zGetWorkspacesCurrentModelsModelTypesByModelTypeResponse,
|
|
zPatchDatasetsByDatasetIdBody,
|
|
zPatchDatasetsByDatasetIdDocumentsByDocumentIdPath,
|
|
zPatchDatasetsByDatasetIdDocumentsByDocumentIdResponse,
|
|
zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdBody,
|
|
zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath,
|
|
zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse,
|
|
zPatchDatasetsByDatasetIdDocumentsStatusByActionPath,
|
|
zPatchDatasetsByDatasetIdDocumentsStatusByActionResponse,
|
|
zPatchDatasetsByDatasetIdMetadataByMetadataIdBody,
|
|
zPatchDatasetsByDatasetIdMetadataByMetadataIdPath,
|
|
zPatchDatasetsByDatasetIdMetadataByMetadataIdResponse,
|
|
zPatchDatasetsByDatasetIdPath,
|
|
zPatchDatasetsByDatasetIdResponse,
|
|
zPatchDatasetsTagsBody,
|
|
zPatchDatasetsTagsResponse,
|
|
zPostAppsAnnotationReplyByActionBody,
|
|
zPostAppsAnnotationReplyByActionPath,
|
|
zPostAppsAnnotationReplyByActionResponse,
|
|
zPostAppsAnnotationsBody,
|
|
zPostAppsAnnotationsResponse,
|
|
zPostAudioToTextResponse,
|
|
zPostChatMessagesBody,
|
|
zPostChatMessagesByTaskIdStopPath,
|
|
zPostChatMessagesByTaskIdStopResponse,
|
|
zPostChatMessagesResponse,
|
|
zPostCompletionMessagesBody,
|
|
zPostCompletionMessagesByTaskIdStopPath,
|
|
zPostCompletionMessagesByTaskIdStopResponse,
|
|
zPostCompletionMessagesResponse,
|
|
zPostConversationsByCIdNameBody,
|
|
zPostConversationsByCIdNamePath,
|
|
zPostConversationsByCIdNameResponse,
|
|
zPostDatasetsBody,
|
|
zPostDatasetsByDatasetIdDocumentCreateByFile2Path,
|
|
zPostDatasetsByDatasetIdDocumentCreateByFile2Response,
|
|
zPostDatasetsByDatasetIdDocumentCreateByFilePath,
|
|
zPostDatasetsByDatasetIdDocumentCreateByFileResponse,
|
|
zPostDatasetsByDatasetIdDocumentCreateByText2Body,
|
|
zPostDatasetsByDatasetIdDocumentCreateByText2Path,
|
|
zPostDatasetsByDatasetIdDocumentCreateByText2Response,
|
|
zPostDatasetsByDatasetIdDocumentCreateByTextBody,
|
|
zPostDatasetsByDatasetIdDocumentCreateByTextPath,
|
|
zPostDatasetsByDatasetIdDocumentCreateByTextResponse,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBody,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdBody,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksBody,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksPath,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsPath,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponse,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Path,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Response,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFilePath,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFileResponse,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Body,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Path,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Response,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextBody,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextPath,
|
|
zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextResponse,
|
|
zPostDatasetsByDatasetIdDocumentsDownloadZipBody,
|
|
zPostDatasetsByDatasetIdDocumentsDownloadZipPath,
|
|
zPostDatasetsByDatasetIdDocumentsDownloadZipResponse,
|
|
zPostDatasetsByDatasetIdDocumentsMetadataBody,
|
|
zPostDatasetsByDatasetIdDocumentsMetadataPath,
|
|
zPostDatasetsByDatasetIdDocumentsMetadataResponse,
|
|
zPostDatasetsByDatasetIdHitTestingBody,
|
|
zPostDatasetsByDatasetIdHitTestingPath,
|
|
zPostDatasetsByDatasetIdHitTestingResponse,
|
|
zPostDatasetsByDatasetIdMetadataBody,
|
|
zPostDatasetsByDatasetIdMetadataBuiltInByActionPath,
|
|
zPostDatasetsByDatasetIdMetadataBuiltInByActionResponse,
|
|
zPostDatasetsByDatasetIdMetadataPath,
|
|
zPostDatasetsByDatasetIdMetadataResponse,
|
|
zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunPath,
|
|
zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunResponse,
|
|
zPostDatasetsByDatasetIdPipelineRunPath,
|
|
zPostDatasetsByDatasetIdPipelineRunResponse,
|
|
zPostDatasetsByDatasetIdRetrieveBody,
|
|
zPostDatasetsByDatasetIdRetrievePath,
|
|
zPostDatasetsByDatasetIdRetrieveResponse,
|
|
zPostDatasetsPipelineFileUploadResponse,
|
|
zPostDatasetsResponse,
|
|
zPostDatasetsTagsBindingBody,
|
|
zPostDatasetsTagsBindingResponse,
|
|
zPostDatasetsTagsBody,
|
|
zPostDatasetsTagsResponse,
|
|
zPostDatasetsTagsUnbindingBody,
|
|
zPostDatasetsTagsUnbindingResponse,
|
|
zPostFilesUploadResponse,
|
|
zPostFormHumanInputByFormTokenBody,
|
|
zPostFormHumanInputByFormTokenPath,
|
|
zPostFormHumanInputByFormTokenResponse,
|
|
zPostMessagesByMessageIdFeedbacksBody,
|
|
zPostMessagesByMessageIdFeedbacksPath,
|
|
zPostMessagesByMessageIdFeedbacksResponse,
|
|
zPostTextToAudioBody,
|
|
zPostTextToAudioResponse,
|
|
zPostWorkflowsByWorkflowIdRunBody,
|
|
zPostWorkflowsByWorkflowIdRunPath,
|
|
zPostWorkflowsByWorkflowIdRunResponse,
|
|
zPostWorkflowsRunBody,
|
|
zPostWorkflowsRunResponse,
|
|
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,
|
|
}
|
|
|
|
/**
|
|
* Get all feedbacks for the application
|
|
*
|
|
* Get all feedbacks for the application
|
|
* Returns paginated list of all feedback submitted for messages in this app.
|
|
*/
|
|
export const get2 = oc
|
|
.route({
|
|
description:
|
|
'Get all feedbacks for the application\nReturns paginated list of all feedback submitted for messages in this app.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getAppFeedbacks',
|
|
path: '/app/feedbacks',
|
|
summary: 'Get all feedbacks for the application',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ query: zGetAppFeedbacksQuery.optional() }))
|
|
.output(zGetAppFeedbacksResponse)
|
|
|
|
export const feedbacks = {
|
|
get: get2,
|
|
}
|
|
|
|
export const app = {
|
|
feedbacks,
|
|
}
|
|
|
|
/**
|
|
* Get the status of an annotation reply action job
|
|
*
|
|
* Get the status of an annotation reply action job
|
|
*/
|
|
export const get3 = oc
|
|
.route({
|
|
description: 'Get the status of an annotation reply action job',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getAppsAnnotationReplyByActionStatusByJobId',
|
|
path: '/apps/annotation-reply/{action}/status/{job_id}',
|
|
summary: 'Get the status of an annotation reply action job',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zGetAppsAnnotationReplyByActionStatusByJobIdPath }))
|
|
.output(zGetAppsAnnotationReplyByActionStatusByJobIdResponse)
|
|
|
|
export const byJobId = {
|
|
get: get3,
|
|
}
|
|
|
|
export const status = {
|
|
byJobId,
|
|
}
|
|
|
|
/**
|
|
* Enable or disable annotation reply feature
|
|
*
|
|
* Enable or disable annotation reply feature
|
|
*/
|
|
export const post = oc
|
|
.route({
|
|
description: 'Enable or disable annotation reply feature',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postAppsAnnotationReplyByAction',
|
|
path: '/apps/annotation-reply/{action}',
|
|
summary: 'Enable or disable annotation reply feature',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostAppsAnnotationReplyByActionBody,
|
|
params: zPostAppsAnnotationReplyByActionPath,
|
|
}),
|
|
)
|
|
.output(zPostAppsAnnotationReplyByActionResponse)
|
|
|
|
export const byAction = {
|
|
post,
|
|
status,
|
|
}
|
|
|
|
export const annotationReply = {
|
|
byAction,
|
|
}
|
|
|
|
/**
|
|
* Delete an annotation
|
|
*
|
|
* Delete an annotation
|
|
*/
|
|
export const delete_ = oc
|
|
.route({
|
|
description: 'Delete an annotation',
|
|
inputStructure: 'detailed',
|
|
method: 'DELETE',
|
|
operationId: 'deleteAppsAnnotationsByAnnotationId',
|
|
path: '/apps/annotations/{annotation_id}',
|
|
successStatus: 204,
|
|
summary: 'Delete an annotation',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zDeleteAppsAnnotationsByAnnotationIdPath }))
|
|
.output(zDeleteAppsAnnotationsByAnnotationIdResponse)
|
|
|
|
/**
|
|
* Update an existing annotation
|
|
*
|
|
* Update an existing annotation
|
|
*/
|
|
export const put = oc
|
|
.route({
|
|
description: 'Update an existing annotation',
|
|
inputStructure: 'detailed',
|
|
method: 'PUT',
|
|
operationId: 'putAppsAnnotationsByAnnotationId',
|
|
path: '/apps/annotations/{annotation_id}',
|
|
summary: 'Update an existing annotation',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPutAppsAnnotationsByAnnotationIdBody,
|
|
params: zPutAppsAnnotationsByAnnotationIdPath,
|
|
}),
|
|
)
|
|
.output(zPutAppsAnnotationsByAnnotationIdResponse)
|
|
|
|
export const byAnnotationId = {
|
|
delete: delete_,
|
|
put,
|
|
}
|
|
|
|
/**
|
|
* List annotations for the application
|
|
*
|
|
* List annotations for the application
|
|
*/
|
|
export const get4 = oc
|
|
.route({
|
|
description: 'List annotations for the application',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getAppsAnnotations',
|
|
path: '/apps/annotations',
|
|
summary: 'List annotations for the application',
|
|
tags: ['service_api'],
|
|
})
|
|
.output(zGetAppsAnnotationsResponse)
|
|
|
|
/**
|
|
* Create a new annotation
|
|
*
|
|
* Create a new annotation
|
|
*/
|
|
export const post2 = oc
|
|
.route({
|
|
description: 'Create a new annotation',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postAppsAnnotations',
|
|
path: '/apps/annotations',
|
|
successStatus: 201,
|
|
summary: 'Create a new annotation',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ body: zPostAppsAnnotationsBody }))
|
|
.output(zPostAppsAnnotationsResponse)
|
|
|
|
export const annotations = {
|
|
get: get4,
|
|
post: post2,
|
|
byAnnotationId,
|
|
}
|
|
|
|
export const apps = {
|
|
annotationReply,
|
|
annotations,
|
|
}
|
|
|
|
/**
|
|
* Convert audio to text using speech-to-text
|
|
*
|
|
* Convert audio to text using speech-to-text
|
|
* Accepts an audio file upload and returns the transcribed text.
|
|
*/
|
|
export const post3 = oc
|
|
.route({
|
|
description:
|
|
'Convert audio to text using speech-to-text\nAccepts an audio file upload and returns the transcribed text.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postAudioToText',
|
|
path: '/audio-to-text',
|
|
summary: 'Convert audio to text using speech-to-text',
|
|
tags: ['service_api'],
|
|
})
|
|
.output(zPostAudioToTextResponse)
|
|
|
|
export const audioToText = {
|
|
post: post3,
|
|
}
|
|
|
|
/**
|
|
* Stop a running chat message generation
|
|
*
|
|
* Stop a running chat message generation
|
|
*/
|
|
export const post4 = oc
|
|
.route({
|
|
description: 'Stop a running chat message generation',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postChatMessagesByTaskIdStop',
|
|
path: '/chat-messages/{task_id}/stop',
|
|
summary: 'Stop a running chat message generation',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zPostChatMessagesByTaskIdStopPath }))
|
|
.output(zPostChatMessagesByTaskIdStopResponse)
|
|
|
|
export const stop = {
|
|
post: post4,
|
|
}
|
|
|
|
export const byTaskId = {
|
|
stop,
|
|
}
|
|
|
|
/**
|
|
* Send a message in a chat conversation
|
|
*
|
|
* Send a message in a chat conversation
|
|
* This endpoint handles chat messages for chat, agent chat, and advanced chat applications.
|
|
* Supports conversation management and both blocking and streaming response modes.
|
|
*/
|
|
export const post5 = oc
|
|
.route({
|
|
description:
|
|
'Send a message in a chat conversation\nThis endpoint handles chat messages for chat, agent chat, and advanced chat applications.\nSupports conversation management and both blocking and streaming response modes.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postChatMessages',
|
|
path: '/chat-messages',
|
|
summary: 'Send a message in a chat conversation',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ body: zPostChatMessagesBody }))
|
|
.output(zPostChatMessagesResponse)
|
|
|
|
export const chatMessages = {
|
|
post: post5,
|
|
byTaskId,
|
|
}
|
|
|
|
/**
|
|
* Stop a running completion task
|
|
*
|
|
* Stop a running completion task
|
|
*/
|
|
export const post6 = oc
|
|
.route({
|
|
description: 'Stop a running completion task',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postCompletionMessagesByTaskIdStop',
|
|
path: '/completion-messages/{task_id}/stop',
|
|
summary: 'Stop a running completion task',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zPostCompletionMessagesByTaskIdStopPath }))
|
|
.output(zPostCompletionMessagesByTaskIdStopResponse)
|
|
|
|
export const stop2 = {
|
|
post: post6,
|
|
}
|
|
|
|
export const byTaskId2 = {
|
|
stop: stop2,
|
|
}
|
|
|
|
/**
|
|
* Create a completion for the given prompt
|
|
*
|
|
* Create a completion for the given prompt
|
|
* This endpoint generates a completion based on the provided inputs and query.
|
|
* Supports both blocking and streaming response modes.
|
|
*/
|
|
export const post7 = oc
|
|
.route({
|
|
description:
|
|
'Create a completion for the given prompt\nThis endpoint generates a completion based on the provided inputs and query.\nSupports both blocking and streaming response modes.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postCompletionMessages',
|
|
path: '/completion-messages',
|
|
summary: 'Create a completion for the given prompt',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ body: zPostCompletionMessagesBody }))
|
|
.output(zPostCompletionMessagesResponse)
|
|
|
|
export const completionMessages = {
|
|
post: post7,
|
|
byTaskId: byTaskId2,
|
|
}
|
|
|
|
/**
|
|
* Rename a conversation or auto-generate a name
|
|
*
|
|
* Rename a conversation or auto-generate a name
|
|
*/
|
|
export const post8 = oc
|
|
.route({
|
|
description: 'Rename a conversation or auto-generate a name',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postConversationsByCIdName',
|
|
path: '/conversations/{c_id}/name',
|
|
summary: 'Rename a conversation or auto-generate a name',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({ body: zPostConversationsByCIdNameBody, params: zPostConversationsByCIdNamePath }),
|
|
)
|
|
.output(zPostConversationsByCIdNameResponse)
|
|
|
|
export const name = {
|
|
post: post8,
|
|
}
|
|
|
|
/**
|
|
* Update a conversation variable's value
|
|
*
|
|
* Update a conversation variable's value
|
|
* Allows updating the value of a specific conversation variable.
|
|
* The value must match the variable's expected type.
|
|
*/
|
|
export const put2 = oc
|
|
.route({
|
|
description:
|
|
'Update a conversation variable\'s value\nAllows updating the value of a specific conversation variable.\nThe value must match the variable\'s expected type.',
|
|
inputStructure: 'detailed',
|
|
method: 'PUT',
|
|
operationId: 'putConversationsByCIdVariablesByVariableId',
|
|
path: '/conversations/{c_id}/variables/{variable_id}',
|
|
summary: 'Update a conversation variable\'s value',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPutConversationsByCIdVariablesByVariableIdBody,
|
|
params: zPutConversationsByCIdVariablesByVariableIdPath,
|
|
}),
|
|
)
|
|
.output(zPutConversationsByCIdVariablesByVariableIdResponse)
|
|
|
|
export const byVariableId = {
|
|
put: put2,
|
|
}
|
|
|
|
/**
|
|
* List all variables for a conversation
|
|
*
|
|
* List all variables for a conversation
|
|
* Conversational variables are only available for chat applications.
|
|
*/
|
|
export const get5 = oc
|
|
.route({
|
|
description:
|
|
'List all variables for a conversation\nConversational variables are only available for chat applications.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getConversationsByCIdVariables',
|
|
path: '/conversations/{c_id}/variables',
|
|
summary: 'List all variables for a conversation',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
params: zGetConversationsByCIdVariablesPath,
|
|
query: zGetConversationsByCIdVariablesQuery.optional(),
|
|
}),
|
|
)
|
|
.output(zGetConversationsByCIdVariablesResponse)
|
|
|
|
export const variables = {
|
|
get: get5,
|
|
byVariableId,
|
|
}
|
|
|
|
/**
|
|
* Delete a specific conversation
|
|
*
|
|
* Delete a specific conversation
|
|
*/
|
|
export const delete2 = oc
|
|
.route({
|
|
description: 'Delete a specific conversation',
|
|
inputStructure: 'detailed',
|
|
method: 'DELETE',
|
|
operationId: 'deleteConversationsByCId',
|
|
path: '/conversations/{c_id}',
|
|
successStatus: 204,
|
|
summary: 'Delete a specific conversation',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zDeleteConversationsByCIdPath }))
|
|
.output(zDeleteConversationsByCIdResponse)
|
|
|
|
export const byCId = {
|
|
delete: delete2,
|
|
name,
|
|
variables,
|
|
}
|
|
|
|
/**
|
|
* List all conversations for the current user
|
|
*
|
|
* List all conversations for the current user
|
|
* Supports pagination using last_id and limit parameters.
|
|
*/
|
|
export const get6 = oc
|
|
.route({
|
|
description:
|
|
'List all conversations for the current user\nSupports pagination using last_id and limit parameters.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getConversations',
|
|
path: '/conversations',
|
|
summary: 'List all conversations for the current user',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ query: zGetConversationsQuery.optional() }))
|
|
.output(zGetConversationsResponse)
|
|
|
|
export const conversations = {
|
|
get: get6,
|
|
byCId,
|
|
}
|
|
|
|
/**
|
|
* Upload a file for use in conversations
|
|
*
|
|
* Upload a file to a knowledgebase pipeline
|
|
* Accepts a single file upload via multipart/form-data.
|
|
*/
|
|
export const post9 = oc
|
|
.route({
|
|
description:
|
|
'Upload a file to a knowledgebase pipeline\nAccepts a single file upload via multipart/form-data.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsPipelineFileUpload',
|
|
path: '/datasets/pipeline/file-upload',
|
|
successStatus: 201,
|
|
summary: 'Upload a file for use in conversations',
|
|
tags: ['service_api'],
|
|
})
|
|
.output(zPostDatasetsPipelineFileUploadResponse)
|
|
|
|
export const fileUpload = {
|
|
post: post9,
|
|
}
|
|
|
|
export const pipeline = {
|
|
fileUpload,
|
|
}
|
|
|
|
/**
|
|
* Bind tags to a dataset
|
|
*/
|
|
export const post10 = oc
|
|
.route({
|
|
description: 'Bind tags to a dataset',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsTagsBinding',
|
|
path: '/datasets/tags/binding',
|
|
successStatus: 204,
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ body: zPostDatasetsTagsBindingBody }))
|
|
.output(zPostDatasetsTagsBindingResponse)
|
|
|
|
export const binding = {
|
|
post: post10,
|
|
}
|
|
|
|
/**
|
|
* Unbind a tag from a dataset
|
|
*/
|
|
export const post11 = oc
|
|
.route({
|
|
description: 'Unbind a tag from a dataset',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsTagsUnbinding',
|
|
path: '/datasets/tags/unbinding',
|
|
successStatus: 204,
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ body: zPostDatasetsTagsUnbindingBody }))
|
|
.output(zPostDatasetsTagsUnbindingResponse)
|
|
|
|
export const unbinding = {
|
|
post: post11,
|
|
}
|
|
|
|
/**
|
|
* Delete a knowledge type tag
|
|
*
|
|
* Delete a knowledge type tag
|
|
*/
|
|
export const delete3 = oc
|
|
.route({
|
|
description: 'Delete a knowledge type tag',
|
|
inputStructure: 'detailed',
|
|
method: 'DELETE',
|
|
operationId: 'deleteDatasetsTags',
|
|
path: '/datasets/tags',
|
|
successStatus: 204,
|
|
summary: 'Delete a knowledge type tag',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ body: zDeleteDatasetsTagsBody }))
|
|
.output(zDeleteDatasetsTagsResponse)
|
|
|
|
/**
|
|
* Get all knowledge type tags
|
|
*
|
|
* Get all knowledge type tags
|
|
*/
|
|
export const get7 = oc
|
|
.route({
|
|
description: 'Get all knowledge type tags',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDatasetsTags',
|
|
path: '/datasets/tags',
|
|
summary: 'Get all knowledge type tags',
|
|
tags: ['service_api'],
|
|
})
|
|
.output(zGetDatasetsTagsResponse)
|
|
|
|
/**
|
|
* Update a knowledge type tag
|
|
*/
|
|
export const patch = oc
|
|
.route({
|
|
description: 'Update a knowledge type tag',
|
|
inputStructure: 'detailed',
|
|
method: 'PATCH',
|
|
operationId: 'patchDatasetsTags',
|
|
path: '/datasets/tags',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ body: zPatchDatasetsTagsBody }))
|
|
.output(zPatchDatasetsTagsResponse)
|
|
|
|
/**
|
|
* Add a knowledge type tag
|
|
*
|
|
* Add a knowledge type tag
|
|
*/
|
|
export const post12 = oc
|
|
.route({
|
|
description: 'Add a knowledge type tag',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsTags',
|
|
path: '/datasets/tags',
|
|
summary: 'Add a knowledge type tag',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ body: zPostDatasetsTagsBody }))
|
|
.output(zPostDatasetsTagsResponse)
|
|
|
|
export const tags = {
|
|
delete: delete3,
|
|
get: get7,
|
|
patch,
|
|
post: post12,
|
|
binding,
|
|
unbinding,
|
|
}
|
|
|
|
/**
|
|
* Create a new document by uploading a file
|
|
*/
|
|
export const post13 = oc
|
|
.route({
|
|
description: 'Create a new document by uploading a file',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdDocumentCreateByFile',
|
|
path: '/datasets/{dataset_id}/document/create-by-file',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zPostDatasetsByDatasetIdDocumentCreateByFilePath }))
|
|
.output(zPostDatasetsByDatasetIdDocumentCreateByFileResponse)
|
|
|
|
/**
|
|
* Create a new document by uploading a file
|
|
*/
|
|
export const post14 = oc
|
|
.route({
|
|
description: 'Create a new document by uploading a file',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdDocumentCreateByFile',
|
|
path: '/datasets/{dataset_id}/document/create_by_file',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zPostDatasetsByDatasetIdDocumentCreateByFile2Path }))
|
|
.output(zPostDatasetsByDatasetIdDocumentCreateByFile2Response)
|
|
|
|
export const createByFile = {
|
|
post: post14,
|
|
}
|
|
|
|
/**
|
|
* Create a new document by providing text content
|
|
*/
|
|
export const post15 = oc
|
|
.route({
|
|
description: 'Create a new document by providing text content',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdDocumentCreateByText',
|
|
path: '/datasets/{dataset_id}/document/create-by-text',
|
|
tags: ['service_api'],
|
|
})
|
|
.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 selected uploaded documents as a single ZIP archive
|
|
*/
|
|
export const post17 = oc
|
|
.route({
|
|
description: 'Download selected uploaded documents as a single ZIP archive',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdDocumentsDownloadZip',
|
|
path: '/datasets/{dataset_id}/documents/download-zip',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostDatasetsByDatasetIdDocumentsDownloadZipBody,
|
|
params: zPostDatasetsByDatasetIdDocumentsDownloadZipPath,
|
|
}),
|
|
)
|
|
.output(zPostDatasetsByDatasetIdDocumentsDownloadZipResponse)
|
|
|
|
export const downloadZip = {
|
|
post: post17,
|
|
}
|
|
|
|
/**
|
|
* Update metadata for multiple documents
|
|
*
|
|
* Update metadata for multiple documents
|
|
*/
|
|
export const post18 = oc
|
|
.route({
|
|
description: 'Update metadata for multiple documents',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdDocumentsMetadata',
|
|
path: '/datasets/{dataset_id}/documents/metadata',
|
|
summary: 'Update metadata for multiple documents',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostDatasetsByDatasetIdDocumentsMetadataBody,
|
|
params: zPostDatasetsByDatasetIdDocumentsMetadataPath,
|
|
}),
|
|
)
|
|
.output(zPostDatasetsByDatasetIdDocumentsMetadataResponse)
|
|
|
|
export const metadata = {
|
|
post: post18,
|
|
}
|
|
|
|
/**
|
|
* Batch update document status
|
|
*
|
|
* Batch update document status
|
|
* Args:
|
|
* tenant_id: tenant id
|
|
* dataset_id: dataset id
|
|
* action: action to perform (Literal["enable", "disable", "archive", "un_archive"])
|
|
*
|
|
* Returns:
|
|
* dict: A dictionary with a key 'result' and a value 'success'
|
|
* int: HTTP status code 200 indicating that the operation was successful.
|
|
*
|
|
* Raises:
|
|
* NotFound: If the dataset with the given ID does not exist.
|
|
* Forbidden: If the user does not have permission.
|
|
* InvalidActionError: If the action is invalid or cannot be performed.
|
|
*/
|
|
export const patch2 = oc
|
|
.route({
|
|
description:
|
|
'Batch update document status\nArgs:\n tenant_id: tenant id\n dataset_id: dataset id\n action: action to perform (Literal["enable", "disable", "archive", "un_archive"])\n\nReturns:\n dict: A dictionary with a key \'result\' and a value \'success\'\n int: HTTP status code 200 indicating that the operation was successful.\n\nRaises:\n NotFound: If the dataset with the given ID does not exist.\n Forbidden: If the user does not have permission.\n InvalidActionError: If the action is invalid or cannot be performed.',
|
|
inputStructure: 'detailed',
|
|
method: 'PATCH',
|
|
operationId: 'patchDatasetsByDatasetIdDocumentsStatusByAction',
|
|
path: '/datasets/{dataset_id}/documents/status/{action}',
|
|
summary: 'Batch update document status',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zPatchDatasetsByDatasetIdDocumentsStatusByActionPath }))
|
|
.output(zPatchDatasetsByDatasetIdDocumentsStatusByActionResponse)
|
|
|
|
export const byAction2 = {
|
|
patch: patch2,
|
|
}
|
|
|
|
export const status2 = {
|
|
byAction: byAction2,
|
|
}
|
|
|
|
/**
|
|
* Get indexing status for documents in a batch
|
|
*/
|
|
export const get8 = oc
|
|
.route({
|
|
description: 'Get indexing status for documents in a batch',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDatasetsByDatasetIdDocumentsByBatchIndexingStatus',
|
|
path: '/datasets/{dataset_id}/documents/{batch}/indexing-status',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zGetDatasetsByDatasetIdDocumentsByBatchIndexingStatusPath }))
|
|
.output(zGetDatasetsByDatasetIdDocumentsByBatchIndexingStatusResponse)
|
|
|
|
export const indexingStatus = {
|
|
get: get8,
|
|
}
|
|
|
|
export const byBatch = {
|
|
indexingStatus,
|
|
}
|
|
|
|
/**
|
|
* 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',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadPath }))
|
|
.output(zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadResponse)
|
|
|
|
export const download = {
|
|
get: get9,
|
|
}
|
|
|
|
/**
|
|
* Delete a specific child chunk
|
|
*/
|
|
export const delete4 = oc
|
|
.route({
|
|
description: 'Delete a specific child chunk',
|
|
inputStructure: 'detailed',
|
|
method: 'DELETE',
|
|
operationId:
|
|
'deleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkId',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}',
|
|
successStatus: 204,
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
params:
|
|
zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath,
|
|
}),
|
|
)
|
|
.output(
|
|
zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse,
|
|
)
|
|
|
|
/**
|
|
* Update a specific child chunk
|
|
*/
|
|
export const patch3 = oc
|
|
.route({
|
|
description: 'Update a specific child chunk',
|
|
inputStructure: 'detailed',
|
|
method: 'PATCH',
|
|
operationId:
|
|
'patchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkId',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdBody,
|
|
params:
|
|
zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath,
|
|
}),
|
|
)
|
|
.output(
|
|
zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse,
|
|
)
|
|
|
|
export const byChildChunkId = {
|
|
delete: delete4,
|
|
patch: patch3,
|
|
}
|
|
|
|
/**
|
|
* List child chunks for a segment
|
|
*/
|
|
export const get10 = oc
|
|
.route({
|
|
description: 'List child chunks for a segment',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunks',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
params: zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksPath,
|
|
query:
|
|
zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksQuery.optional(),
|
|
}),
|
|
)
|
|
.output(zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse)
|
|
|
|
/**
|
|
* Create a new child chunk for a segment
|
|
*/
|
|
export const post19 = oc
|
|
.route({
|
|
description: 'Create a new child chunk for a segment',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunks',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksBody,
|
|
params: zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksPath,
|
|
}),
|
|
)
|
|
.output(zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse)
|
|
|
|
export const childChunks = {
|
|
get: get10,
|
|
post: post19,
|
|
byChildChunkId,
|
|
}
|
|
|
|
/**
|
|
* Delete a specific segment
|
|
*/
|
|
export const delete5 = oc
|
|
.route({
|
|
description: 'Delete a specific segment',
|
|
inputStructure: 'detailed',
|
|
method: 'DELETE',
|
|
operationId: 'deleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentId',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}',
|
|
successStatus: 204,
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({ params: zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath }),
|
|
)
|
|
.output(zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse)
|
|
|
|
/**
|
|
* Get a specific segment by ID
|
|
*/
|
|
export const get11 = oc
|
|
.route({
|
|
description: 'Get a specific segment by ID',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentId',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath }))
|
|
.output(zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse)
|
|
|
|
/**
|
|
* Update a specific segment
|
|
*/
|
|
export const post20 = oc
|
|
.route({
|
|
description: 'Update a specific segment',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentId',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdBody,
|
|
params: zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath,
|
|
}),
|
|
)
|
|
.output(zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse)
|
|
|
|
export const bySegmentId = {
|
|
delete: delete5,
|
|
get: get11,
|
|
post: post20,
|
|
childChunks,
|
|
}
|
|
|
|
/**
|
|
* List segments in a document
|
|
*/
|
|
export const get12 = oc
|
|
.route({
|
|
description: 'List segments in a document',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDatasetsByDatasetIdDocumentsByDocumentIdSegments',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}/segments',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
params: zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsPath,
|
|
query: zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsQuery.optional(),
|
|
}),
|
|
)
|
|
.output(zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponse)
|
|
|
|
/**
|
|
* Create segments in a document
|
|
*/
|
|
export const post21 = oc
|
|
.route({
|
|
description: 'Create segments in a document',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdSegments',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}/segments',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBody,
|
|
params: zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsPath,
|
|
}),
|
|
)
|
|
.output(zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponse)
|
|
|
|
export const segments = {
|
|
get: get12,
|
|
post: post21,
|
|
bySegmentId,
|
|
}
|
|
|
|
/**
|
|
* Deprecated legacy alias for updating an existing document by uploading a file. Use PATCH /datasets/{dataset_id}/documents/{document_id} instead.
|
|
*
|
|
* @deprecated
|
|
*/
|
|
export const post22 = oc
|
|
.route({
|
|
deprecated: true,
|
|
description:
|
|
'Deprecated legacy alias for updating an existing document by uploading a file. Use PATCH /datasets/{dataset_id}/documents/{document_id} instead.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}/update-by-file',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFilePath }))
|
|
.output(zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFileResponse)
|
|
|
|
/**
|
|
* Deprecated legacy alias for updating an existing document by uploading a file. Use PATCH /datasets/{dataset_id}/documents/{document_id} instead.
|
|
*
|
|
* @deprecated
|
|
*/
|
|
export const post23 = oc
|
|
.route({
|
|
deprecated: true,
|
|
description:
|
|
'Deprecated legacy alias for updating an existing document by uploading a file. Use PATCH /datasets/{dataset_id}/documents/{document_id} instead.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}/update_by_file',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Path }))
|
|
.output(zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Response)
|
|
|
|
export const updateByFile = {
|
|
post: post23,
|
|
}
|
|
|
|
/**
|
|
* Update an existing document by providing text content
|
|
*/
|
|
export const post24 = oc
|
|
.route({
|
|
description: 'Update an existing document by providing text content',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}/update-by-text',
|
|
tags: ['service_api'],
|
|
})
|
|
.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
|
|
*
|
|
* Delete a document
|
|
*/
|
|
export const delete6 = oc
|
|
.route({
|
|
description: 'Delete a document',
|
|
inputStructure: 'detailed',
|
|
method: 'DELETE',
|
|
operationId: 'deleteDatasetsByDatasetIdDocumentsByDocumentId',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}',
|
|
successStatus: 204,
|
|
summary: 'Delete document',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zDeleteDatasetsByDatasetIdDocumentsByDocumentIdPath }))
|
|
.output(zDeleteDatasetsByDatasetIdDocumentsByDocumentIdResponse)
|
|
|
|
/**
|
|
* Get a specific document by ID
|
|
*/
|
|
export const get13 = oc
|
|
.route({
|
|
description: 'Get a specific document by ID',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDatasetsByDatasetIdDocumentsByDocumentId',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zGetDatasetsByDatasetIdDocumentsByDocumentIdPath }))
|
|
.output(zGetDatasetsByDatasetIdDocumentsByDocumentIdResponse)
|
|
|
|
/**
|
|
* Update an existing document by uploading a file
|
|
*/
|
|
export const patch4 = oc
|
|
.route({
|
|
description: 'Update an existing document by uploading a file',
|
|
inputStructure: 'detailed',
|
|
method: 'PATCH',
|
|
operationId: 'patchDatasetsByDatasetIdDocumentsByDocumentId',
|
|
path: '/datasets/{dataset_id}/documents/{document_id}',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zPatchDatasetsByDatasetIdDocumentsByDocumentIdPath }))
|
|
.output(zPatchDatasetsByDatasetIdDocumentsByDocumentIdResponse)
|
|
|
|
export const byDocumentId = {
|
|
delete: delete6,
|
|
get: get13,
|
|
patch: patch4,
|
|
download,
|
|
segments,
|
|
updateByFile,
|
|
updateByText,
|
|
}
|
|
|
|
/**
|
|
* List all documents in a dataset
|
|
*/
|
|
export const get14 = oc
|
|
.route({
|
|
description: 'List all documents in a dataset',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDatasetsByDatasetIdDocuments',
|
|
path: '/datasets/{dataset_id}/documents',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zGetDatasetsByDatasetIdDocumentsPath }))
|
|
.output(zGetDatasetsByDatasetIdDocumentsResponse)
|
|
|
|
export const documents = {
|
|
get: get14,
|
|
downloadZip,
|
|
metadata,
|
|
status: status2,
|
|
byBatch,
|
|
byDocumentId,
|
|
}
|
|
|
|
/**
|
|
* Perform hit testing on a dataset
|
|
*
|
|
* Perform hit testing on a dataset
|
|
* Tests retrieval performance for the specified dataset.
|
|
*/
|
|
export const post26 = oc
|
|
.route({
|
|
description:
|
|
'Perform hit testing on a dataset\nTests retrieval performance for the specified dataset.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdHitTesting',
|
|
path: '/datasets/{dataset_id}/hit-testing',
|
|
summary: 'Perform hit testing on a dataset',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostDatasetsByDatasetIdHitTestingBody,
|
|
params: zPostDatasetsByDatasetIdHitTestingPath,
|
|
}),
|
|
)
|
|
.output(zPostDatasetsByDatasetIdHitTestingResponse)
|
|
|
|
export const hitTesting = {
|
|
post: post26,
|
|
}
|
|
|
|
/**
|
|
* Enable or disable built-in metadata field
|
|
*
|
|
* Enable or disable built-in metadata field
|
|
*/
|
|
export const post27 = oc
|
|
.route({
|
|
description: 'Enable or disable built-in metadata field',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdMetadataBuiltInByAction',
|
|
path: '/datasets/{dataset_id}/metadata/built-in/{action}',
|
|
summary: 'Enable or disable built-in metadata field',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zPostDatasetsByDatasetIdMetadataBuiltInByActionPath }))
|
|
.output(zPostDatasetsByDatasetIdMetadataBuiltInByActionResponse)
|
|
|
|
export const byAction3 = {
|
|
post: post27,
|
|
}
|
|
|
|
/**
|
|
* Get all built-in metadata fields
|
|
*
|
|
* Get all built-in metadata fields
|
|
*/
|
|
export const get15 = oc
|
|
.route({
|
|
description: 'Get all built-in metadata fields',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDatasetsByDatasetIdMetadataBuiltIn',
|
|
path: '/datasets/{dataset_id}/metadata/built-in',
|
|
summary: 'Get all built-in metadata fields',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zGetDatasetsByDatasetIdMetadataBuiltInPath }))
|
|
.output(zGetDatasetsByDatasetIdMetadataBuiltInResponse)
|
|
|
|
export const builtIn = {
|
|
get: get15,
|
|
byAction: byAction3,
|
|
}
|
|
|
|
/**
|
|
* Delete metadata
|
|
*
|
|
* Delete metadata
|
|
*/
|
|
export const delete7 = oc
|
|
.route({
|
|
description: 'Delete metadata',
|
|
inputStructure: 'detailed',
|
|
method: 'DELETE',
|
|
operationId: 'deleteDatasetsByDatasetIdMetadataByMetadataId',
|
|
path: '/datasets/{dataset_id}/metadata/{metadata_id}',
|
|
successStatus: 204,
|
|
summary: 'Delete metadata',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zDeleteDatasetsByDatasetIdMetadataByMetadataIdPath }))
|
|
.output(zDeleteDatasetsByDatasetIdMetadataByMetadataIdResponse)
|
|
|
|
/**
|
|
* Update metadata name
|
|
*
|
|
* Update metadata name
|
|
*/
|
|
export const patch5 = oc
|
|
.route({
|
|
description: 'Update metadata name',
|
|
inputStructure: 'detailed',
|
|
method: 'PATCH',
|
|
operationId: 'patchDatasetsByDatasetIdMetadataByMetadataId',
|
|
path: '/datasets/{dataset_id}/metadata/{metadata_id}',
|
|
summary: 'Update metadata name',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPatchDatasetsByDatasetIdMetadataByMetadataIdBody,
|
|
params: zPatchDatasetsByDatasetIdMetadataByMetadataIdPath,
|
|
}),
|
|
)
|
|
.output(zPatchDatasetsByDatasetIdMetadataByMetadataIdResponse)
|
|
|
|
export const byMetadataId = {
|
|
delete: delete7,
|
|
patch: patch5,
|
|
}
|
|
|
|
/**
|
|
* Get all metadata for a dataset
|
|
*
|
|
* Get all metadata for a dataset
|
|
*/
|
|
export const get16 = oc
|
|
.route({
|
|
description: 'Get all metadata for a dataset',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDatasetsByDatasetIdMetadata',
|
|
path: '/datasets/{dataset_id}/metadata',
|
|
summary: 'Get all metadata for a dataset',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zGetDatasetsByDatasetIdMetadataPath }))
|
|
.output(zGetDatasetsByDatasetIdMetadataResponse)
|
|
|
|
/**
|
|
* Create metadata for a dataset
|
|
*
|
|
* Create metadata for a dataset
|
|
*/
|
|
export const post28 = oc
|
|
.route({
|
|
description: 'Create metadata for a dataset',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdMetadata',
|
|
path: '/datasets/{dataset_id}/metadata',
|
|
successStatus: 201,
|
|
summary: 'Create metadata for a dataset',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostDatasetsByDatasetIdMetadataBody,
|
|
params: zPostDatasetsByDatasetIdMetadataPath,
|
|
}),
|
|
)
|
|
.output(zPostDatasetsByDatasetIdMetadataResponse)
|
|
|
|
export const metadata2 = {
|
|
get: get16,
|
|
post: post28,
|
|
builtIn,
|
|
byMetadataId,
|
|
}
|
|
|
|
/**
|
|
* Resource for getting datasource plugins
|
|
*
|
|
* List all datasource plugins for a rag pipeline
|
|
*/
|
|
export const get17 = oc
|
|
.route({
|
|
description: 'List all datasource plugins for a rag pipeline',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDatasetsByDatasetIdPipelineDatasourcePlugins',
|
|
path: '/datasets/{dataset_id}/pipeline/datasource-plugins',
|
|
summary: 'Resource for getting datasource plugins',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
params: zGetDatasetsByDatasetIdPipelineDatasourcePluginsPath,
|
|
query: zGetDatasetsByDatasetIdPipelineDatasourcePluginsQuery.optional(),
|
|
}),
|
|
)
|
|
.output(zGetDatasetsByDatasetIdPipelineDatasourcePluginsResponse)
|
|
|
|
export const datasourcePlugins = {
|
|
get: get17,
|
|
}
|
|
|
|
/**
|
|
* Resource for getting datasource plugins
|
|
*
|
|
* Run a datasource node for a rag pipeline
|
|
*/
|
|
export const post29 = oc
|
|
.route({
|
|
description: 'Run a datasource node for a rag pipeline',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRun',
|
|
path: '/datasets/{dataset_id}/pipeline/datasource/nodes/{node_id}/run',
|
|
summary: 'Resource for getting datasource plugins',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunPath }))
|
|
.output(zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunResponse)
|
|
|
|
export const run = {
|
|
post: post29,
|
|
}
|
|
|
|
export const byNodeId = {
|
|
run,
|
|
}
|
|
|
|
export const nodes = {
|
|
byNodeId,
|
|
}
|
|
|
|
export const datasource = {
|
|
nodes,
|
|
}
|
|
|
|
/**
|
|
* Resource for running a rag pipeline
|
|
*
|
|
* Run a datasource node for a rag pipeline
|
|
*/
|
|
export const post30 = oc
|
|
.route({
|
|
description: 'Run a datasource node for a rag pipeline',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdPipelineRun',
|
|
path: '/datasets/{dataset_id}/pipeline/run',
|
|
summary: 'Resource for running a rag pipeline',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zPostDatasetsByDatasetIdPipelineRunPath }))
|
|
.output(zPostDatasetsByDatasetIdPipelineRunResponse)
|
|
|
|
export const run2 = {
|
|
post: post30,
|
|
}
|
|
|
|
export const pipeline2 = {
|
|
datasourcePlugins,
|
|
datasource,
|
|
run: run2,
|
|
}
|
|
|
|
/**
|
|
* Perform hit testing on a dataset
|
|
*
|
|
* Perform hit testing on a dataset
|
|
* Tests retrieval performance for the specified dataset.
|
|
*/
|
|
export const post31 = oc
|
|
.route({
|
|
description:
|
|
'Perform hit testing on a dataset\nTests retrieval performance for the specified dataset.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasetsByDatasetIdRetrieve',
|
|
path: '/datasets/{dataset_id}/retrieve',
|
|
summary: 'Perform hit testing on a dataset',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostDatasetsByDatasetIdRetrieveBody,
|
|
params: zPostDatasetsByDatasetIdRetrievePath,
|
|
}),
|
|
)
|
|
.output(zPostDatasetsByDatasetIdRetrieveResponse)
|
|
|
|
export const retrieve = {
|
|
post: post31,
|
|
}
|
|
|
|
/**
|
|
* Get all knowledge type tags
|
|
*
|
|
* Get tags bound to a specific dataset
|
|
*/
|
|
export const get18 = oc
|
|
.route({
|
|
description: 'Get tags bound to a specific dataset',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDatasetsByDatasetIdTags',
|
|
path: '/datasets/{dataset_id}/tags',
|
|
summary: 'Get all knowledge type tags',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zGetDatasetsByDatasetIdTagsPath }))
|
|
.output(zGetDatasetsByDatasetIdTagsResponse)
|
|
|
|
export const tags2 = {
|
|
get: get18,
|
|
}
|
|
|
|
/**
|
|
* Deletes a dataset given its ID
|
|
*
|
|
* Delete a dataset
|
|
* Args:
|
|
* _: ignore
|
|
* dataset_id (UUID): The ID of the dataset to be deleted.
|
|
*
|
|
* Returns:
|
|
* dict: A dictionary with a key 'result' and a value 'success'
|
|
* if the dataset was successfully deleted. Omitted in HTTP response.
|
|
* int: HTTP status code 204 indicating that the operation was successful.
|
|
*
|
|
* Raises:
|
|
* NotFound: If the dataset with the given ID does not exist.
|
|
*/
|
|
export const delete8 = oc
|
|
.route({
|
|
description:
|
|
'Delete a dataset\nArgs:\n _: ignore\n dataset_id (UUID): The ID of the dataset to be deleted.\n\nReturns:\n dict: A dictionary with a key \'result\' and a value \'success\'\n if the dataset was successfully deleted. Omitted in HTTP response.\n int: HTTP status code 204 indicating that the operation was successful.\n\nRaises:\n NotFound: If the dataset with the given ID does not exist.',
|
|
inputStructure: 'detailed',
|
|
method: 'DELETE',
|
|
operationId: 'deleteDatasetsByDatasetId',
|
|
path: '/datasets/{dataset_id}',
|
|
successStatus: 204,
|
|
summary: 'Deletes a dataset given its ID',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zDeleteDatasetsByDatasetIdPath }))
|
|
.output(zDeleteDatasetsByDatasetIdResponse)
|
|
|
|
/**
|
|
* Get a specific dataset by ID
|
|
*/
|
|
export const get19 = oc
|
|
.route({
|
|
description: 'Get a specific dataset by ID',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDatasetsByDatasetId',
|
|
path: '/datasets/{dataset_id}',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zGetDatasetsByDatasetIdPath }))
|
|
.output(zGetDatasetsByDatasetIdResponse)
|
|
|
|
/**
|
|
* Update an existing dataset
|
|
*/
|
|
export const patch6 = oc
|
|
.route({
|
|
description: 'Update an existing dataset',
|
|
inputStructure: 'detailed',
|
|
method: 'PATCH',
|
|
operationId: 'patchDatasetsByDatasetId',
|
|
path: '/datasets/{dataset_id}',
|
|
tags: ['service_api'],
|
|
})
|
|
.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,
|
|
}
|
|
|
|
/**
|
|
* Resource for getting datasets
|
|
*
|
|
* List all datasets
|
|
*/
|
|
export const get20 = oc
|
|
.route({
|
|
description: 'List all datasets',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDatasets',
|
|
path: '/datasets',
|
|
summary: 'Resource for getting datasets',
|
|
tags: ['service_api'],
|
|
})
|
|
.output(zGetDatasetsResponse)
|
|
|
|
/**
|
|
* Resource for creating datasets
|
|
*
|
|
* Create a new dataset
|
|
*/
|
|
export const post32 = oc
|
|
.route({
|
|
description: 'Create a new dataset',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDatasets',
|
|
path: '/datasets',
|
|
summary: 'Resource for creating datasets',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ body: zPostDatasetsBody }))
|
|
.output(zPostDatasetsResponse)
|
|
|
|
export const datasets = {
|
|
get: get20,
|
|
post: post32,
|
|
pipeline,
|
|
tags,
|
|
byDatasetId,
|
|
}
|
|
|
|
/**
|
|
* Get end user detail
|
|
*
|
|
* Get an end user by ID
|
|
* This endpoint is scoped to the current app token's tenant/app to prevent
|
|
* cross-tenant/app access when an end-user ID is known.
|
|
*/
|
|
export const get21 = oc
|
|
.route({
|
|
description:
|
|
'Get an end user by ID\nThis endpoint is scoped to the current app token\'s tenant/app to prevent\ncross-tenant/app access when an end-user ID is known.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getEndUsersByEndUserId',
|
|
path: '/end-users/{end_user_id}',
|
|
summary: 'Get end user detail',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zGetEndUsersByEndUserIdPath }))
|
|
.output(zGetEndUsersByEndUserIdResponse)
|
|
|
|
export const byEndUserId = {
|
|
get: get21,
|
|
}
|
|
|
|
export const endUsers = {
|
|
byEndUserId,
|
|
}
|
|
|
|
/**
|
|
* Upload a file for use in conversations
|
|
*
|
|
* Upload a file for use in conversations
|
|
* Accepts a single file upload via multipart/form-data.
|
|
*/
|
|
export const post33 = oc
|
|
.route({
|
|
description:
|
|
'Upload a file for use in conversations\nAccepts a single file upload via multipart/form-data.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postFilesUpload',
|
|
path: '/files/upload',
|
|
successStatus: 201,
|
|
summary: 'Upload a file for use in conversations',
|
|
tags: ['service_api'],
|
|
})
|
|
.output(zPostFilesUploadResponse)
|
|
|
|
export const upload = {
|
|
post: post33,
|
|
}
|
|
|
|
/**
|
|
* Preview/Download a file that was uploaded via Service API
|
|
*
|
|
* Preview or download a file uploaded via Service API
|
|
* Provides secure file preview/download functionality.
|
|
* Files can only be accessed if they belong to messages within the requesting app's context.
|
|
*/
|
|
export const get22 = oc
|
|
.route({
|
|
description:
|
|
'Preview or download a file uploaded via Service API\nProvides secure file preview/download functionality.\nFiles can only be accessed if they belong to messages within the requesting app\'s context.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getFilesByFileIdPreview',
|
|
path: '/files/{file_id}/preview',
|
|
summary: 'Preview/Download a file that was uploaded via Service API',
|
|
tags: ['service_api'],
|
|
})
|
|
.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 a paused human input form by token
|
|
*/
|
|
export const get23 = oc
|
|
.route({
|
|
description: 'Get a paused human input form by token',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getFormHumanInputByFormToken',
|
|
path: '/form/human_input/{form_token}',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zGetFormHumanInputByFormTokenPath }))
|
|
.output(zGetFormHumanInputByFormTokenResponse)
|
|
|
|
/**
|
|
* Submit a paused human input form by token
|
|
*/
|
|
export const post34 = oc
|
|
.route({
|
|
description: 'Submit a paused human input form by token',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postFormHumanInputByFormToken',
|
|
path: '/form/human_input/{form_token}',
|
|
tags: ['service_api'],
|
|
})
|
|
.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 information
|
|
*
|
|
* Get basic application information
|
|
* Returns basic information about the application including name, description, tags, and mode.
|
|
*/
|
|
export const get24 = oc
|
|
.route({
|
|
description:
|
|
'Get basic application information\nReturns basic information about the application including name, description, tags, and mode.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getInfo',
|
|
path: '/info',
|
|
summary: 'Get app information',
|
|
tags: ['service_api'],
|
|
})
|
|
.output(zGetInfoResponse)
|
|
|
|
export const info = {
|
|
get: get24,
|
|
}
|
|
|
|
/**
|
|
* Submit feedback for a message
|
|
*
|
|
* Submit feedback for a message
|
|
* Allows users to rate messages as like/dislike and provide optional feedback content.
|
|
*/
|
|
export const post35 = oc
|
|
.route({
|
|
description:
|
|
'Submit feedback for a message\nAllows users to rate messages as like/dislike and provide optional feedback content.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postMessagesByMessageIdFeedbacks',
|
|
path: '/messages/{message_id}/feedbacks',
|
|
summary: 'Submit feedback for a message',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostMessagesByMessageIdFeedbacksBody,
|
|
params: zPostMessagesByMessageIdFeedbacksPath,
|
|
}),
|
|
)
|
|
.output(zPostMessagesByMessageIdFeedbacksResponse)
|
|
|
|
export const feedbacks2 = {
|
|
post: post35,
|
|
}
|
|
|
|
/**
|
|
* Get suggested follow-up questions for a message
|
|
*
|
|
* Get suggested follow-up questions for a message
|
|
* Returns AI-generated follow-up questions based on the message content.
|
|
*/
|
|
export const get25 = oc
|
|
.route({
|
|
description:
|
|
'Get suggested follow-up questions for a message\nReturns AI-generated follow-up questions based on the message content.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getMessagesByMessageIdSuggested',
|
|
path: '/messages/{message_id}/suggested',
|
|
summary: 'Get suggested follow-up questions for a message',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zGetMessagesByMessageIdSuggestedPath }))
|
|
.output(zGetMessagesByMessageIdSuggestedResponse)
|
|
|
|
export const suggested = {
|
|
get: get25,
|
|
}
|
|
|
|
export const byMessageId = {
|
|
feedbacks: feedbacks2,
|
|
suggested,
|
|
}
|
|
|
|
/**
|
|
* List messages in a conversation
|
|
*
|
|
* List messages in a conversation
|
|
* Retrieves messages with pagination support using first_id.
|
|
*/
|
|
export const get26 = oc
|
|
.route({
|
|
description:
|
|
'List messages in a conversation\nRetrieves messages with pagination support using first_id.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getMessages',
|
|
path: '/messages',
|
|
summary: 'List messages in a conversation',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ query: zGetMessagesQuery }))
|
|
.output(zGetMessagesResponse)
|
|
|
|
export const messages = {
|
|
get: get26,
|
|
byMessageId,
|
|
}
|
|
|
|
/**
|
|
* Get app metadata
|
|
*
|
|
* Get application metadata
|
|
* Returns metadata about the application including configuration and settings.
|
|
*/
|
|
export const get27 = oc
|
|
.route({
|
|
description:
|
|
'Get application metadata\nReturns metadata about the application including configuration and settings.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getMeta',
|
|
path: '/meta',
|
|
summary: 'Get app metadata',
|
|
tags: ['service_api'],
|
|
})
|
|
.output(zGetMetaResponse)
|
|
|
|
export const meta = {
|
|
get: get27,
|
|
}
|
|
|
|
/**
|
|
* Retrieve app parameters
|
|
*
|
|
* Retrieve application input parameters and configuration
|
|
* Returns the input form parameters and configuration for the application.
|
|
*/
|
|
export const get28 = oc
|
|
.route({
|
|
description:
|
|
'Retrieve application input parameters and configuration\nReturns the input form parameters and configuration for the application.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getParameters',
|
|
path: '/parameters',
|
|
summary: 'Retrieve app parameters',
|
|
tags: ['service_api'],
|
|
})
|
|
.output(zGetParametersResponse)
|
|
|
|
export const parameters = {
|
|
get: get28,
|
|
}
|
|
|
|
/**
|
|
* Retrieve app site info
|
|
*
|
|
* Get application site configuration
|
|
* Returns the site configuration for the application including theme, icons, and text.
|
|
*/
|
|
export const get29 = oc
|
|
.route({
|
|
description:
|
|
'Get application site configuration\nReturns the site configuration for the application including theme, icons, and text.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getSite',
|
|
path: '/site',
|
|
summary: 'Retrieve app site info',
|
|
tags: ['service_api'],
|
|
})
|
|
.output(zGetSiteResponse)
|
|
|
|
export const site = {
|
|
get: get29,
|
|
}
|
|
|
|
/**
|
|
* Convert text to audio using text-to-speech
|
|
*
|
|
* Convert text to audio using text-to-speech
|
|
* Converts the provided text to audio using the specified voice.
|
|
*/
|
|
export const post36 = oc
|
|
.route({
|
|
description:
|
|
'Convert text to audio using text-to-speech\nConverts the provided text to audio using the specified voice.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postTextToAudio',
|
|
path: '/text-to-audio',
|
|
summary: 'Convert text to audio using text-to-speech',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ body: zPostTextToAudioBody }))
|
|
.output(zPostTextToAudioResponse)
|
|
|
|
export const textToAudio = {
|
|
post: post36,
|
|
}
|
|
|
|
/**
|
|
* Get workflow execution events stream after resume
|
|
*/
|
|
export const get30 = oc
|
|
.route({
|
|
description: 'Get workflow execution events stream after resume',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getWorkflowByTaskIdEvents',
|
|
path: '/workflow/{task_id}/events',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
params: zGetWorkflowByTaskIdEventsPath,
|
|
query: zGetWorkflowByTaskIdEventsQuery.optional(),
|
|
}),
|
|
)
|
|
.output(zGetWorkflowByTaskIdEventsResponse)
|
|
|
|
export const events = {
|
|
get: get30,
|
|
}
|
|
|
|
export const byTaskId3 = {
|
|
events,
|
|
}
|
|
|
|
export const workflow = {
|
|
byTaskId: byTaskId3,
|
|
}
|
|
|
|
/**
|
|
* Get workflow app logs
|
|
*
|
|
* Get workflow execution logs
|
|
* Returns paginated workflow execution logs with filtering options.
|
|
*/
|
|
export const get31 = oc
|
|
.route({
|
|
description:
|
|
'Get workflow execution logs\nReturns paginated workflow execution logs with filtering options.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getWorkflowsLogs',
|
|
path: '/workflows/logs',
|
|
summary: 'Get workflow app logs',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ query: zGetWorkflowsLogsQuery.optional() }))
|
|
.output(zGetWorkflowsLogsResponse)
|
|
|
|
export const logs = {
|
|
get: get31,
|
|
}
|
|
|
|
/**
|
|
* Get a workflow task running detail
|
|
*
|
|
* Get workflow run details
|
|
* Returns detailed information about a specific workflow run.
|
|
*/
|
|
export const get32 = oc
|
|
.route({
|
|
description:
|
|
'Get workflow run details\nReturns detailed information about a specific workflow run.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getWorkflowsRunByWorkflowRunId',
|
|
path: '/workflows/run/{workflow_run_id}',
|
|
summary: 'Get a workflow task running detail',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zGetWorkflowsRunByWorkflowRunIdPath }))
|
|
.output(zGetWorkflowsRunByWorkflowRunIdResponse)
|
|
|
|
export const byWorkflowRunId = {
|
|
get: get32,
|
|
}
|
|
|
|
/**
|
|
* Execute a workflow
|
|
*
|
|
* Execute a workflow
|
|
* Runs a workflow with the provided inputs and returns the results.
|
|
* Supports both blocking and streaming response modes.
|
|
*/
|
|
export const post37 = oc
|
|
.route({
|
|
description:
|
|
'Execute a workflow\nRuns a workflow with the provided inputs and returns the results.\nSupports both blocking and streaming response modes.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postWorkflowsRun',
|
|
path: '/workflows/run',
|
|
summary: 'Execute a workflow',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ body: zPostWorkflowsRunBody }))
|
|
.output(zPostWorkflowsRunResponse)
|
|
|
|
export const run3 = {
|
|
post: post37,
|
|
byWorkflowRunId,
|
|
}
|
|
|
|
/**
|
|
* Stop a running workflow task
|
|
*
|
|
* Stop a running workflow task
|
|
*/
|
|
export const post38 = oc
|
|
.route({
|
|
description: 'Stop a running workflow task',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postWorkflowsTasksByTaskIdStop',
|
|
path: '/workflows/tasks/{task_id}/stop',
|
|
summary: 'Stop a running workflow task',
|
|
tags: ['service_api'],
|
|
})
|
|
.input(z.object({ params: zPostWorkflowsTasksByTaskIdStopPath }))
|
|
.output(zPostWorkflowsTasksByTaskIdStopResponse)
|
|
|
|
export const stop3 = {
|
|
post: post38,
|
|
}
|
|
|
|
export const byTaskId4 = {
|
|
stop: stop3,
|
|
}
|
|
|
|
export const tasks = {
|
|
byTaskId: byTaskId4,
|
|
}
|
|
|
|
/**
|
|
* Run specific workflow by ID
|
|
*
|
|
* Execute a specific workflow by ID
|
|
* Executes a specific workflow version identified by its ID.
|
|
*/
|
|
export const post39 = oc
|
|
.route({
|
|
description:
|
|
'Execute a specific workflow by ID\nExecutes a specific workflow version identified by its ID.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postWorkflowsByWorkflowIdRun',
|
|
path: '/workflows/{workflow_id}/run',
|
|
summary: 'Run specific workflow by ID',
|
|
tags: ['service_api'],
|
|
})
|
|
.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 by model type
|
|
*
|
|
* Get available models by model type
|
|
* Returns a list of available models for the specified model type.
|
|
*/
|
|
export const get33 = oc
|
|
.route({
|
|
description:
|
|
'Get available models by model type\nReturns a list of available models for the specified model type.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getWorkspacesCurrentModelsModelTypesByModelType',
|
|
path: '/workspaces/current/models/model-types/{model_type}',
|
|
summary: 'Get available models by model type',
|
|
tags: ['service_api'],
|
|
})
|
|
.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,
|
|
}
|