演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
8090 lines
223 KiB
TypeScript
Generated
8090 lines
223 KiB
TypeScript
Generated
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
import * as z from 'zod'
|
|
|
|
/**
|
|
* Annotation
|
|
*/
|
|
export const zAnnotation = z.object({
|
|
answer: z.string().nullish(),
|
|
created_at: z.int().nullish(),
|
|
hit_count: z.int().nullish(),
|
|
id: z.uuid(),
|
|
question: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* AnnotationCreatePayload
|
|
*/
|
|
export const zAnnotationCreatePayload = z.object({
|
|
answer: z.string(),
|
|
question: z.string(),
|
|
})
|
|
|
|
/**
|
|
* AnnotationJobStatusDetailResponse
|
|
*/
|
|
export const zAnnotationJobStatusDetailResponse = z.object({
|
|
error_msg: z.string().optional().default(''),
|
|
job_id: z.uuid(),
|
|
job_status: z.string(),
|
|
})
|
|
|
|
/**
|
|
* AnnotationJobStatusResponse
|
|
*/
|
|
export const zAnnotationJobStatusResponse = z.object({
|
|
job_id: z.uuid(),
|
|
job_status: z.string(),
|
|
})
|
|
|
|
/**
|
|
* AnnotationList
|
|
*/
|
|
export const zAnnotationList = z.object({
|
|
data: z.array(zAnnotation),
|
|
has_more: z.boolean(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* AnnotationListQuery
|
|
*/
|
|
export const zAnnotationListQuery = z.object({
|
|
keyword: z.string().optional().default(''),
|
|
limit: z.int().gte(1).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* AnnotationReplyActionPayload
|
|
*/
|
|
export const zAnnotationReplyActionPayload = z.object({
|
|
embedding_model_name: z.string(),
|
|
embedding_provider_name: z.string(),
|
|
score_threshold: z.number(),
|
|
})
|
|
|
|
export const zAnyJsonValue = z.unknown()
|
|
|
|
/**
|
|
* AgentThought
|
|
*/
|
|
export const zAgentThought = z.object({
|
|
answer: z.string().nullish(),
|
|
chain_id: z.string().nullish(),
|
|
created_at: z.int().nullish(),
|
|
files: z.array(z.string()),
|
|
id: z.string(),
|
|
message_id: z.string(),
|
|
observation: z.string().nullish(),
|
|
position: z.int(),
|
|
thought: z.string().nullish(),
|
|
tool: z.string().nullish(),
|
|
tool_input: z.string().nullish(),
|
|
tool_labels: zAnyJsonValue,
|
|
})
|
|
|
|
/**
|
|
* AppFeedbackResponse
|
|
*/
|
|
export const zAppFeedbackResponse = z.object({
|
|
app_id: z.uuid(),
|
|
content: z.string().nullish(),
|
|
conversation_id: z.uuid(),
|
|
created_at: z.string(),
|
|
from_account_id: z.uuid().nullish(),
|
|
from_end_user_id: z.uuid().nullish(),
|
|
from_source: z.string(),
|
|
id: z.uuid(),
|
|
message_id: z.uuid(),
|
|
rating: z.string(),
|
|
updated_at: z.string(),
|
|
})
|
|
|
|
/**
|
|
* AppFeedbackListResponse
|
|
*/
|
|
export const zAppFeedbackListResponse = z.object({
|
|
data: z.array(zAppFeedbackResponse),
|
|
})
|
|
|
|
/**
|
|
* AppInfoResponse
|
|
*/
|
|
export const zAppInfoResponse = z.object({
|
|
author_name: z.string().nullable(),
|
|
description: z.string().nullable(),
|
|
mode: z.string(),
|
|
name: z.string(),
|
|
tags: z.array(z.string()),
|
|
})
|
|
|
|
/**
|
|
* AudioBinaryResponse
|
|
*/
|
|
export const zAudioBinaryResponse = z.custom<Blob | File>(
|
|
(value) => value instanceof Blob || value instanceof File,
|
|
)
|
|
|
|
/**
|
|
* AudioTranscriptResponse
|
|
*/
|
|
export const zAudioTranscriptResponse = z.object({
|
|
text: z.string(),
|
|
})
|
|
|
|
/**
|
|
* BinaryFileResponse
|
|
*/
|
|
export const zBinaryFileResponse = z.custom<Blob | File>(
|
|
(value) => value instanceof Blob || value instanceof File,
|
|
)
|
|
|
|
/**
|
|
* BlockingUsageResponse
|
|
*/
|
|
export const zBlockingUsageResponse = z.object({
|
|
completion_price: z.string().nullish(),
|
|
completion_price_unit: z.string().nullish(),
|
|
completion_tokens: z.int().nullish(),
|
|
completion_unit_price: z.string().nullish(),
|
|
currency: z.string().nullish(),
|
|
latency: z.number().nullish(),
|
|
prompt_price: z.string().nullish(),
|
|
prompt_price_unit: z.string().nullish(),
|
|
prompt_tokens: z.int().nullish(),
|
|
prompt_unit_price: z.string().nullish(),
|
|
total_price: z.string().nullish(),
|
|
total_tokens: z.int().nullish(),
|
|
})
|
|
|
|
/**
|
|
* ButtonStyle
|
|
*
|
|
* Button styles for user actions.
|
|
*/
|
|
export const zButtonStyle = z.enum(['accent', 'default', 'ghost', 'primary'])
|
|
|
|
/**
|
|
* ChatRequestPayload
|
|
*/
|
|
export const zChatRequestPayload = z.object({
|
|
auto_generate_name: z.boolean().optional().default(true),
|
|
conversation_id: z.string().nullish(),
|
|
files: z
|
|
.array(
|
|
z.union([
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string().optional(),
|
|
url: z.string(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string().optional(),
|
|
url: z.string().optional(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string(),
|
|
url: z.string().optional(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['local_file']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string(),
|
|
url: z.string().optional(),
|
|
}),
|
|
]),
|
|
)
|
|
.nullish(),
|
|
inputs: z.record(z.string(), z.unknown()),
|
|
query: z.string(),
|
|
response_mode: z.enum(['blocking', 'streaming']).nullish(),
|
|
workflow_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* ChatRequestPayload
|
|
*/
|
|
export const zChatRequestPayloadWithUser = z.object({
|
|
auto_generate_name: z.boolean().optional().default(true),
|
|
conversation_id: z.string().nullish(),
|
|
files: z
|
|
.array(
|
|
z.union([
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string().optional(),
|
|
url: z.string(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string().optional(),
|
|
url: z.string().optional(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string(),
|
|
url: z.string().optional(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['local_file']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string(),
|
|
url: z.string().optional(),
|
|
}),
|
|
]),
|
|
)
|
|
.nullish(),
|
|
inputs: z.record(z.string(), z.unknown()),
|
|
query: z.string(),
|
|
response_mode: z.enum(['blocking', 'streaming']).nullish(),
|
|
user: z.string(),
|
|
workflow_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* ChildChunkCreatePayload
|
|
*/
|
|
export const zChildChunkCreatePayload = z.object({
|
|
content: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ChildChunkListQuery
|
|
*/
|
|
export const zChildChunkListQuery = z.object({
|
|
keyword: z.string().nullish(),
|
|
limit: z.int().gte(1).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* ChildChunkResponse
|
|
*/
|
|
export const zChildChunkResponse = z.object({
|
|
content: z.string(),
|
|
created_at: z.int(),
|
|
id: z.string(),
|
|
position: z.int(),
|
|
segment_id: z.string(),
|
|
type: z.enum(['automatic', 'customized']),
|
|
updated_at: z.int(),
|
|
word_count: z.int(),
|
|
})
|
|
|
|
/**
|
|
* ChildChunkDetailResponse
|
|
*/
|
|
export const zChildChunkDetailResponse = z.object({
|
|
data: zChildChunkResponse,
|
|
})
|
|
|
|
/**
|
|
* ChildChunkListResponse
|
|
*/
|
|
export const zChildChunkListResponse = z.object({
|
|
data: z.array(zChildChunkResponse),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
total_pages: z.int(),
|
|
})
|
|
|
|
/**
|
|
* ChildChunkUpdatePayload
|
|
*/
|
|
export const zChildChunkUpdatePayload = z.object({
|
|
content: z.string(),
|
|
})
|
|
|
|
/**
|
|
* CompletionRequestPayload
|
|
*/
|
|
export const zCompletionRequestPayload = z.object({
|
|
files: z
|
|
.array(
|
|
z.union([
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string().optional(),
|
|
url: z.string(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string().optional(),
|
|
url: z.string().optional(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string(),
|
|
url: z.string().optional(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['local_file']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string(),
|
|
url: z.string().optional(),
|
|
}),
|
|
]),
|
|
)
|
|
.nullish(),
|
|
inputs: z.record(z.string(), z.unknown()),
|
|
query: z.string().optional().default(''),
|
|
response_mode: z.enum(['blocking', 'streaming']).nullish(),
|
|
})
|
|
|
|
/**
|
|
* CompletionRequestPayload
|
|
*/
|
|
export const zCompletionRequestPayloadWithUser = z.object({
|
|
files: z
|
|
.array(
|
|
z.union([
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string().optional(),
|
|
url: z.string(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string().optional(),
|
|
url: z.string().optional(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string(),
|
|
url: z.string().optional(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['local_file']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string(),
|
|
url: z.string().optional(),
|
|
}),
|
|
]),
|
|
)
|
|
.nullish(),
|
|
inputs: z.record(z.string(), z.unknown()),
|
|
query: z.string().optional().default(''),
|
|
response_mode: z.enum(['blocking', 'streaming']).nullish(),
|
|
user: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Condition
|
|
*
|
|
* Condition detail
|
|
*/
|
|
export const zCondition = z.object({
|
|
comparison_operator: z.enum([
|
|
'<',
|
|
'=',
|
|
'>',
|
|
'after',
|
|
'before',
|
|
'contains',
|
|
'empty',
|
|
'end with',
|
|
'in',
|
|
'is',
|
|
'is not',
|
|
'not contains',
|
|
'not empty',
|
|
'not in',
|
|
'start with',
|
|
'≠',
|
|
'≤',
|
|
'≥',
|
|
]),
|
|
name: z.string(),
|
|
value: z.union([z.string(), z.array(z.string()), z.number()]).nullish(),
|
|
})
|
|
|
|
/**
|
|
* ConversationListQuery
|
|
*/
|
|
export const zConversationListQuery = z.object({
|
|
last_id: z.string().nullish(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
sort_by: z
|
|
.enum(['-created_at', '-updated_at', 'created_at', 'updated_at'])
|
|
.optional()
|
|
.default('-updated_at'),
|
|
})
|
|
|
|
export const zConversationRenamePayload = z.intersection(
|
|
z.union([
|
|
z.object({
|
|
auto_generate: z.literal(true),
|
|
name: z.string().nullish(),
|
|
}),
|
|
z.object({
|
|
auto_generate: z.literal(false).optional().default(false),
|
|
name: z.string().regex(/.*\S.*/),
|
|
}),
|
|
]),
|
|
z.object({
|
|
auto_generate: z.boolean().optional().default(false),
|
|
name: z.string().nullish(),
|
|
}),
|
|
)
|
|
|
|
export const zConversationRenamePayloadWithUser = z.intersection(
|
|
z.union([
|
|
z.object({
|
|
auto_generate: z.literal(true),
|
|
name: z.string().nullish(),
|
|
user: z.string().optional(),
|
|
}),
|
|
z.object({
|
|
auto_generate: z.literal(false).optional().default(false),
|
|
name: z.string().regex(/.*\S.*/),
|
|
user: z.string().optional(),
|
|
}),
|
|
]),
|
|
z.object({
|
|
auto_generate: z.boolean().optional().default(false),
|
|
name: z.string().nullish(),
|
|
user: z.string().optional(),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* ConversationVariableResponse
|
|
*/
|
|
export const zConversationVariableResponse = z.object({
|
|
created_at: z.int().nullish(),
|
|
description: z.string().nullish(),
|
|
id: z.uuid(),
|
|
name: z.string(),
|
|
updated_at: z.int().nullish(),
|
|
value: z.string().nullish(),
|
|
value_type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ConversationVariableInfiniteScrollPaginationResponse
|
|
*/
|
|
export const zConversationVariableInfiniteScrollPaginationResponse = z.object({
|
|
data: z.array(zConversationVariableResponse),
|
|
has_more: z.boolean(),
|
|
limit: z.int(),
|
|
})
|
|
|
|
/**
|
|
* ConversationVariablesQuery
|
|
*/
|
|
export const zConversationVariablesQuery = z.object({
|
|
last_id: z.string().nullish(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
variable_name: z.string().min(1).max(255).nullish(),
|
|
})
|
|
|
|
/**
|
|
* CustomConfigurationStatus
|
|
*
|
|
* Enum class for custom configuration status.
|
|
*/
|
|
export const zCustomConfigurationStatus = z.enum(['active', 'no-configure'])
|
|
|
|
/**
|
|
* DatasetBoundTagResponse
|
|
*/
|
|
export const zDatasetBoundTagResponse = z.object({
|
|
id: z.string(),
|
|
name: z.string(),
|
|
})
|
|
|
|
/**
|
|
* DatasetBoundTagListResponse
|
|
*/
|
|
export const zDatasetBoundTagListResponse = z.object({
|
|
data: z.array(zDatasetBoundTagResponse),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* DatasetDocMetadataResponse
|
|
*/
|
|
export const zDatasetDocMetadataResponse = z.object({
|
|
id: z.string(),
|
|
name: z.string(),
|
|
type: z.enum(['number', 'string', 'time']),
|
|
})
|
|
|
|
/**
|
|
* DatasetExternalKnowledgeInfoResponse
|
|
*/
|
|
export const zDatasetExternalKnowledgeInfoResponse = z.object({
|
|
external_knowledge_api_endpoint: z.string().nullish(),
|
|
external_knowledge_api_id: z.string().nullish(),
|
|
external_knowledge_api_name: z.string().nullish(),
|
|
external_knowledge_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* DatasetExternalRetrievalModelResponse
|
|
*/
|
|
export const zDatasetExternalRetrievalModelResponse = z.object({
|
|
score_threshold: z.number().nullish(),
|
|
score_threshold_enabled: z.boolean().nullish(),
|
|
top_k: z.int(),
|
|
})
|
|
|
|
/**
|
|
* DatasetIconInfoResponse
|
|
*/
|
|
export const zDatasetIconInfoResponse = z.object({
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.string().nullish(),
|
|
icon_url: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* DatasetKeywordSettingResponse
|
|
*/
|
|
export const zDatasetKeywordSettingResponse = z.object({
|
|
keyword_weight: z.number().nullish(),
|
|
})
|
|
|
|
/**
|
|
* DatasetListQuery
|
|
*/
|
|
export const zDatasetListQuery = z.object({
|
|
include_all: z.boolean().optional().default(false),
|
|
keyword: z.string().nullish(),
|
|
limit: z.int().optional().default(20),
|
|
page: z.int().optional().default(1),
|
|
tag_ids: z.array(z.string()).optional(),
|
|
})
|
|
|
|
/**
|
|
* DatasetMetadataActionResponse
|
|
*/
|
|
export const zDatasetMetadataActionResponse = z.object({
|
|
result: z.string(),
|
|
})
|
|
|
|
/**
|
|
* DatasetMetadataBuiltInFieldResponse
|
|
*/
|
|
export const zDatasetMetadataBuiltInFieldResponse = z.object({
|
|
name: z.string(),
|
|
type: z.enum(['number', 'string', 'time']),
|
|
})
|
|
|
|
/**
|
|
* DatasetMetadataBuiltInFieldsResponse
|
|
*/
|
|
export const zDatasetMetadataBuiltInFieldsResponse = z.object({
|
|
fields: z.array(zDatasetMetadataBuiltInFieldResponse),
|
|
})
|
|
|
|
/**
|
|
* DatasetMetadataListItemResponse
|
|
*/
|
|
export const zDatasetMetadataListItemResponse = z.object({
|
|
count: z.int().optional().default(0),
|
|
id: z.string(),
|
|
name: z.string(),
|
|
type: z.enum(['number', 'string', 'time']),
|
|
})
|
|
|
|
/**
|
|
* DatasetMetadataListResponse
|
|
*/
|
|
export const zDatasetMetadataListResponse = z.object({
|
|
built_in_field_enabled: z.boolean(),
|
|
doc_metadata: z.array(zDatasetMetadataListItemResponse),
|
|
})
|
|
|
|
/**
|
|
* DatasetMetadataResponse
|
|
*/
|
|
export const zDatasetMetadataResponse = z.object({
|
|
id: z.string(),
|
|
name: z.string(),
|
|
type: z.enum(['number', 'string', 'time']),
|
|
})
|
|
|
|
/**
|
|
* DatasetRerankingModelResponse
|
|
*/
|
|
export const zDatasetRerankingModelResponse = z.object({
|
|
reranking_model_name: z.string().nullish(),
|
|
reranking_provider_name: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* DatasetSummaryIndexSettingResponse
|
|
*/
|
|
export const zDatasetSummaryIndexSettingResponse = z.object({
|
|
enable: z.boolean().nullish(),
|
|
model_name: z.string().nullish(),
|
|
model_provider_name: z.string().nullish(),
|
|
summary_prompt: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* DatasetTagResponse
|
|
*/
|
|
export const zDatasetTagResponse = z.object({
|
|
id: z.string(),
|
|
name: z.string(),
|
|
type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* DatasetVectorSettingResponse
|
|
*/
|
|
export const zDatasetVectorSettingResponse = z.object({
|
|
embedding_model_name: z.string().nullish(),
|
|
embedding_provider_name: z.string().nullish(),
|
|
vector_weight: z.number().nullish(),
|
|
})
|
|
|
|
/**
|
|
* DatasetWeightedScoreResponse
|
|
*/
|
|
export const zDatasetWeightedScoreResponse = z.object({
|
|
keyword_setting: zDatasetKeywordSettingResponse.optional(),
|
|
vector_setting: zDatasetVectorSettingResponse.optional(),
|
|
weight_type: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* DatasourceCredentialInfoResponse
|
|
*/
|
|
export const zDatasourceCredentialInfoResponse = z.object({
|
|
id: z.string().nullish(),
|
|
is_default: z.boolean().nullish(),
|
|
name: z.string().nullish(),
|
|
type: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* DatasourceNodeRunPayload
|
|
*/
|
|
export const zDatasourceNodeRunPayload = z.object({
|
|
credential_id: z.string().nullish(),
|
|
datasource_type: z.enum(['local_file', 'online_document', 'online_drive', 'website_crawl']),
|
|
inputs: z.record(z.string(), z.unknown()),
|
|
is_published: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* DatasourcePluginResponse
|
|
*/
|
|
export const zDatasourcePluginResponse = z.object({
|
|
credentials: z.array(zDatasourceCredentialInfoResponse).optional(),
|
|
datasource_type: z.string().nullish(),
|
|
node_id: z.string().nullish(),
|
|
plugin_id: z.string().nullish(),
|
|
provider_name: z.string().nullish(),
|
|
title: z.string().nullish(),
|
|
user_input_variables: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
})
|
|
|
|
/**
|
|
* DatasourcePluginListResponse
|
|
*/
|
|
export const zDatasourcePluginListResponse = z.array(zDatasourcePluginResponse)
|
|
|
|
/**
|
|
* DatasourcePluginsQuery
|
|
*/
|
|
export const zDatasourcePluginsQuery = z.object({
|
|
is_published: z.boolean().optional().default(true),
|
|
})
|
|
|
|
/**
|
|
* DocumentBatchDownloadZipPayload
|
|
*
|
|
* Request payload for bulk downloading documents as a zip archive.
|
|
*/
|
|
export const zDocumentBatchDownloadZipPayload = z.object({
|
|
document_ids: z.array(z.uuid()).min(1).max(100),
|
|
})
|
|
|
|
/**
|
|
* DocumentGetQuery
|
|
*/
|
|
export const zDocumentGetQuery = z.object({
|
|
metadata: z.enum(['all', 'only', 'without']).optional().default('all'),
|
|
})
|
|
|
|
/**
|
|
* DocumentListQuery
|
|
*/
|
|
export const zDocumentListQuery = z.object({
|
|
keyword: z.string().nullish(),
|
|
limit: z.int().optional().default(20),
|
|
page: z.int().optional().default(1),
|
|
status: z
|
|
.enum(['archived', 'available', 'disabled', 'error', 'indexing', 'paused', 'queuing'])
|
|
.nullish(),
|
|
})
|
|
|
|
/**
|
|
* DocumentMetadataResponse
|
|
*/
|
|
export const zDocumentMetadataResponse = z.object({
|
|
id: z.string(),
|
|
name: z.string(),
|
|
type: z.enum(['number', 'string', 'time']),
|
|
value: z.union([z.string(), z.int(), z.number()]).nullable(),
|
|
})
|
|
|
|
/**
|
|
* DocumentDetailResponse
|
|
*/
|
|
export const zDocumentDetailResponse = z.object({
|
|
archived: z.boolean().optional(),
|
|
average_segment_length: z.union([z.int(), z.number()]).optional(),
|
|
completed_at: z.int().nullish(),
|
|
created_at: z.int().optional(),
|
|
created_by: z.string().optional(),
|
|
created_from: z.string().optional(),
|
|
data_source_info: z.record(z.string(), z.unknown()).optional(),
|
|
data_source_type: z.string().optional(),
|
|
dataset_process_rule: z.record(z.string(), z.unknown()).optional(),
|
|
dataset_process_rule_id: z.string().nullish(),
|
|
disabled_at: z.int().nullish(),
|
|
disabled_by: z.string().nullish(),
|
|
display_status: z.string().nullish(),
|
|
doc_form: z.string().optional(),
|
|
doc_language: z.string().nullish(),
|
|
doc_metadata: z
|
|
.union([z.array(zDocumentMetadataResponse), z.record(z.string(), z.unknown())])
|
|
.nullish(),
|
|
doc_type: z.string().nullish(),
|
|
document_process_rule: z.record(z.string(), z.unknown()).optional(),
|
|
enabled: z.boolean().optional(),
|
|
error: z.string().nullish(),
|
|
hit_count: z.int().optional(),
|
|
id: z.string(),
|
|
indexing_latency: z.number().nullish(),
|
|
indexing_status: z.string().optional(),
|
|
name: z.string().optional(),
|
|
need_summary: z.boolean().optional(),
|
|
position: z.int().optional(),
|
|
segment_count: z.int().optional(),
|
|
summary_index_status: z.string().nullish(),
|
|
tokens: z.int().nullish(),
|
|
updated_at: z.int().nullish(),
|
|
})
|
|
|
|
/**
|
|
* DocumentStatusPayload
|
|
*/
|
|
export const zDocumentStatusPayload = z.object({
|
|
document_ids: z.array(z.string()).optional(),
|
|
})
|
|
|
|
/**
|
|
* DocumentStatusResponse
|
|
*/
|
|
export const zDocumentStatusResponse = z.object({
|
|
cleaning_completed_at: z.int().nullable(),
|
|
completed_at: z.int().nullable(),
|
|
completed_segments: z.int().nullish(),
|
|
error: z.string().nullable(),
|
|
error_code: z.literal('vector_space_estimate_exceeded').nullish(),
|
|
estimated_vector_space_mb: z.int().nullish(),
|
|
id: z.string(),
|
|
indexing_status: z.enum([
|
|
'cleaning',
|
|
'completed',
|
|
'error',
|
|
'indexing',
|
|
'parsing',
|
|
'paused',
|
|
'splitting',
|
|
'waiting',
|
|
]),
|
|
parsing_completed_at: z.int().nullable(),
|
|
paused_at: z.int().nullable(),
|
|
processing_started_at: z.int().nullable(),
|
|
splitting_completed_at: z.int().nullable(),
|
|
stopped_at: z.int().nullable(),
|
|
total_segments: z.int().nullish(),
|
|
vector_space_limit_mb: z.int().nullish(),
|
|
})
|
|
|
|
/**
|
|
* DocumentStatusListResponse
|
|
*/
|
|
export const zDocumentStatusListResponse = z.object({
|
|
data: z.array(zDocumentStatusResponse),
|
|
})
|
|
|
|
/**
|
|
* DocumentUploadFileDetailResponse
|
|
*/
|
|
export const zDocumentUploadFileDetailResponse = z.object({
|
|
created_at: z.number(),
|
|
created_by: z.string(),
|
|
extension: z.string(),
|
|
id: z.string(),
|
|
mime_type: z.string().nullish(),
|
|
name: z.string(),
|
|
size: z.int(),
|
|
})
|
|
|
|
/**
|
|
* DocumentSourceDetailResponse
|
|
*
|
|
* The uploaded file for file documents; Notion and website documents repeat their source info.
|
|
*/
|
|
export const zDocumentSourceDetailResponse = z.object({
|
|
upload_file: zDocumentUploadFileDetailResponse.nullish(),
|
|
})
|
|
|
|
/**
|
|
* EndUserDetail
|
|
*
|
|
* Full end-user detail returned by the Service API.
|
|
*/
|
|
export const zEndUserDetail = z.object({
|
|
app_id: z.uuid().nullish(),
|
|
created_at: z.iso.datetime(),
|
|
external_user_id: z.string().nullish(),
|
|
id: z.uuid(),
|
|
is_anonymous: z.boolean(),
|
|
name: z.string().nullish(),
|
|
session_id: z.string(),
|
|
tenant_id: z.uuid(),
|
|
type: z.string(),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* ErrorMessageResponse
|
|
*
|
|
* Legacy ``{"error": message}`` body a few endpoints return instead of the standard error body.
|
|
*/
|
|
export const zErrorMessageResponse = z.object({
|
|
error: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ErrorResponse
|
|
*
|
|
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
|
*
|
|
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
|
* stays open because ``HTTPException.data`` may carry extra keys.
|
|
*/
|
|
export const zErrorResponse = z.object({
|
|
code: z.string(),
|
|
details: z.record(z.string(), z.unknown()).optional(),
|
|
message: z.string(),
|
|
params: z.string().optional(),
|
|
status: z.int(),
|
|
})
|
|
|
|
/**
|
|
* AgentNotPublishedError
|
|
*
|
|
* Agent has not been published. Please publish the Agent before using the API.
|
|
*/
|
|
export const zAgentNotPublishedError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('agent_not_published'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* AgentVersionNotFoundError
|
|
*
|
|
* Agent config version not found.
|
|
*/
|
|
export const zAgentVersionNotFoundError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('agent_version_not_found_error'),
|
|
status: z.literal(404),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* AppAbnormalStatusError
|
|
*
|
|
* The app's status is abnormal.
|
|
*/
|
|
export const zAppAbnormalStatusError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('app_abnormal_status'),
|
|
status: z.literal(403),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* AppApiDisabledError
|
|
*
|
|
* The app's API service has been disabled.
|
|
*/
|
|
export const zAppApiDisabledError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('app_api_disabled'),
|
|
status: z.literal(403),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* AppNotFoundError
|
|
*
|
|
* The app no longer exists.
|
|
*/
|
|
export const zAppNotFoundError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('app_not_found'),
|
|
status: z.literal(403),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* AppSuggestedQuestionsAfterAnswerDisabledError
|
|
*
|
|
* The 'Suggested Questions After Answer' feature is disabled.
|
|
*/
|
|
export const zAppSuggestedQuestionsAfterAnswerDisabledError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('app_suggested_questions_after_answer_disabled'),
|
|
status: z.literal(403),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* AppUnavailableError
|
|
*
|
|
* App unavailable, please check your app configurations.
|
|
*/
|
|
export const zAppUnavailableError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('app_unavailable'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* ArchivedDocumentImmutableError
|
|
*
|
|
* The archived document is not editable.
|
|
*/
|
|
export const zArchivedDocumentImmutableError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('archived_document_immutable'),
|
|
status: z.literal(403),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* AudioTooLargeError
|
|
*
|
|
* Audio size exceeded. {message}
|
|
*/
|
|
export const zAudioTooLargeError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('audio_too_large'),
|
|
status: z.literal(413),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* CompletionRequestError
|
|
*
|
|
* Completion request failed.
|
|
*/
|
|
export const zCompletionRequestError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('completion_request_error'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* ConversationCursorNotFoundError
|
|
*
|
|
* The conversation cursor is not in the current list. Refresh the list and try again.
|
|
*/
|
|
export const zConversationCursorNotFoundError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('conversation_cursor_not_found'),
|
|
status: z.literal(404),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* ConversationFirstMessageNotFoundError
|
|
*
|
|
* The conversation has no message from which to generate a name.
|
|
*/
|
|
export const zConversationFirstMessageNotFoundError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('conversation_first_message_not_found'),
|
|
status: z.literal(404),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* ConversationNotFoundError
|
|
*
|
|
* The conversation was not found for this user and app.
|
|
*/
|
|
export const zConversationNotFoundError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('conversation_not_found'),
|
|
status: z.literal(404),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* ConversationVariableNotFoundError
|
|
*
|
|
* The conversation variable was not found for this conversation.
|
|
*/
|
|
export const zConversationVariableNotFoundError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('conversation_variable_not_found'),
|
|
status: z.literal(404),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* ConversationVariableTypeMismatchError
|
|
*
|
|
* The new value does not match the conversation variable's type.
|
|
*/
|
|
export const zConversationVariableTypeMismatchError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('conversation_variable_type_mismatch'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* DatasetNameDuplicateError
|
|
*
|
|
* The dataset name already exists. Please modify your dataset name.
|
|
*/
|
|
export const zDatasetNameDuplicateError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('dataset_name_duplicate'),
|
|
status: z.literal(409),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* EndUserNotFoundError
|
|
*
|
|
* End user not found.
|
|
*/
|
|
export const zEndUserNotFoundError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('end_user_not_found'),
|
|
status: z.literal(404),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* EventStreamResponse
|
|
*/
|
|
export const zEventStreamResponse = z.string()
|
|
|
|
/**
|
|
* ExecutionContentType
|
|
*/
|
|
export const zExecutionContentType = z.enum(['human_input'])
|
|
|
|
/**
|
|
* FeedbackListQuery
|
|
*/
|
|
export const zFeedbackListQuery = z.object({
|
|
limit: z.int().gte(1).lte(101).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* FetchFrom
|
|
*
|
|
* Enum class for fetch from.
|
|
*/
|
|
export const zFetchFrom = z.enum(['customizable-model', 'predefined-model'])
|
|
|
|
/**
|
|
* FileAccessDeniedError
|
|
*
|
|
* Access to the requested file is denied.
|
|
*/
|
|
export const zFileAccessDeniedError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('file_access_denied'),
|
|
status: z.literal(403),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* FileExtensionBlockedError
|
|
*
|
|
* The file extension is blocked for security reasons.
|
|
*/
|
|
export const zFileExtensionBlockedError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('file_extension_blocked'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* FileNotFoundError
|
|
*
|
|
* The requested file was not found.
|
|
*/
|
|
export const zFileNotFoundError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('file_not_found'),
|
|
status: z.literal(404),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* FilePreviewQuery
|
|
*/
|
|
export const zFilePreviewQuery = z.object({
|
|
as_attachment: z.boolean().optional().default(false),
|
|
})
|
|
|
|
/**
|
|
* FileResponse
|
|
*/
|
|
export const zFileResponse = z.object({
|
|
conversation_id: z.uuid().nullish(),
|
|
created_at: z.int().nullish(),
|
|
created_by: z.uuid().nullish(),
|
|
extension: z.string().nullish(),
|
|
file_key: z.string().nullish(),
|
|
id: z.uuid(),
|
|
mime_type: z.string().nullish(),
|
|
name: z.string(),
|
|
original_url: z.string().nullish(),
|
|
preview_url: z.string().nullish(),
|
|
reference: z.string().nullish(),
|
|
size: z.int(),
|
|
source_url: z.string().nullish(),
|
|
tenant_id: z.uuid().nullish(),
|
|
user_id: z.uuid().nullish(),
|
|
})
|
|
|
|
/**
|
|
* FileTooLargeError
|
|
*
|
|
* File size exceeded. {message}
|
|
*/
|
|
export const zFileTooLargeError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('file_too_large'),
|
|
status: z.literal(413),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* FileTransferMethod
|
|
*/
|
|
export const zFileTransferMethod = z.enum([
|
|
'datasource_file',
|
|
'local_file',
|
|
'remote_url',
|
|
'tool_file',
|
|
])
|
|
|
|
/**
|
|
* FileType
|
|
*/
|
|
export const zFileType = z.enum(['audio', 'custom', 'document', 'image', 'video'])
|
|
|
|
/**
|
|
* FileInputConfig
|
|
*/
|
|
export const zFileInputConfig = z.object({
|
|
allowed_file_extensions: z.array(z.string()).optional(),
|
|
allowed_file_types: z.array(zFileType).optional(),
|
|
allowed_file_upload_methods: z.array(zFileTransferMethod).optional(),
|
|
output_variable_name: z.string(),
|
|
type: z.literal('file').optional().default('file'),
|
|
})
|
|
|
|
/**
|
|
* FileListInputConfig
|
|
*/
|
|
export const zFileListInputConfig = z.object({
|
|
allowed_file_extensions: z.array(z.string()).optional(),
|
|
allowed_file_types: z.array(zFileType).optional(),
|
|
allowed_file_upload_methods: z.array(zFileTransferMethod).optional(),
|
|
number_limits: z.int().gte(0).optional().default(0),
|
|
output_variable_name: z.string(),
|
|
type: z.literal('file-list').optional().default('file-list'),
|
|
})
|
|
|
|
/**
|
|
* FilenameNotExistsError
|
|
*
|
|
* The specified filename does not exist.
|
|
*/
|
|
export const zFilenameNotExistsError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('filename_not_exists_error'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* ForbiddenError
|
|
*
|
|
* You don't have the permission to access the requested resource.
|
|
*/
|
|
export const zForbiddenError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('forbidden'),
|
|
status: z.literal(403),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* HitTestingChildChunk
|
|
*/
|
|
export const zHitTestingChildChunk = z.object({
|
|
content: z.string(),
|
|
id: z.string(),
|
|
position: z.int(),
|
|
score: z.number(),
|
|
})
|
|
|
|
/**
|
|
* HitTestingDocument
|
|
*/
|
|
export const zHitTestingDocument = z.object({
|
|
data_source_type: z.string(),
|
|
doc_metadata: z.unknown().nullable(),
|
|
doc_type: z.string().nullable(),
|
|
id: z.string(),
|
|
name: z.string(),
|
|
})
|
|
|
|
/**
|
|
* HitTestingFile
|
|
*/
|
|
export const zHitTestingFile = z.object({
|
|
extension: z.string(),
|
|
id: z.string(),
|
|
mime_type: z.string(),
|
|
name: z.string(),
|
|
size: z.int(),
|
|
source_url: z.string(),
|
|
})
|
|
|
|
/**
|
|
* HitTestingQuery
|
|
*/
|
|
export const zHitTestingQuery = z.object({
|
|
content: z.string(),
|
|
})
|
|
|
|
/**
|
|
* HitTestingSegment
|
|
*/
|
|
export const zHitTestingSegment = z.object({
|
|
answer: z.string().nullable(),
|
|
completed_at: z.int().nullable(),
|
|
content: z.string(),
|
|
created_at: z.int(),
|
|
created_by: z.string(),
|
|
disabled_at: z.int().nullable(),
|
|
disabled_by: z.string().nullable(),
|
|
document: zHitTestingDocument,
|
|
document_id: z.string(),
|
|
enabled: z.boolean(),
|
|
error: z.string().nullable(),
|
|
hit_count: z.int(),
|
|
id: z.string(),
|
|
index_node_hash: z.string().nullable(),
|
|
index_node_id: z.string().nullable(),
|
|
indexing_at: z.int().nullable(),
|
|
keywords: z.array(z.string()),
|
|
position: z.int(),
|
|
sign_content: z.string().nullable(),
|
|
status: z.string(),
|
|
stopped_at: z.int().nullable(),
|
|
tokens: z.int(),
|
|
word_count: z.int(),
|
|
})
|
|
|
|
/**
|
|
* HitTestingRecord
|
|
*/
|
|
export const zHitTestingRecord = z.object({
|
|
child_chunks: z.array(zHitTestingChildChunk),
|
|
files: z.array(zHitTestingFile),
|
|
score: z.number().nullable(),
|
|
segment: zHitTestingSegment,
|
|
summary: z.string().nullable(),
|
|
tsne_position: z.unknown().nullable(),
|
|
})
|
|
|
|
/**
|
|
* HitTestingResponse
|
|
*/
|
|
export const zHitTestingResponse = z.object({
|
|
query: zHitTestingQuery,
|
|
records: z.array(zHitTestingRecord),
|
|
})
|
|
|
|
/**
|
|
* HumanInputFormExpiredError
|
|
*/
|
|
export const zHumanInputFormExpiredError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('human_input_form_expired'),
|
|
status: z.literal(412),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* HumanInputFormSubmitResponse
|
|
*/
|
|
export const zHumanInputFormSubmitResponse = z.record(z.string(), z.never())
|
|
|
|
/**
|
|
* HumanInputFormSubmittedError
|
|
*
|
|
* This form has already been submitted by another user, form_id={form_id}
|
|
*/
|
|
export const zHumanInputFormSubmittedError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('human_input_form_submitted'),
|
|
status: z.literal(412),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* IndexInfoResponse
|
|
*/
|
|
export const zIndexInfoResponse = z.object({
|
|
api_version: z.string(),
|
|
server_version: z.string(),
|
|
welcome: z.string(),
|
|
})
|
|
|
|
/**
|
|
* IndexTechniqueType
|
|
*/
|
|
export const zIndexTechniqueType = z.enum(['economy', 'high_quality'])
|
|
|
|
/**
|
|
* InvalidActionError
|
|
*
|
|
* Invalid action.
|
|
*/
|
|
export const zInvalidActionError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('invalid_action'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* InvalidFormDataError
|
|
*/
|
|
export const zInvalidFormDataError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('invalid_form_data'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* InvalidMetadataError
|
|
*
|
|
* The metadata content is incorrect. Please check and verify.
|
|
*/
|
|
export const zInvalidMetadataError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('invalid_metadata'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
export const zJsonObject = z.record(z.string(), z.unknown())
|
|
|
|
/**
|
|
* ChatPauseReasonResponse
|
|
*
|
|
* Public pause reason emitted by a blocking Chatflow execution.
|
|
*/
|
|
export const zChatPauseReasonResponse = z.object({
|
|
TYPE: z.string(),
|
|
actions: z.array(zJsonObject).optional(),
|
|
approval_channels: z.array(z.string()).optional(),
|
|
display_in_ui: z.boolean().nullish(),
|
|
expiration_time: z.int().nullish(),
|
|
form_content: z.string().nullish(),
|
|
form_id: z.uuid().nullish(),
|
|
form_token: z.string().nullish(),
|
|
inputs: z.array(zJsonObject).optional(),
|
|
message: z.string().nullish(),
|
|
node_id: z.string().nullish(),
|
|
node_title: z.string().nullish(),
|
|
resolved_default_values: z.record(z.string(), z.unknown()).optional(),
|
|
})
|
|
|
|
export const zJsonValueType = z.unknown()
|
|
|
|
export const zJsonValue = z.unknown()
|
|
|
|
/**
|
|
* ConversationVariableUpdatePayload
|
|
*/
|
|
export const zConversationVariableUpdatePayload = z.object({
|
|
value: zJsonValue,
|
|
})
|
|
|
|
/**
|
|
* ConversationVariableUpdatePayload
|
|
*/
|
|
export const zConversationVariableUpdatePayloadWithUser = z.object({
|
|
user: z.string().optional(),
|
|
value: zJsonValue,
|
|
})
|
|
|
|
/**
|
|
* DocumentResponse
|
|
*/
|
|
export const zDocumentResponse = z.object({
|
|
archived: z.boolean().nullish(),
|
|
created_at: z.int().nullish(),
|
|
created_by: z.string().nullish(),
|
|
created_from: z.string().nullish(),
|
|
data_source_detail_dict: zDocumentSourceDetailResponse,
|
|
data_source_info: z.record(z.string(), zJsonValue).nullish(),
|
|
data_source_type: z.string().nullish(),
|
|
dataset_process_rule_id: z.string().nullish(),
|
|
disabled_at: z.int().nullish(),
|
|
disabled_by: z.string().nullish(),
|
|
display_status: z.string().nullish(),
|
|
doc_form: z.string().nullish(),
|
|
doc_metadata: z.array(zDocumentMetadataResponse).optional(),
|
|
enabled: z.boolean().nullish(),
|
|
error: z.string().nullish(),
|
|
hit_count: z.int().nullish(),
|
|
id: z.string(),
|
|
indexing_status: z.string().nullish(),
|
|
name: z.string(),
|
|
need_summary: z.boolean().nullish(),
|
|
position: z.int().nullish(),
|
|
summary_index_status: z.string().nullish(),
|
|
tokens: z.int().nullish(),
|
|
word_count: z.int().nullish(),
|
|
})
|
|
|
|
/**
|
|
* DocumentAndBatchResponse
|
|
*/
|
|
export const zDocumentAndBatchResponse = z.object({
|
|
batch: z.string(),
|
|
document: zDocumentResponse,
|
|
})
|
|
|
|
/**
|
|
* DocumentListResponse
|
|
*/
|
|
export const zDocumentListResponse = z.object({
|
|
data: z.array(zDocumentResponse),
|
|
has_more: z.boolean(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* HumanInputFormSubmissionData
|
|
*/
|
|
export const zHumanInputFormSubmissionData = z.object({
|
|
action_id: z.string(),
|
|
action_text: z.string(),
|
|
node_id: z.string(),
|
|
node_title: z.string(),
|
|
rendered_content: z.string(),
|
|
submitted_data: z.record(z.string(), zJsonValue).nullish(),
|
|
})
|
|
|
|
/**
|
|
* HumanInputFormSubmitPayload
|
|
*
|
|
* Legacy Human Input v1 submit payload shared by existing runtime surfaces.
|
|
*/
|
|
export const zHumanInputFormSubmitPayload = z.object({
|
|
action: z.string(),
|
|
inputs: z.record(z.string(), zJsonValue),
|
|
})
|
|
|
|
/**
|
|
* HumanInputFormSubmitPayload
|
|
*
|
|
* Legacy Human Input v1 submit payload shared by existing runtime surfaces.
|
|
*/
|
|
export const zHumanInputFormSubmitPayloadWithUser = z.object({
|
|
action: z.string(),
|
|
inputs: z.record(z.string(), zJsonValue),
|
|
user: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSActiveProfileRevisions
|
|
*/
|
|
export const zKnowledgeFsActiveProfileRevisions = z.object({
|
|
embedding: z.int().gte(1).nullish(),
|
|
retrieval: z.int().gte(1).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSAnswerTraceStepResponse
|
|
*/
|
|
export const zKnowledgeFsAnswerTraceStepResponse = z.object({
|
|
ended_at: z.iso.datetime().nullish(),
|
|
metadata: z.record(z.string(), z.unknown()),
|
|
name: z.string(),
|
|
started_at: z.iso.datetime(),
|
|
status: z.enum(['error', 'ok', 'skipped']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBackgroundTaskListQuery
|
|
*/
|
|
export const zKnowledgeFsBackgroundTaskListQuery = z.object({
|
|
cursor: z.string().min(1).max(8192).nullish(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
task_ids: z
|
|
.string()
|
|
.max(3699)
|
|
.regex(
|
|
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(,[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}){0,99}$/,
|
|
)
|
|
.nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkDocumentDeleteItemPayload
|
|
*/
|
|
export const zKnowledgeFsBulkDocumentDeleteItemPayload = z.object({
|
|
documentId: z.string().min(1),
|
|
expectedRevision: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkDocumentDeletePayload
|
|
*/
|
|
export const zKnowledgeFsBulkDocumentDeletePayload = z.object({
|
|
documents: z.array(zKnowledgeFsBulkDocumentDeleteItemPayload).min(1).max(100),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSCrawlImportPagePayload
|
|
*/
|
|
export const zKnowledgeFsCrawlImportPagePayload = z.object({
|
|
content: z.string().max(10000000),
|
|
description: z.string().nullish(),
|
|
sourceUrl: z.string().min(1).max(4096),
|
|
title: z.string().max(500).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSCrawlPreviewPageListQuery
|
|
*/
|
|
export const zKnowledgeFsCrawlPreviewPageListQuery = z.object({
|
|
cursor: z.string().min(1).max(4096).nullish(),
|
|
limit: z.int().gte(1).lte(200).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSCrawlPreviewPageResponse
|
|
*/
|
|
export const zKnowledgeFsCrawlPreviewPageResponse = z.object({
|
|
description: z.string().nullish(),
|
|
etag: z.string().nullish(),
|
|
page_id: z.string(),
|
|
source_url: z.string(),
|
|
title: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSCrawlPreviewPageListResponse
|
|
*/
|
|
export const zKnowledgeFsCrawlPreviewPageListResponse = z.object({
|
|
data: z.array(zKnowledgeFsCrawlPreviewPageResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSCrawlPreviewSelectionPayload
|
|
*/
|
|
export const zKnowledgeFsCrawlPreviewSelectionPayload = z.object({
|
|
pageIds: z.array(z.string()).min(1).max(200),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSCrawledPageResponse
|
|
*/
|
|
export const zKnowledgeFsCrawledPageResponse = z.object({
|
|
content: z.string(),
|
|
description: z.string().nullish(),
|
|
source_url: z.string(),
|
|
title: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSCursorQuery
|
|
*/
|
|
export const zKnowledgeFsCursorQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).nullish(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentChunkListQuery
|
|
*/
|
|
export const zKnowledgeFsDocumentChunkListQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).nullish(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
query: z.string().min(1).max(512).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentChunkResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentChunkResponse = z.object({
|
|
created_at: z.iso.datetime(),
|
|
document_id: z.string(),
|
|
document_revision: z.int().gte(1),
|
|
enabled: z.boolean(),
|
|
end_offset: z.int().gte(0).nullish(),
|
|
id: z.string(),
|
|
kind: z.enum(['chunk', 'image', 'section', 'summary', 'table']).optional().default('chunk'),
|
|
knowledge_space_id: z.string(),
|
|
ordinal: z.int().gte(0),
|
|
parent_chunk_id: z.string().nullish(),
|
|
parse_element_ids: z.array(z.string()),
|
|
section_path: z.array(z.string()).optional(),
|
|
start_offset: z.int().gte(0).nullish(),
|
|
text: z.string(),
|
|
token_count: z.int().gte(0),
|
|
user_metadata: z.record(z.string(), z.unknown()),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentChunkListResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentChunkListResponse = z.object({
|
|
data: z.array(zKnowledgeFsDocumentChunkResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentDeletePayload
|
|
*/
|
|
export const zKnowledgeFsDocumentDeletePayload = z.object({
|
|
expectedRevision: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentMetadataPayload
|
|
*/
|
|
export const zKnowledgeFsDocumentMetadataPayload = z.object({
|
|
expectedRowVersion: z.int().gte(0),
|
|
patch: z.record(z.string(), z.unknown()),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentOutlineNodeResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentOutlineNodeResponse = z.object({
|
|
child_node_ids: z.array(z.string()).optional(),
|
|
children: z.array(z.lazy((): any => zKnowledgeFsDocumentOutlineNodeResponse)).optional(),
|
|
end_offset: z.int().gte(0).nullish(),
|
|
end_page: z.int().gte(1).nullish(),
|
|
id: z.string(),
|
|
level: z.int().gte(1),
|
|
metadata: z.record(z.string(), z.unknown()),
|
|
section_path: z.array(z.string()).optional(),
|
|
source_element_ids: z.array(z.string()).optional(),
|
|
source_node_ids: z.array(z.string()).optional(),
|
|
start_offset: z.int().gte(0).nullish(),
|
|
start_page: z.int().gte(1).nullish(),
|
|
summary: z.string().nullish(),
|
|
title: z.string(),
|
|
title_location: z.record(z.string(), z.unknown()).nullish(),
|
|
toc_source: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentOutlineResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentOutlineResponse = z.object({
|
|
artifact_hash: z.string(),
|
|
created_at: z.iso.datetime(),
|
|
document_asset_id: z.string(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
metadata: z.record(z.string(), z.unknown()),
|
|
nodes: z.array(zKnowledgeFsDocumentOutlineNodeResponse),
|
|
outline_version: z.string(),
|
|
parse_artifact_id: z.string(),
|
|
updated_at: z.iso.datetime().nullish(),
|
|
version: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentReferenceQuery
|
|
*/
|
|
export const zKnowledgeFsDocumentReferenceQuery = z.object({
|
|
document_asset_id: z.string().min(1).max(255),
|
|
document_asset_version: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentReindexPayload
|
|
*/
|
|
export const zKnowledgeFsDocumentReindexPayload = z.object({
|
|
all: z.boolean().nullish(),
|
|
documentIds: z.array(z.string()).min(1).max(100).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentResponse = z.object({
|
|
created_at: z.iso.datetime(),
|
|
filename: z.string(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
metadata: z.record(z.string(), z.unknown()),
|
|
mime_type: z.string(),
|
|
object_key: z.string(),
|
|
parser_status: z.enum(['failed', 'parsed', 'pending']),
|
|
sha256: z.string(),
|
|
size_bytes: z.int().gte(0),
|
|
source_id: z.string().nullish(),
|
|
updated_at: z.iso.datetime().nullish(),
|
|
version: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentListResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentListResponse = z.object({
|
|
data: z.array(zKnowledgeFsDocumentResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentReindexItemResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentReindexItemResponse = z.object({
|
|
asset: zKnowledgeFsDocumentResponse.nullish(),
|
|
code: z.string().nullish(),
|
|
compilation_job: z.record(z.string(), z.unknown()).nullish(),
|
|
document_id: z.string().nullish(),
|
|
error: z.string().nullish(),
|
|
status: z.enum(['disabled', 'failed', 'not_found', 'pending', 'queued']),
|
|
status_url: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentReindexResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentReindexResponse = z.object({
|
|
bulk_job_id: z.string(),
|
|
items: z.array(zKnowledgeFsDocumentReindexItemResponse),
|
|
total: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentRevisionResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentRevisionResponse = z.object({
|
|
activated_at: z.iso.datetime().nullish(),
|
|
content_hash: z.string(),
|
|
created_at: z.iso.datetime(),
|
|
document_asset_id: z.string(),
|
|
document_asset_version: z.int().gte(1),
|
|
document_id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
mime_type: z.string(),
|
|
revision: z.int().gte(1),
|
|
size_bytes: z.int().gte(0),
|
|
state: z.enum(['active', 'candidate', 'failed', 'superseded']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentRevisionListResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentRevisionListResponse = z.object({
|
|
data: z.array(zKnowledgeFsDocumentRevisionResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDurableDeletionErrorResponse
|
|
*/
|
|
export const zKnowledgeFsDurableDeletionErrorResponse = z.object({
|
|
code: z.string(),
|
|
message: z.string(),
|
|
retryable: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDurableDeletionProgressResponse
|
|
*/
|
|
export const zKnowledgeFsDurableDeletionProgressResponse = z.object({
|
|
completed_items: z.int().gte(0),
|
|
current_item_kind: z.string().nullish(),
|
|
total_items: z.int().gte(0).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDurableDeletionJobResponse
|
|
*/
|
|
export const zKnowledgeFsDurableDeletionJobResponse = z.object({
|
|
checkpoint: z.enum([
|
|
'completed',
|
|
'deleting_derived_data',
|
|
'deleting_objects',
|
|
'deleting_primary_data',
|
|
'quiescing',
|
|
'requested',
|
|
]),
|
|
completed_at: z.iso.datetime().nullish(),
|
|
created_at: z.iso.datetime(),
|
|
error: zKnowledgeFsDurableDeletionErrorResponse.nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
mode: z.enum(['cascade', 'keep']).nullish(),
|
|
progress: zKnowledgeFsDurableDeletionProgressResponse.nullish(),
|
|
retry_at: z.iso.datetime().nullish(),
|
|
run_state: z.enum([
|
|
'canceled',
|
|
'completed',
|
|
'dispatch_pending',
|
|
'failed',
|
|
'queued',
|
|
'retry_wait',
|
|
'running',
|
|
]),
|
|
target_id: z.string(),
|
|
target_type: z.enum(['document', 'knowledge_space', 'logical_document', 'source']),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkDeletionAcceptedItemResponse
|
|
*/
|
|
export const zKnowledgeFsBulkDeletionAcceptedItemResponse = z.object({
|
|
document_id: z.string(),
|
|
document_title: z.string().nullish(),
|
|
job: zKnowledgeFsDurableDeletionJobResponse,
|
|
status_url: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkDeletionResultResponse
|
|
*/
|
|
export const zKnowledgeFsBulkDeletionResultResponse = z.object({
|
|
document_id: z.string(),
|
|
error: zKnowledgeFsDurableDeletionErrorResponse.nullish(),
|
|
job: zKnowledgeFsDurableDeletionJobResponse.nullish(),
|
|
status: z.enum(['accepted', 'pending', 'rejected']),
|
|
status_url: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkDeletionAcceptedResponse
|
|
*/
|
|
export const zKnowledgeFsBulkDeletionAcceptedResponse = z.object({
|
|
batch_id: z.string().nullish(),
|
|
items: z.array(zKnowledgeFsBulkDeletionAcceptedItemResponse),
|
|
results: z.array(zKnowledgeFsBulkDeletionResultResponse).optional(),
|
|
status_url: z.string().nullish(),
|
|
total: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDurableDeletionAcceptedResponse
|
|
*/
|
|
export const zKnowledgeFsDurableDeletionAcceptedResponse = z.object({
|
|
document_title: z.string().nullish(),
|
|
job: zKnowledgeFsDurableDeletionJobResponse,
|
|
status_url: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSEmbeddingSettingsResponse
|
|
*/
|
|
export const zKnowledgeFsEmbeddingSettingsResponse = z.object({
|
|
dimension: z.int().gte(1).nullish(),
|
|
model: z.string(),
|
|
plugin_id: z.string(),
|
|
provider: z.string(),
|
|
revision: z.int().gte(1).nullish(),
|
|
vector_space_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSLogicalDocumentDeletePayload
|
|
*/
|
|
export const zKnowledgeFsLogicalDocumentDeletePayload = z.object({
|
|
expectedRevision: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOnlineDocumentWorkflowImportItemPayload
|
|
*/
|
|
export const zKnowledgeFsOnlineDocumentWorkflowImportItemPayload = z.object({
|
|
etag: z.string().max(1024).nullish(),
|
|
lastEditedTime: z.string().max(128).nullish(),
|
|
name: z.string().max(500).nullish(),
|
|
pageId: z.string().min(1).max(1024),
|
|
providerItemId: z.string().min(1).max(1024),
|
|
type: z.string().min(1).max(128),
|
|
workspaceId: z.string().min(1).max(1024),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOnlineDriveWorkflowImportItemPayload
|
|
*/
|
|
export const zKnowledgeFsOnlineDriveWorkflowImportItemPayload = z.object({
|
|
bucket: z.string().max(1024).nullish(),
|
|
etag: z.string().max(1024).nullish(),
|
|
id: z.string().min(1).max(1024),
|
|
mimeType: z.string().max(255).nullish(),
|
|
name: z.string().min(1).max(500),
|
|
providerItemId: z.string().min(1).max(1024),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSProductScoreThreshold
|
|
*/
|
|
export const zKnowledgeFsProductScoreThreshold = z.object({
|
|
enabled: z.boolean(),
|
|
stage: z.enum(['mode-final', 'rerank']).optional().default('mode-final'),
|
|
value: z.number().gte(0).lte(1).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSProfileMigrationResponse
|
|
*/
|
|
export const zKnowledgeFsProfileMigrationResponse = z.object({
|
|
candidate_publication_fingerprint: z.string().nullish(),
|
|
changed_kind: z.enum(['embedding', 'retrieval']),
|
|
checkpoint: z.enum(['activated', 'candidate-built', 'evaluated', 'queued']),
|
|
completed_at: z.iso.datetime().nullish(),
|
|
created_at: z.iso.datetime(),
|
|
error_code: z.string().nullish(),
|
|
evaluation_summary: z
|
|
.record(z.string(), z.union([z.boolean(), z.number(), z.int(), z.string()]))
|
|
.nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
rebuild_scope: z.enum([
|
|
'clone-publication',
|
|
'full-page-index-summary-outline',
|
|
'full-vector-space',
|
|
]),
|
|
run_state: z.enum(['canceled', 'failed', 'queued', 'running', 'succeeded']),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSProfileModelSelection
|
|
*/
|
|
export const zKnowledgeFsProfileModelSelection = z.object({
|
|
model: z.string().min(1).max(256),
|
|
pluginId: z.string().min(1).max(256),
|
|
provider: z.string().min(1).max(256),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSProductRerankProfile
|
|
*/
|
|
export const zKnowledgeFsProductRerankProfile = z.object({
|
|
enabled: z.boolean(),
|
|
model: zKnowledgeFsProfileModelSelection.nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSProductRetrievalProfile
|
|
*/
|
|
export const zKnowledgeFsProductRetrievalProfile = z.object({
|
|
defaultMode: z.enum(['deep', 'fast', 'research']),
|
|
reasoningModel: zKnowledgeFsProfileModelSelection,
|
|
rerank: zKnowledgeFsProductRerankProfile,
|
|
scoreThreshold: zKnowledgeFsProductScoreThreshold,
|
|
topK: z.int().gte(1).lte(100),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSPublicFailureResponse
|
|
*/
|
|
export const zKnowledgeFsPublicFailureResponse = z.object({
|
|
action: z
|
|
.enum([
|
|
'configure_model',
|
|
'configure_parser',
|
|
'configure_source',
|
|
'contact_admin',
|
|
'retry',
|
|
'reupload',
|
|
])
|
|
.nullish(),
|
|
category: z.enum([
|
|
'authorization',
|
|
'canceled',
|
|
'configuration',
|
|
'conflict',
|
|
'dependency',
|
|
'internal',
|
|
'not_found',
|
|
'rate_limit',
|
|
'timeout',
|
|
'validation',
|
|
]),
|
|
code: z.enum([
|
|
'DOCUMENT_COMPILATION_FAILED',
|
|
'DOCUMENT_COMPILATION_LEASE_LOST',
|
|
'DOCUMENT_COMPILATION_PROFILE_CHANGED',
|
|
'DOCUMENT_COMPILATION_RETRYABLE',
|
|
'DOCUMENT_COUNT_QUOTA_EXCEEDED',
|
|
'DOCUMENT_COUNT_QUOTA_UNAVAILABLE',
|
|
'DOCUMENT_DISABLED',
|
|
'DOCUMENT_PARSER_INPUT_INVALID',
|
|
'DOCUMENT_PARSER_NOT_CONFIGURED',
|
|
'DOCUMENT_PARSER_RATE_LIMITED',
|
|
'DOCUMENT_PARSER_RESPONSE_INVALID',
|
|
'DOCUMENT_PARSER_TIMEOUT',
|
|
'DOCUMENT_PARSER_UNAVAILABLE',
|
|
'DOCUMENT_PARSER_UNSUPPORTED_TYPE',
|
|
'DOCUMENT_PDF_RENDER_FAILED',
|
|
'DURABLE_DELETION_IDEMPOTENCY_CONFLICT',
|
|
'EMBEDDING_DIMENSION_INVALID',
|
|
'EMBEDDING_DIMENSION_UNSUPPORTED',
|
|
'EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'KNOWLEDGE_FS_ACCESS_DENIED',
|
|
'KNOWLEDGE_FS_CONFLICT',
|
|
'KNOWLEDGE_FS_INTERNAL_ERROR',
|
|
'KNOWLEDGE_FS_INVALID_REQUEST',
|
|
'KNOWLEDGE_FS_NOT_FOUND',
|
|
'KNOWLEDGE_FS_RATE_LIMITED',
|
|
'KNOWLEDGE_FS_TIMEOUT',
|
|
'KNOWLEDGE_FS_UNAVAILABLE',
|
|
'KNOWLEDGE_SPACE_MANIFEST_NOT_FOUND',
|
|
'KNOWLEDGE_SPACE_MODEL_CONFIGURATION_REQUIRED',
|
|
'KNOWLEDGE_SPACE_SETTINGS_COMPILATION_IN_PROGRESS',
|
|
'KNOWLEDGE_SPACE_SETTINGS_MIGRATION_REQUIRED',
|
|
'KNOWLEDGE_SPACE_SETTINGS_REVISION_CONFLICT',
|
|
'LOGICAL_DOCUMENT_CAS_CONFLICT',
|
|
'MODEL_CAPABILITY_MISMATCH',
|
|
'MODEL_CONFIGURATION_STALE',
|
|
'MODEL_CREDENTIAL_INVALID',
|
|
'MODEL_CREDENTIAL_VALIDATION_UNAVAILABLE',
|
|
'MODEL_IDENTITY_MISMATCH',
|
|
'MODEL_PREFLIGHT_CANCELED',
|
|
'MODEL_PREFLIGHT_FAILED',
|
|
'MODEL_PREFLIGHT_TIMEOUT',
|
|
'MODEL_PREFLIGHT_UNAVAILABLE',
|
|
'MODEL_PROFILE_ACTIVATION_INCOMPLETE',
|
|
'MODEL_PROFILE_ACTIVATION_PERMISSION_REQUIRED',
|
|
'MODEL_RUNTIME_CONTEXT_LIMIT',
|
|
'MODEL_RUNTIME_FAILED',
|
|
'MODEL_RUNTIME_OUTPUT_LIMIT',
|
|
'MODEL_RUNTIME_RESPONSE_INVALID',
|
|
'MODEL_RUNTIME_TIMEOUT',
|
|
'MODEL_RUNTIME_UNAVAILABLE',
|
|
'MODEL_SELECTION_NOT_FOUND',
|
|
'RESEARCH_TASK_CAPABILITY_REVOKED',
|
|
'RESEARCH_TASK_DISPATCH_DEAD',
|
|
'RESEARCH_TASK_EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'RESEARCH_TASK_FAILED',
|
|
'RESEARCH_TASK_PERMISSION_SNAPSHOT_INVALID',
|
|
'RESEARCH_TASK_RUNTIME_SNAPSHOT_INVALID',
|
|
'RETRIEVAL_DELETION_IN_PROGRESS',
|
|
'RETRIEVAL_EXECUTION_LEASE_LOST',
|
|
'SOURCE_BULK_ACTION_FAILED',
|
|
'SOURCE_CONNECTION_UNAVAILABLE',
|
|
'SOURCE_CRAWL_PAGE_NOT_FOUND',
|
|
'SOURCE_CRAWL_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_CRAWL_RESULT_LIMIT_EXCEEDED',
|
|
'SOURCE_CREDENTIAL_CONFIG_INVALID',
|
|
'SOURCE_CREDENTIAL_MUTATION_FAILED',
|
|
'SOURCE_CREDENTIAL_TEST_FAILED',
|
|
'SOURCE_CREDENTIAL_UNAVAILABLE',
|
|
'SOURCE_DOCUMENT_COMPILATION_FAILED',
|
|
'SOURCE_DOCUMENT_MATERIALIZATION_FAILED',
|
|
'SOURCE_DOCUMENT_REPLACEMENT_SAGA_REQUIRED',
|
|
'SOURCE_IMPORT_PARTIAL_FAILURE',
|
|
'SOURCE_ONLINE_DOCUMENT_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DOCUMENT_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_PAGE_FETCH_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_UNAVAILABLE',
|
|
'SOURCE_ONLINE_DRIVE_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DRIVE_FILE_DOWNLOAD_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_UNAVAILABLE',
|
|
'SOURCE_OPERATION_FAILED',
|
|
'SOURCE_PROVIDER_REJECTED',
|
|
'SOURCE_PROVIDER_TIMEOUT',
|
|
'SOURCE_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_SECRET_INTEGRITY_FAILED',
|
|
'SOURCE_SECRET_REF_CONFLICT',
|
|
'SOURCE_SYNC_FAILED',
|
|
'SOURCE_SYNC_SELECTION_MISMATCH',
|
|
'SOURCE_VERSION_CONFLICT',
|
|
'SOURCE_WEBSITE_CRAWL_CONFIG_INVALID',
|
|
'SOURCE_WEBSITE_CRAWL_FAILED',
|
|
'SOURCE_WORKFLOW_CONTENT_MISSING',
|
|
'SOURCE_WORKFLOW_CONTENT_TOO_LARGE',
|
|
'SOURCE_WORKFLOW_EXTERNAL_TIMEOUT',
|
|
'SOURCE_WORKFLOW_FAILED',
|
|
'UPLOAD_INITIALIZATION_FAILED',
|
|
'UPLOAD_INTEGRITY_MISMATCH',
|
|
'VECTOR_SPACE_QUOTA_EXCEEDED',
|
|
'VECTOR_SPACE_QUOTA_UNAVAILABLE',
|
|
]),
|
|
message: z.string().min(1).max(1024),
|
|
parameters: z
|
|
.record(z.string(), z.union([z.string(), z.int(), z.number(), z.boolean()]))
|
|
.nullish(),
|
|
retryPolicy: z.enum(['after_configuration', 'automatic', 'manual', 'never']),
|
|
stage: z
|
|
.string()
|
|
.min(1)
|
|
.max(128)
|
|
.regex(/^[a-z][a-z0-9_.-]{0,127}$/)
|
|
.nullish(),
|
|
traceId: z
|
|
.string()
|
|
.min(1)
|
|
.max(128)
|
|
.regex(/^[A-Za-z0-9._:-]{1,128}$/)
|
|
.nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBackgroundTaskFailureResponse
|
|
*/
|
|
export const zKnowledgeFsBackgroundTaskFailureResponse = z.object({
|
|
document_id: z.string(),
|
|
document_title: z.string().nullish(),
|
|
error_code: z.string(),
|
|
error_message: z.string(),
|
|
failure: zKnowledgeFsPublicFailureResponse,
|
|
job_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkJobFailureResponse
|
|
*/
|
|
export const zKnowledgeFsBulkJobFailureResponse = z.object({
|
|
document_id: z.string(),
|
|
document_title: z.string().nullish(),
|
|
error_code: z.string(),
|
|
error_message: z.string(),
|
|
failure: zKnowledgeFsPublicFailureResponse.nullish(),
|
|
job_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkJobResponse
|
|
*/
|
|
export const zKnowledgeFsBulkJobResponse = z.object({
|
|
canceled_items: z.int().gte(0),
|
|
completed_items: z.int().gte(0),
|
|
created_at: z.iso.datetime(),
|
|
failed_item_ids: z.array(z.string()),
|
|
failed_items: z.int().gte(0),
|
|
failures: z.array(zKnowledgeFsBulkJobFailureResponse).optional(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
status: z.enum(['canceled', 'completed', 'failed', 'running']),
|
|
total_items: z.int().gte(0),
|
|
type: z.enum(['document_delete', 'document_reindex', 'document_upload']),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentCompilationJobResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentCompilationJobResponse = z.object({
|
|
base_head_revision: z.int().gte(0).nullish(),
|
|
candidate_fingerprint: z.string().nullish(),
|
|
candidate_publication_id: z.string().nullish(),
|
|
completed_at: z.number().nullish(),
|
|
created_at: z.number(),
|
|
document_asset_id: z.string(),
|
|
error: z.string().nullish(),
|
|
execution_attempts: z.int().gte(0).nullish(),
|
|
failure: zKnowledgeFsPublicFailureResponse.nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
max_execution_attempts: z.int().gte(1).nullish(),
|
|
run_state: z.string().nullish(),
|
|
stage: z.enum([
|
|
'canceled',
|
|
'failed',
|
|
'nodes_generated',
|
|
'outline_built',
|
|
'parsed',
|
|
'projection_built',
|
|
'published',
|
|
'queued',
|
|
'smoke_eval_passed',
|
|
]),
|
|
updated_at: z.number(),
|
|
version: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQueryImageReference
|
|
*/
|
|
export const zKnowledgeFsQueryImageReference = z.object({
|
|
uploadFileId: z.string().min(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSAdmittedQueryRequest
|
|
*/
|
|
export const zKnowledgeFsAdmittedQueryRequest = z.object({
|
|
activeDocumentIds: z.array(z.string()).max(100).optional(),
|
|
activeEntityIds: z.array(z.string()).max(100).optional(),
|
|
knowledgeSpaceId: z.string().min(1),
|
|
mode: z.enum(['auto', 'deep', 'fast', 'research']).nullish(),
|
|
query: z.string().max(16000).nullish(),
|
|
queryImages: z.array(zKnowledgeFsQueryImageReference).max(4).optional(),
|
|
sessionId: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQueryAdmissionResponse
|
|
*/
|
|
export const zKnowledgeFsQueryAdmissionResponse = z.object({
|
|
expires_at: z.iso.datetime(),
|
|
operation_id: z.literal('createQuery'),
|
|
request: zKnowledgeFsAdmittedQueryRequest,
|
|
token: z.string(),
|
|
trace_id: z.string(),
|
|
url: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQueryCreatePayload
|
|
*/
|
|
export const zKnowledgeFsQueryCreatePayload = z.object({
|
|
activeDocumentIds: z.array(z.string()).max(100).optional(),
|
|
activeEntityIds: z.array(z.string()).max(100).optional(),
|
|
mode: z.enum(['auto', 'deep', 'fast', 'research']).nullish(),
|
|
query: z.string().max(16000).nullish(),
|
|
queryImages: z.array(zKnowledgeFsQueryImageReference).max(4).optional(),
|
|
sessionId: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQueryImageResponse
|
|
*
|
|
* One query image a retrieval run was asked with, enriched for console display.
|
|
*
|
|
* The gateway persists only the UploadFile reference and static metadata; the console fills in
|
|
* the file name and a short-lived signed preview URL for files the caller still owns.
|
|
*/
|
|
export const zKnowledgeFsQueryImageResponse = z.object({
|
|
byte_size: z.int().gte(0).nullish(),
|
|
mime_type: z.string().nullish(),
|
|
name: z.string().nullish(),
|
|
preview_url: z.string().nullish(),
|
|
upload_file_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSReadinessCapabilities
|
|
*/
|
|
export const zKnowledgeFsReadinessCapabilities = z.object({
|
|
deep: z.boolean(),
|
|
index: z.boolean(),
|
|
ingest: z.boolean(),
|
|
query: z.boolean(),
|
|
research: z.boolean(),
|
|
source_sync: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSReadinessIssue
|
|
*/
|
|
export const zKnowledgeFsReadinessIssue = z.object({
|
|
code: z.enum(['binding_missing', 'incompatible', 'missing', 'unavailable', 'validation_failed']),
|
|
field: z.enum(['embedding', 'publication', 'reasoning', 'rerank']),
|
|
retryable: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskLimits
|
|
*/
|
|
export const zKnowledgeFsResearchTaskLimits = z.object({
|
|
maxRetrievalSteps: z.int().gte(1).nullish(),
|
|
maxScannedResources: z.int().gte(1).nullish(),
|
|
maxToolCalls: z.int().gte(1).nullish(),
|
|
timeoutMs: z.int().gte(1).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskCreatePayload
|
|
*/
|
|
export const zKnowledgeFsResearchTaskCreatePayload = z.object({
|
|
budgetUsd: z.number().gte(0).nullish(),
|
|
limits: zKnowledgeFsResearchTaskLimits.nullish(),
|
|
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
mode: z.enum(['auto', 'deep', 'fast', 'research']).nullish(),
|
|
query: z.string().max(16000).nullish(),
|
|
queryImages: z.array(zKnowledgeFsQueryImageReference).max(4).optional(),
|
|
topK: z.int().gte(1).lte(50).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskPartialResponse
|
|
*/
|
|
export const zKnowledgeFsResearchTaskPartialResponse = z.object({
|
|
answer: z.string().min(1).max(20000).nullish(),
|
|
evidence_bundle: z.record(z.string(), z.unknown()),
|
|
knowledge_space_id: z.string(),
|
|
research_task_job_id: z.string(),
|
|
sequence: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskPartialListResponse
|
|
*/
|
|
export const zKnowledgeFsResearchTaskPartialListResponse = z.object({
|
|
data: z.array(zKnowledgeFsResearchTaskPartialResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskPartialsQuery
|
|
*/
|
|
export const zKnowledgeFsResearchTaskPartialsQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).nullish(),
|
|
limit: z.int().gte(1).lte(100).optional().default(25),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskPlanBudgetResponse
|
|
*/
|
|
export const zKnowledgeFsResearchTaskPlanBudgetResponse = z.object({
|
|
budget_usd: z.number().gte(0).nullish(),
|
|
exceeds_budget: z.boolean(),
|
|
remaining_budget_usd: z.number().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskPlanPayload
|
|
*/
|
|
export const zKnowledgeFsResearchTaskPlanPayload = z.object({
|
|
budgetUsd: z.number().gte(0).nullish(),
|
|
mode: z.enum(['auto', 'deep', 'fast', 'research']).nullish(),
|
|
query: z.string().max(16000).nullish(),
|
|
queryImages: z.array(zKnowledgeFsQueryImageReference).max(4).optional(),
|
|
topK: z.int().gte(1).lte(50).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskResponse
|
|
*/
|
|
export const zKnowledgeFsResearchTaskResponse = z.object({
|
|
budget_usd: z.number().gte(0).nullish(),
|
|
completed_at: z.number().nullish(),
|
|
cost: z.record(z.string(), z.unknown()),
|
|
created_at: z.number(),
|
|
error: z.string().nullish(),
|
|
failure: zKnowledgeFsPublicFailureResponse.nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
limits: zKnowledgeFsResearchTaskLimits.nullish(),
|
|
metadata: z.record(z.string(), z.unknown()),
|
|
mode: z.enum(['auto', 'deep', 'fast', 'research']).nullish(),
|
|
query: z.string(),
|
|
query_images: z.array(zKnowledgeFsQueryImageResponse).optional(),
|
|
stage: z.enum([
|
|
'analyzing',
|
|
'canceled',
|
|
'completed',
|
|
'failed',
|
|
'generating',
|
|
'paused',
|
|
'planning',
|
|
'queued',
|
|
'retrieving',
|
|
]),
|
|
top_k: z.int().nullish(),
|
|
updated_at: z.number(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskListResponse
|
|
*/
|
|
export const zKnowledgeFsResearchTaskListResponse = z.object({
|
|
data: z.array(zKnowledgeFsResearchTaskResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskRetrievalPlanResponse
|
|
*/
|
|
export const zKnowledgeFsResearchTaskRetrievalPlanResponse = z.object({
|
|
dense_top_k: z.int().gte(0),
|
|
fts_top_k: z.int().gte(0),
|
|
fusion_limit: z.int().gte(0),
|
|
query_language: z.enum(['cjk', 'latin', 'mixed-cjk-latin', 'other']),
|
|
requested_mode: z.enum(['auto', 'deep', 'fast', 'research']),
|
|
rerank_candidate_limit: z.int().gte(0),
|
|
resolved_mode: z.enum(['deep', 'fast', 'research']),
|
|
strategy_version: z.string(),
|
|
top_k: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskPlanResponse
|
|
*/
|
|
export const zKnowledgeFsResearchTaskPlanResponse = z.object({
|
|
budget: zKnowledgeFsResearchTaskPlanBudgetResponse,
|
|
estimates: z.record(z.string(), z.unknown()),
|
|
knowledge_space_id: z.string(),
|
|
query: z.string(),
|
|
query_images: z.array(zKnowledgeFsQueryImageReference).optional(),
|
|
retrieval_plan: zKnowledgeFsResearchTaskRetrievalPlanResponse,
|
|
steps: z.array(z.record(z.string(), z.unknown())),
|
|
strategy_version: z.literal('research-dry-run-planner-v1'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResolvedDocumentReferenceResponse
|
|
*/
|
|
export const zKnowledgeFsResolvedDocumentReferenceResponse = z.object({
|
|
document_id: z.string(),
|
|
revision: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSRetrievalSettingsResponse
|
|
*/
|
|
export const zKnowledgeFsRetrievalSettingsResponse = z.object({
|
|
default_mode: z.enum(['deep', 'fast', 'research']),
|
|
reasoning_model: zKnowledgeFsEmbeddingSettingsResponse,
|
|
rerank: zKnowledgeFsProductRerankProfile,
|
|
revision: z.int().gte(1).nullish(),
|
|
score_threshold: zKnowledgeFsProductScoreThreshold,
|
|
top_k: z.int().gte(1).lte(100),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSemanticEnrichmentResponse
|
|
*/
|
|
export const zKnowledgeFsSemanticEnrichmentResponse = z.object({
|
|
error_code: z.string().nullish(),
|
|
error_message: z.string().nullish(),
|
|
failure: zKnowledgeFsPublicFailureResponse.nullish(),
|
|
nodes_completed: z.int().gte(0),
|
|
nodes_total: z.int().gte(0).nullish(),
|
|
provider_calls: z.int().gte(0).nullish(),
|
|
provider_calls_maximum: z.int().gte(0).nullish(),
|
|
state: z.enum(['disabled', 'failed', 'not_scheduled', 'pending', 'ready', 'running']),
|
|
updated_at: z.iso.datetime().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBackgroundTaskResponse
|
|
*/
|
|
export const zKnowledgeFsBackgroundTaskResponse = z.object({
|
|
can_cancel: z.boolean(),
|
|
can_retry: z.boolean(),
|
|
completed_at: z.iso.datetime().nullish(),
|
|
created_at: z.iso.datetime(),
|
|
document_id: z.string().nullish(),
|
|
document_revision: z.int().gte(1).nullish(),
|
|
document_title: z.string().nullish(),
|
|
error_code: z.string().nullish(),
|
|
error_message: z.string().nullish(),
|
|
failure: zKnowledgeFsPublicFailureResponse.nullish(),
|
|
failures: z.array(zKnowledgeFsBackgroundTaskFailureResponse).nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
operation: z.enum([
|
|
'document_delete',
|
|
'document_processing',
|
|
'document_reindex',
|
|
'document_upload',
|
|
'source_bulk',
|
|
'source_crawl_import',
|
|
'source_crawl_preview',
|
|
'source_online_document_import',
|
|
'source_online_drive_import',
|
|
'source_sync',
|
|
]),
|
|
progress_completed: z.int().gte(0),
|
|
progress_failed: z.int().gte(0),
|
|
progress_percent: z.int().gte(0).lte(100),
|
|
progress_total: z.int().gte(0),
|
|
semantic_enrichment: zKnowledgeFsSemanticEnrichmentResponse.nullish(),
|
|
source_id: z.string().nullish(),
|
|
source_title: z.string().nullish(),
|
|
state: z.enum(['canceled', 'completed', 'failed', 'queued', 'running']),
|
|
task_kind: z.enum(['document', 'document_bulk', 'source']),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBackgroundTaskListResponse
|
|
*/
|
|
export const zKnowledgeFsBackgroundTaskListResponse = z.object({
|
|
data: z.array(zKnowledgeFsBackgroundTaskResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentProcessingTaskResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentProcessingTaskResponse = z.object({
|
|
active_operations: z.array(z.string()).nullish(),
|
|
completed_at: z.iso.datetime().nullish(),
|
|
created_at: z.iso.datetime(),
|
|
document_id: z.string(),
|
|
document_revision: z.int().gte(1),
|
|
error_code: z
|
|
.enum([
|
|
'DOCUMENT_COMPILATION_FAILED',
|
|
'DOCUMENT_COMPILATION_LEASE_LOST',
|
|
'DOCUMENT_COMPILATION_PROFILE_CHANGED',
|
|
'DOCUMENT_COMPILATION_RETRYABLE',
|
|
'DOCUMENT_COUNT_QUOTA_EXCEEDED',
|
|
'DOCUMENT_COUNT_QUOTA_UNAVAILABLE',
|
|
'DOCUMENT_DISABLED',
|
|
'DOCUMENT_PARSER_INPUT_INVALID',
|
|
'DOCUMENT_PARSER_NOT_CONFIGURED',
|
|
'DOCUMENT_PARSER_RATE_LIMITED',
|
|
'DOCUMENT_PARSER_RESPONSE_INVALID',
|
|
'DOCUMENT_PARSER_TIMEOUT',
|
|
'DOCUMENT_PARSER_UNAVAILABLE',
|
|
'DOCUMENT_PARSER_UNSUPPORTED_TYPE',
|
|
'DOCUMENT_PDF_RENDER_FAILED',
|
|
'DURABLE_DELETION_IDEMPOTENCY_CONFLICT',
|
|
'EMBEDDING_DIMENSION_INVALID',
|
|
'EMBEDDING_DIMENSION_UNSUPPORTED',
|
|
'EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'KNOWLEDGE_FS_ACCESS_DENIED',
|
|
'KNOWLEDGE_FS_CONFLICT',
|
|
'KNOWLEDGE_FS_INTERNAL_ERROR',
|
|
'KNOWLEDGE_FS_INVALID_REQUEST',
|
|
'KNOWLEDGE_FS_NOT_FOUND',
|
|
'KNOWLEDGE_FS_RATE_LIMITED',
|
|
'KNOWLEDGE_FS_TIMEOUT',
|
|
'KNOWLEDGE_FS_UNAVAILABLE',
|
|
'KNOWLEDGE_SPACE_MANIFEST_NOT_FOUND',
|
|
'KNOWLEDGE_SPACE_MODEL_CONFIGURATION_REQUIRED',
|
|
'KNOWLEDGE_SPACE_SETTINGS_COMPILATION_IN_PROGRESS',
|
|
'KNOWLEDGE_SPACE_SETTINGS_MIGRATION_REQUIRED',
|
|
'KNOWLEDGE_SPACE_SETTINGS_REVISION_CONFLICT',
|
|
'LOGICAL_DOCUMENT_CAS_CONFLICT',
|
|
'MODEL_CAPABILITY_MISMATCH',
|
|
'MODEL_CONFIGURATION_STALE',
|
|
'MODEL_CREDENTIAL_INVALID',
|
|
'MODEL_CREDENTIAL_VALIDATION_UNAVAILABLE',
|
|
'MODEL_IDENTITY_MISMATCH',
|
|
'MODEL_PREFLIGHT_CANCELED',
|
|
'MODEL_PREFLIGHT_FAILED',
|
|
'MODEL_PREFLIGHT_TIMEOUT',
|
|
'MODEL_PREFLIGHT_UNAVAILABLE',
|
|
'MODEL_PROFILE_ACTIVATION_INCOMPLETE',
|
|
'MODEL_PROFILE_ACTIVATION_PERMISSION_REQUIRED',
|
|
'MODEL_RUNTIME_CONTEXT_LIMIT',
|
|
'MODEL_RUNTIME_FAILED',
|
|
'MODEL_RUNTIME_OUTPUT_LIMIT',
|
|
'MODEL_RUNTIME_RESPONSE_INVALID',
|
|
'MODEL_RUNTIME_TIMEOUT',
|
|
'MODEL_RUNTIME_UNAVAILABLE',
|
|
'MODEL_SELECTION_NOT_FOUND',
|
|
'RESEARCH_TASK_CAPABILITY_REVOKED',
|
|
'RESEARCH_TASK_DISPATCH_DEAD',
|
|
'RESEARCH_TASK_EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'RESEARCH_TASK_FAILED',
|
|
'RESEARCH_TASK_PERMISSION_SNAPSHOT_INVALID',
|
|
'RESEARCH_TASK_RUNTIME_SNAPSHOT_INVALID',
|
|
'RETRIEVAL_DELETION_IN_PROGRESS',
|
|
'RETRIEVAL_EXECUTION_LEASE_LOST',
|
|
'SOURCE_BULK_ACTION_FAILED',
|
|
'SOURCE_CONNECTION_UNAVAILABLE',
|
|
'SOURCE_CRAWL_PAGE_NOT_FOUND',
|
|
'SOURCE_CRAWL_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_CRAWL_RESULT_LIMIT_EXCEEDED',
|
|
'SOURCE_CREDENTIAL_CONFIG_INVALID',
|
|
'SOURCE_CREDENTIAL_MUTATION_FAILED',
|
|
'SOURCE_CREDENTIAL_TEST_FAILED',
|
|
'SOURCE_CREDENTIAL_UNAVAILABLE',
|
|
'SOURCE_DOCUMENT_COMPILATION_FAILED',
|
|
'SOURCE_DOCUMENT_MATERIALIZATION_FAILED',
|
|
'SOURCE_DOCUMENT_REPLACEMENT_SAGA_REQUIRED',
|
|
'SOURCE_IMPORT_PARTIAL_FAILURE',
|
|
'SOURCE_ONLINE_DOCUMENT_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DOCUMENT_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_PAGE_FETCH_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_UNAVAILABLE',
|
|
'SOURCE_ONLINE_DRIVE_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DRIVE_FILE_DOWNLOAD_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_UNAVAILABLE',
|
|
'SOURCE_OPERATION_FAILED',
|
|
'SOURCE_PROVIDER_REJECTED',
|
|
'SOURCE_PROVIDER_TIMEOUT',
|
|
'SOURCE_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_SECRET_INTEGRITY_FAILED',
|
|
'SOURCE_SECRET_REF_CONFLICT',
|
|
'SOURCE_SYNC_FAILED',
|
|
'SOURCE_SYNC_SELECTION_MISMATCH',
|
|
'SOURCE_VERSION_CONFLICT',
|
|
'SOURCE_WEBSITE_CRAWL_CONFIG_INVALID',
|
|
'SOURCE_WEBSITE_CRAWL_FAILED',
|
|
'SOURCE_WORKFLOW_CONTENT_MISSING',
|
|
'SOURCE_WORKFLOW_CONTENT_TOO_LARGE',
|
|
'SOURCE_WORKFLOW_EXTERNAL_TIMEOUT',
|
|
'SOURCE_WORKFLOW_FAILED',
|
|
'UPLOAD_INITIALIZATION_FAILED',
|
|
'UPLOAD_INTEGRITY_MISMATCH',
|
|
'VECTOR_SPACE_QUOTA_EXCEEDED',
|
|
'VECTOR_SPACE_QUOTA_UNAVAILABLE',
|
|
])
|
|
.nullish(),
|
|
error_message: z.string().nullish(),
|
|
failure: zKnowledgeFsPublicFailureResponse.nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
phase: z.string().nullish(),
|
|
progress_percent: z.int().gte(0).lte(100),
|
|
retry_at: z.iso.datetime().nullish(),
|
|
semantic_enrichment: zKnowledgeFsSemanticEnrichmentResponse.nullish(),
|
|
stage: z.enum([
|
|
'nodes_generated',
|
|
'outline_built',
|
|
'parsed',
|
|
'projection_built',
|
|
'published',
|
|
'queued',
|
|
'smoke_eval_passed',
|
|
]),
|
|
state: z.enum([
|
|
'canceled',
|
|
'dispatch_pending',
|
|
'failed',
|
|
'queued',
|
|
'retry_wait',
|
|
'running',
|
|
'succeeded',
|
|
'superseded',
|
|
]),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentProcessingTaskListResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentProcessingTaskListResponse = z.object({
|
|
data: z.array(zKnowledgeFsDocumentProcessingTaskResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSLogicalDocumentResponse
|
|
*/
|
|
export const zKnowledgeFsLogicalDocumentResponse = z.object({
|
|
active: zKnowledgeFsDocumentRevisionResponse.nullable(),
|
|
active_revision: z.int().gte(1).nullish(),
|
|
created_at: z.iso.datetime(),
|
|
disabled_at: z.iso.datetime().nullish(),
|
|
disabled_by_subject_id: z.string().nullish(),
|
|
enabled: z.boolean().optional().default(true),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
latest_task: zKnowledgeFsBackgroundTaskResponse.nullish(),
|
|
provider_item_id: z.string().nullish(),
|
|
row_version: z.int().gte(0),
|
|
source_id: z.string().nullish(),
|
|
status: z.enum(['deleting', 'failed', 'pending', 'ready']),
|
|
title: z.string(),
|
|
updated_at: z.iso.datetime(),
|
|
user_metadata: z.record(z.string(), z.unknown()),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSLogicalDocumentListResponse
|
|
*/
|
|
export const zKnowledgeFsLogicalDocumentListResponse = z.object({
|
|
data: z.array(zKnowledgeFsLogicalDocumentResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSServiceQueryImageUploadResponse
|
|
*/
|
|
export const zKnowledgeFsServiceQueryImageUploadResponse = z.object({
|
|
byte_size: z.int().gte(1),
|
|
mime_type: z.string(),
|
|
upload_file_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSServiceSourceConnectionCreatePayload
|
|
*
|
|
* Dify owns datasource secrets; clients supply an opaque binding in configuration.
|
|
*/
|
|
export const zKnowledgeFsServiceSourceConnectionCreatePayload = z.object({
|
|
authKind: z.literal('endpoint').optional().default('endpoint'),
|
|
configuration: z.record(z.string(), z.union([z.boolean(), z.int(), z.string()])).optional(),
|
|
credentials: z.record(z.string(), z.unknown()).optional(),
|
|
name: z.string().min(1).max(160),
|
|
providerId: z.string().min(1).max(128),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSServiceSourceCreatePayload
|
|
*/
|
|
export const zKnowledgeFsServiceSourceCreatePayload = z.object({
|
|
connectionId: z.string().nullish(),
|
|
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
name: z.string().min(1).max(200),
|
|
permissionScope: z.array(z.string()).max(0).optional(),
|
|
status: z.enum(['active', 'disabled', 'error', 'syncing']).nullish(),
|
|
type: z.enum(['connector', 'object-storage', 'upload', 'web']),
|
|
uri: z.string().min(1).max(4096),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSServiceSourceUpdatePayload
|
|
*/
|
|
export const zKnowledgeFsServiceSourceUpdatePayload = z.object({
|
|
expectedVersion: z.int().gte(1).nullish(),
|
|
metadata: z.record(z.string(), z.unknown()).nullish(),
|
|
name: z.string().min(1).max(200).nullish(),
|
|
providerParameters: z
|
|
.record(z.string(), z.union([z.boolean(), z.number(), z.string()]))
|
|
.nullish(),
|
|
status: z.enum(['active', 'disabled', 'error', 'syncing']).nullish(),
|
|
syncAfterUpdate: z.boolean().nullish(),
|
|
uri: z.string().min(1).max(4096).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSettingsPayload
|
|
*/
|
|
export const zKnowledgeFsSettingsPayload = z.object({
|
|
embedding: zKnowledgeFsProfileModelSelection.nullish(),
|
|
expectedRevision: z.int().gte(1),
|
|
retrieval: zKnowledgeFsProductRetrievalProfile.nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSettingsResponse
|
|
*/
|
|
export const zKnowledgeFsSettingsResponse = z.object({
|
|
active_profile_available: z.boolean(),
|
|
active_profile_revisions: zKnowledgeFsActiveProfileRevisions,
|
|
capabilities: zKnowledgeFsReadinessCapabilities,
|
|
configuration_state: z.enum([
|
|
'active',
|
|
'pending-validation',
|
|
'setup-required',
|
|
'validation-failed',
|
|
]),
|
|
embedding: zKnowledgeFsEmbeddingSettingsResponse.nullable(),
|
|
issues: z.array(zKnowledgeFsReadinessIssue),
|
|
retrieval: zKnowledgeFsRetrievalSettingsResponse.nullable(),
|
|
revision: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSettingsUpdateResponse
|
|
*/
|
|
export const zKnowledgeFsSettingsUpdateResponse = z.object({
|
|
migration: zKnowledgeFsProfileMigrationResponse.nullish(),
|
|
settings: zKnowledgeFsSettingsResponse,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceConnectionListQuery
|
|
*/
|
|
export const zKnowledgeFsSourceConnectionListQuery = z.object({
|
|
cursor: z.string().min(1).max(4096).nullish(),
|
|
limit: z.int().gte(1).lte(200).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceConnectionRefreshPayload
|
|
*/
|
|
export const zKnowledgeFsSourceConnectionRefreshPayload = z.object({
|
|
expectedVersion: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceConnectionResponse
|
|
*/
|
|
export const zKnowledgeFsSourceConnectionResponse = z.object({
|
|
auth_kind: z.enum(['api-key', 'endpoint', 'oauth2']),
|
|
configuration: z.record(z.string(), z.union([z.boolean(), z.int(), z.string()])),
|
|
created_at: z.iso.datetime(),
|
|
error_code: z.string().nullish(),
|
|
expires_at: z.iso.datetime().nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
name: z.string(),
|
|
provider_id: z.string(),
|
|
scopes: z.array(z.string()),
|
|
status: z.enum(['active', 'error', 'expired', 'provisioning', 'revoked']),
|
|
updated_at: z.iso.datetime(),
|
|
version: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceConnectionListResponse
|
|
*/
|
|
export const zKnowledgeFsSourceConnectionListResponse = z.object({
|
|
data: z.array(zKnowledgeFsSourceConnectionResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceCrawlResponse
|
|
*/
|
|
export const zKnowledgeFsSourceCrawlResponse = z.object({
|
|
completed: z.int().gte(0).nullish(),
|
|
failed: z.int().gte(0).nullish(),
|
|
imported: z.int().gte(0).nullish(),
|
|
pages: z.array(zKnowledgeFsCrawledPageResponse),
|
|
replaced: z.int().gte(0).nullish(),
|
|
skipped: z.int().gte(0).nullish(),
|
|
status: z.string().nullish(),
|
|
total: z.int().gte(0).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceCreatePayload
|
|
*/
|
|
export const zKnowledgeFsSourceCreatePayload = z.object({
|
|
connectionId: z.string().nullish(),
|
|
credentials: z.record(z.string(), z.unknown()).nullish(),
|
|
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
name: z.string().min(1).max(200),
|
|
permissionScope: z.array(z.string()).max(1000).optional(),
|
|
status: z.enum(['active', 'disabled', 'error', 'syncing']).nullish(),
|
|
type: z.enum(['connector', 'object-storage', 'upload', 'web']),
|
|
uri: z.string().min(1).max(4096),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceCredentialTestResponse
|
|
*/
|
|
export const zKnowledgeFsSourceCredentialTestResponse = z.object({
|
|
code: z
|
|
.enum([
|
|
'DOCUMENT_COMPILATION_FAILED',
|
|
'DOCUMENT_COMPILATION_LEASE_LOST',
|
|
'DOCUMENT_COMPILATION_PROFILE_CHANGED',
|
|
'DOCUMENT_COMPILATION_RETRYABLE',
|
|
'DOCUMENT_COUNT_QUOTA_EXCEEDED',
|
|
'DOCUMENT_COUNT_QUOTA_UNAVAILABLE',
|
|
'DOCUMENT_DISABLED',
|
|
'DOCUMENT_PARSER_INPUT_INVALID',
|
|
'DOCUMENT_PARSER_NOT_CONFIGURED',
|
|
'DOCUMENT_PARSER_RATE_LIMITED',
|
|
'DOCUMENT_PARSER_RESPONSE_INVALID',
|
|
'DOCUMENT_PARSER_TIMEOUT',
|
|
'DOCUMENT_PARSER_UNAVAILABLE',
|
|
'DOCUMENT_PARSER_UNSUPPORTED_TYPE',
|
|
'DOCUMENT_PDF_RENDER_FAILED',
|
|
'DURABLE_DELETION_IDEMPOTENCY_CONFLICT',
|
|
'EMBEDDING_DIMENSION_INVALID',
|
|
'EMBEDDING_DIMENSION_UNSUPPORTED',
|
|
'EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'KNOWLEDGE_FS_ACCESS_DENIED',
|
|
'KNOWLEDGE_FS_CONFLICT',
|
|
'KNOWLEDGE_FS_INTERNAL_ERROR',
|
|
'KNOWLEDGE_FS_INVALID_REQUEST',
|
|
'KNOWLEDGE_FS_NOT_FOUND',
|
|
'KNOWLEDGE_FS_RATE_LIMITED',
|
|
'KNOWLEDGE_FS_TIMEOUT',
|
|
'KNOWLEDGE_FS_UNAVAILABLE',
|
|
'KNOWLEDGE_SPACE_MANIFEST_NOT_FOUND',
|
|
'KNOWLEDGE_SPACE_MODEL_CONFIGURATION_REQUIRED',
|
|
'KNOWLEDGE_SPACE_SETTINGS_COMPILATION_IN_PROGRESS',
|
|
'KNOWLEDGE_SPACE_SETTINGS_MIGRATION_REQUIRED',
|
|
'KNOWLEDGE_SPACE_SETTINGS_REVISION_CONFLICT',
|
|
'LOGICAL_DOCUMENT_CAS_CONFLICT',
|
|
'MODEL_CAPABILITY_MISMATCH',
|
|
'MODEL_CONFIGURATION_STALE',
|
|
'MODEL_CREDENTIAL_INVALID',
|
|
'MODEL_CREDENTIAL_VALIDATION_UNAVAILABLE',
|
|
'MODEL_IDENTITY_MISMATCH',
|
|
'MODEL_PREFLIGHT_CANCELED',
|
|
'MODEL_PREFLIGHT_FAILED',
|
|
'MODEL_PREFLIGHT_TIMEOUT',
|
|
'MODEL_PREFLIGHT_UNAVAILABLE',
|
|
'MODEL_PROFILE_ACTIVATION_INCOMPLETE',
|
|
'MODEL_PROFILE_ACTIVATION_PERMISSION_REQUIRED',
|
|
'MODEL_RUNTIME_CONTEXT_LIMIT',
|
|
'MODEL_RUNTIME_FAILED',
|
|
'MODEL_RUNTIME_OUTPUT_LIMIT',
|
|
'MODEL_RUNTIME_RESPONSE_INVALID',
|
|
'MODEL_RUNTIME_TIMEOUT',
|
|
'MODEL_RUNTIME_UNAVAILABLE',
|
|
'MODEL_SELECTION_NOT_FOUND',
|
|
'RESEARCH_TASK_CAPABILITY_REVOKED',
|
|
'RESEARCH_TASK_DISPATCH_DEAD',
|
|
'RESEARCH_TASK_EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'RESEARCH_TASK_FAILED',
|
|
'RESEARCH_TASK_PERMISSION_SNAPSHOT_INVALID',
|
|
'RESEARCH_TASK_RUNTIME_SNAPSHOT_INVALID',
|
|
'RETRIEVAL_DELETION_IN_PROGRESS',
|
|
'RETRIEVAL_EXECUTION_LEASE_LOST',
|
|
'SOURCE_BULK_ACTION_FAILED',
|
|
'SOURCE_CONNECTION_UNAVAILABLE',
|
|
'SOURCE_CRAWL_PAGE_NOT_FOUND',
|
|
'SOURCE_CRAWL_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_CRAWL_RESULT_LIMIT_EXCEEDED',
|
|
'SOURCE_CREDENTIAL_CONFIG_INVALID',
|
|
'SOURCE_CREDENTIAL_MUTATION_FAILED',
|
|
'SOURCE_CREDENTIAL_TEST_FAILED',
|
|
'SOURCE_CREDENTIAL_UNAVAILABLE',
|
|
'SOURCE_DOCUMENT_COMPILATION_FAILED',
|
|
'SOURCE_DOCUMENT_MATERIALIZATION_FAILED',
|
|
'SOURCE_DOCUMENT_REPLACEMENT_SAGA_REQUIRED',
|
|
'SOURCE_IMPORT_PARTIAL_FAILURE',
|
|
'SOURCE_ONLINE_DOCUMENT_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DOCUMENT_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_PAGE_FETCH_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_UNAVAILABLE',
|
|
'SOURCE_ONLINE_DRIVE_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DRIVE_FILE_DOWNLOAD_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_UNAVAILABLE',
|
|
'SOURCE_OPERATION_FAILED',
|
|
'SOURCE_PROVIDER_REJECTED',
|
|
'SOURCE_PROVIDER_TIMEOUT',
|
|
'SOURCE_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_SECRET_INTEGRITY_FAILED',
|
|
'SOURCE_SECRET_REF_CONFLICT',
|
|
'SOURCE_SYNC_FAILED',
|
|
'SOURCE_SYNC_SELECTION_MISMATCH',
|
|
'SOURCE_VERSION_CONFLICT',
|
|
'SOURCE_WEBSITE_CRAWL_CONFIG_INVALID',
|
|
'SOURCE_WEBSITE_CRAWL_FAILED',
|
|
'SOURCE_WORKFLOW_CONTENT_MISSING',
|
|
'SOURCE_WORKFLOW_CONTENT_TOO_LARGE',
|
|
'SOURCE_WORKFLOW_EXTERNAL_TIMEOUT',
|
|
'SOURCE_WORKFLOW_FAILED',
|
|
'UPLOAD_INITIALIZATION_FAILED',
|
|
'UPLOAD_INTEGRITY_MISMATCH',
|
|
'VECTOR_SPACE_QUOTA_EXCEEDED',
|
|
'VECTOR_SPACE_QUOTA_UNAVAILABLE',
|
|
])
|
|
.nullish(),
|
|
error: z.string().nullish(),
|
|
failure: zKnowledgeFsPublicFailureResponse.nullish(),
|
|
valid: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceDeletePayload
|
|
*/
|
|
export const zKnowledgeFsSourceDeletePayload = z.object({
|
|
expectedRevision: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceDeleteQuery
|
|
*/
|
|
export const zKnowledgeFsSourceDeleteQuery = z.object({
|
|
documents: z.enum(['cascade', 'keep']).optional().default('cascade'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceEditOnlineDocumentSelectionPayload
|
|
*/
|
|
export const zKnowledgeFsSourceEditOnlineDocumentSelectionPayload = z.object({
|
|
items: z.array(zKnowledgeFsOnlineDocumentWorkflowImportItemPayload).min(1).max(200),
|
|
kind: z.literal('online_document'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceEditOnlineDriveSelectionPayload
|
|
*/
|
|
export const zKnowledgeFsSourceEditOnlineDriveSelectionPayload = z.object({
|
|
items: z.array(zKnowledgeFsOnlineDriveWorkflowImportItemPayload).min(1).max(200),
|
|
kind: z.literal('online_drive'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceEditSyncPolicyPayload
|
|
*/
|
|
export const zKnowledgeFsSourceEditSyncPolicyPayload = z.object({
|
|
customIntervalSeconds: z.int().gte(3600).lte(2592000).nullish(),
|
|
enabled: z.boolean(),
|
|
mode: z.enum(['custom', 'interval', 'manual']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceEditWebsiteSelectionPayload
|
|
*/
|
|
export const zKnowledgeFsSourceEditWebsiteSelectionPayload = z.object({
|
|
kind: z.literal('website_crawl'),
|
|
sourceUrls: z.array(z.string()).min(1).max(200),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceFileResponse
|
|
*/
|
|
export const zKnowledgeFsSourceFileResponse = z.object({
|
|
id: z.string(),
|
|
name: z.string(),
|
|
size: z.number().gte(0).nullish(),
|
|
type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceFileBucketResponse
|
|
*/
|
|
export const zKnowledgeFsSourceFileBucketResponse = z.object({
|
|
bucket: z.string().nullish(),
|
|
continuation_token: z.string().nullish(),
|
|
files: z.array(zKnowledgeFsSourceFileResponse),
|
|
is_truncated: z.boolean().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceFilesQuery
|
|
*/
|
|
export const zKnowledgeFsSourceFilesQuery = z.object({
|
|
bucket: z.string().nullish(),
|
|
continuationToken: z.string().min(1).max(4096).nullish(),
|
|
maxKeys: z.int().gte(1).lte(1000).nullish(),
|
|
prefix: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceFilesResponse
|
|
*/
|
|
export const zKnowledgeFsSourceFilesResponse = z.object({
|
|
buckets: z.array(zKnowledgeFsSourceFileBucketResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportConfigurationPayload
|
|
*/
|
|
export const zKnowledgeFsSourceImportConfigurationPayload = z.object({
|
|
expectedVersion: z.int().gte(1),
|
|
metadata: z.record(z.string(), z.unknown()).nullish(),
|
|
name: z.string().min(1).max(200).nullish(),
|
|
providerParameters: z
|
|
.record(z.string(), z.union([z.boolean(), z.number(), z.string()]))
|
|
.nullish(),
|
|
status: z.enum(['active', 'disabled', 'error', 'syncing']).nullish(),
|
|
uri: z.string().min(1).max(4096).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSCrawlImportPayload
|
|
*/
|
|
export const zKnowledgeFsCrawlImportPayload = z.object({
|
|
desiredSyncPolicy: zKnowledgeFsSourceEditSyncPolicyPayload.nullish(),
|
|
pages: z.array(zKnowledgeFsCrawlImportPagePayload).min(1).max(200).nullish(),
|
|
replaceExistingSelection: z.boolean().optional().default(false),
|
|
sourceUpdate: zKnowledgeFsSourceImportConfigurationPayload.nullish(),
|
|
sourceUrls: z.array(z.string()).min(1).max(200),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOnlineDocumentWorkflowImportPayload
|
|
*/
|
|
export const zKnowledgeFsOnlineDocumentWorkflowImportPayload = z.object({
|
|
desiredSyncPolicy: zKnowledgeFsSourceEditSyncPolicyPayload.nullish(),
|
|
items: z.array(zKnowledgeFsOnlineDocumentWorkflowImportItemPayload).min(1).max(200),
|
|
kind: z.literal('online-document-import'),
|
|
sourceUpdate: zKnowledgeFsSourceImportConfigurationPayload.nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOnlineDriveWorkflowImportPayload
|
|
*/
|
|
export const zKnowledgeFsOnlineDriveWorkflowImportPayload = z.object({
|
|
desiredSyncPolicy: zKnowledgeFsSourceEditSyncPolicyPayload.nullish(),
|
|
items: z.array(zKnowledgeFsOnlineDriveWorkflowImportItemPayload).min(1).max(200),
|
|
kind: z.literal('online-drive-import'),
|
|
sourceUpdate: zKnowledgeFsSourceImportConfigurationPayload.nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportFailureResponse
|
|
*/
|
|
export const zKnowledgeFsSourceImportFailureResponse = z.object({
|
|
code: z.enum([
|
|
'DOCUMENT_COMPILATION_FAILED',
|
|
'DOCUMENT_COMPILATION_LEASE_LOST',
|
|
'DOCUMENT_COMPILATION_PROFILE_CHANGED',
|
|
'DOCUMENT_COMPILATION_RETRYABLE',
|
|
'DOCUMENT_COUNT_QUOTA_EXCEEDED',
|
|
'DOCUMENT_COUNT_QUOTA_UNAVAILABLE',
|
|
'DOCUMENT_DISABLED',
|
|
'DOCUMENT_PARSER_INPUT_INVALID',
|
|
'DOCUMENT_PARSER_NOT_CONFIGURED',
|
|
'DOCUMENT_PARSER_RATE_LIMITED',
|
|
'DOCUMENT_PARSER_RESPONSE_INVALID',
|
|
'DOCUMENT_PARSER_TIMEOUT',
|
|
'DOCUMENT_PARSER_UNAVAILABLE',
|
|
'DOCUMENT_PARSER_UNSUPPORTED_TYPE',
|
|
'DOCUMENT_PDF_RENDER_FAILED',
|
|
'DURABLE_DELETION_IDEMPOTENCY_CONFLICT',
|
|
'EMBEDDING_DIMENSION_INVALID',
|
|
'EMBEDDING_DIMENSION_UNSUPPORTED',
|
|
'EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'KNOWLEDGE_FS_ACCESS_DENIED',
|
|
'KNOWLEDGE_FS_CONFLICT',
|
|
'KNOWLEDGE_FS_INTERNAL_ERROR',
|
|
'KNOWLEDGE_FS_INVALID_REQUEST',
|
|
'KNOWLEDGE_FS_NOT_FOUND',
|
|
'KNOWLEDGE_FS_RATE_LIMITED',
|
|
'KNOWLEDGE_FS_TIMEOUT',
|
|
'KNOWLEDGE_FS_UNAVAILABLE',
|
|
'KNOWLEDGE_SPACE_MANIFEST_NOT_FOUND',
|
|
'KNOWLEDGE_SPACE_MODEL_CONFIGURATION_REQUIRED',
|
|
'KNOWLEDGE_SPACE_SETTINGS_COMPILATION_IN_PROGRESS',
|
|
'KNOWLEDGE_SPACE_SETTINGS_MIGRATION_REQUIRED',
|
|
'KNOWLEDGE_SPACE_SETTINGS_REVISION_CONFLICT',
|
|
'LOGICAL_DOCUMENT_CAS_CONFLICT',
|
|
'MODEL_CAPABILITY_MISMATCH',
|
|
'MODEL_CONFIGURATION_STALE',
|
|
'MODEL_CREDENTIAL_INVALID',
|
|
'MODEL_CREDENTIAL_VALIDATION_UNAVAILABLE',
|
|
'MODEL_IDENTITY_MISMATCH',
|
|
'MODEL_PREFLIGHT_CANCELED',
|
|
'MODEL_PREFLIGHT_FAILED',
|
|
'MODEL_PREFLIGHT_TIMEOUT',
|
|
'MODEL_PREFLIGHT_UNAVAILABLE',
|
|
'MODEL_PROFILE_ACTIVATION_INCOMPLETE',
|
|
'MODEL_PROFILE_ACTIVATION_PERMISSION_REQUIRED',
|
|
'MODEL_RUNTIME_CONTEXT_LIMIT',
|
|
'MODEL_RUNTIME_FAILED',
|
|
'MODEL_RUNTIME_OUTPUT_LIMIT',
|
|
'MODEL_RUNTIME_RESPONSE_INVALID',
|
|
'MODEL_RUNTIME_TIMEOUT',
|
|
'MODEL_RUNTIME_UNAVAILABLE',
|
|
'MODEL_SELECTION_NOT_FOUND',
|
|
'RESEARCH_TASK_CAPABILITY_REVOKED',
|
|
'RESEARCH_TASK_DISPATCH_DEAD',
|
|
'RESEARCH_TASK_EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'RESEARCH_TASK_FAILED',
|
|
'RESEARCH_TASK_PERMISSION_SNAPSHOT_INVALID',
|
|
'RESEARCH_TASK_RUNTIME_SNAPSHOT_INVALID',
|
|
'RETRIEVAL_DELETION_IN_PROGRESS',
|
|
'RETRIEVAL_EXECUTION_LEASE_LOST',
|
|
'SOURCE_BULK_ACTION_FAILED',
|
|
'SOURCE_CONNECTION_UNAVAILABLE',
|
|
'SOURCE_CRAWL_PAGE_NOT_FOUND',
|
|
'SOURCE_CRAWL_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_CRAWL_RESULT_LIMIT_EXCEEDED',
|
|
'SOURCE_CREDENTIAL_CONFIG_INVALID',
|
|
'SOURCE_CREDENTIAL_MUTATION_FAILED',
|
|
'SOURCE_CREDENTIAL_TEST_FAILED',
|
|
'SOURCE_CREDENTIAL_UNAVAILABLE',
|
|
'SOURCE_DOCUMENT_COMPILATION_FAILED',
|
|
'SOURCE_DOCUMENT_MATERIALIZATION_FAILED',
|
|
'SOURCE_DOCUMENT_REPLACEMENT_SAGA_REQUIRED',
|
|
'SOURCE_IMPORT_PARTIAL_FAILURE',
|
|
'SOURCE_ONLINE_DOCUMENT_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DOCUMENT_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_PAGE_FETCH_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_UNAVAILABLE',
|
|
'SOURCE_ONLINE_DRIVE_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DRIVE_FILE_DOWNLOAD_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_UNAVAILABLE',
|
|
'SOURCE_OPERATION_FAILED',
|
|
'SOURCE_PROVIDER_REJECTED',
|
|
'SOURCE_PROVIDER_TIMEOUT',
|
|
'SOURCE_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_SECRET_INTEGRITY_FAILED',
|
|
'SOURCE_SECRET_REF_CONFLICT',
|
|
'SOURCE_SYNC_FAILED',
|
|
'SOURCE_SYNC_SELECTION_MISMATCH',
|
|
'SOURCE_VERSION_CONFLICT',
|
|
'SOURCE_WEBSITE_CRAWL_CONFIG_INVALID',
|
|
'SOURCE_WEBSITE_CRAWL_FAILED',
|
|
'SOURCE_WORKFLOW_CONTENT_MISSING',
|
|
'SOURCE_WORKFLOW_CONTENT_TOO_LARGE',
|
|
'SOURCE_WORKFLOW_EXTERNAL_TIMEOUT',
|
|
'SOURCE_WORKFLOW_FAILED',
|
|
'UPLOAD_INITIALIZATION_FAILED',
|
|
'UPLOAD_INTEGRITY_MISMATCH',
|
|
'VECTOR_SPACE_QUOTA_EXCEEDED',
|
|
'VECTOR_SPACE_QUOTA_UNAVAILABLE',
|
|
]),
|
|
error: z.string(),
|
|
failure: zKnowledgeFsPublicFailureResponse.nullish(),
|
|
filename: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportFilePayload
|
|
*/
|
|
export const zKnowledgeFsSourceImportFilePayload = z.object({
|
|
bucket: z.string().nullish(),
|
|
id: z.string().min(1),
|
|
mimeType: z.string().nullish(),
|
|
name: z.string().min(1).max(255),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportFilesPayload
|
|
*/
|
|
export const zKnowledgeFsSourceImportFilesPayload = z.object({
|
|
files: z.array(zKnowledgeFsSourceImportFilePayload).min(1).max(200),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportPagePayload
|
|
*/
|
|
export const zKnowledgeFsSourceImportPagePayload = z.object({
|
|
lastEditedTime: z.string().nullish(),
|
|
name: z.string().min(1).max(200).nullish(),
|
|
pageId: z.string().min(1),
|
|
type: z.string().min(1),
|
|
workspaceId: z.string().min(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportPagesPayload
|
|
*/
|
|
export const zKnowledgeFsSourceImportPagesPayload = z.object({
|
|
pages: z.array(zKnowledgeFsSourceImportPagePayload).min(1).max(200),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportedDocumentResponse
|
|
*/
|
|
export const zKnowledgeFsSourceImportedDocumentResponse = z.object({
|
|
document_asset_id: z.string(),
|
|
filename: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportResponse
|
|
*/
|
|
export const zKnowledgeFsSourceImportResponse = z.object({
|
|
documents: z.array(zKnowledgeFsSourceImportedDocumentResponse),
|
|
failed: z.array(zKnowledgeFsSourceImportFailureResponse),
|
|
skipped: z.array(z.string()),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourcePageResponse
|
|
*/
|
|
export const zKnowledgeFsSourcePageResponse = z.object({
|
|
last_edited_time: z.string().nullish(),
|
|
page_id: z.string(),
|
|
page_name: z.string(),
|
|
parent_id: z.string().nullish(),
|
|
type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourcePagesQuery
|
|
*/
|
|
export const zKnowledgeFsSourcePagesQuery = z.object({
|
|
cursor: z.string().min(1).max(4096).nullish(),
|
|
limit: z.int().gte(1).lte(200).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceProviderFieldResponse
|
|
*/
|
|
export const zKnowledgeFsSourceProviderFieldResponse = z.object({
|
|
description: z.string().nullish(),
|
|
format: z.enum(['password', 'uri']).nullish(),
|
|
name: z.string(),
|
|
required: z.boolean(),
|
|
secret: z.boolean(),
|
|
type: z.enum(['boolean', 'integer', 'string']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceProviderResponse
|
|
*/
|
|
export const zKnowledgeFsSourceProviderResponse = z.object({
|
|
auth_kinds: z.array(z.enum(['api-key', 'endpoint', 'oauth2'])),
|
|
available: z.boolean(),
|
|
capabilities: z.array(z.enum(['online-document', 'online-drive', 'website-crawl'])),
|
|
configuration: z.array(zKnowledgeFsSourceProviderFieldResponse),
|
|
display_name: z.string(),
|
|
id: z.string(),
|
|
unavailable_reason: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceProviderListResponse
|
|
*/
|
|
export const zKnowledgeFsSourceProviderListResponse = z.object({
|
|
data: z.array(zKnowledgeFsSourceProviderResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceSyncPolicyPayload
|
|
*/
|
|
export const zKnowledgeFsSourceSyncPolicyPayload = z.object({
|
|
customIntervalSeconds: z.int().gte(3600).lte(2592000).nullish(),
|
|
enabled: z.boolean(),
|
|
expectedRevision: z.int().gte(0),
|
|
expectedSourceVersion: z.int().gte(1),
|
|
mode: z.enum(['custom', 'interval', 'manual']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceSyncPolicyResponse
|
|
*/
|
|
export const zKnowledgeFsSourceSyncPolicyResponse = z.object({
|
|
created_at: z.iso.datetime(),
|
|
custom_interval_seconds: z.int().nullish(),
|
|
enabled: z.boolean(),
|
|
expected_source_version: z.int().gte(1),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
mode: z.enum(['custom', 'interval', 'manual']),
|
|
next_run_at: z.iso.datetime().nullish(),
|
|
revision: z.int().gte(1),
|
|
source_id: z.string(),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceUpdatePayload
|
|
*/
|
|
export const zKnowledgeFsSourceUpdatePayload = z.object({
|
|
expectedVersion: z.int().gte(1).nullish(),
|
|
metadata: z.record(z.string(), z.unknown()).nullish(),
|
|
name: z.string().min(1).max(200).nullish(),
|
|
providerParameters: z
|
|
.record(z.string(), z.union([z.boolean(), z.number(), z.string()]))
|
|
.nullish(),
|
|
selection: z
|
|
.discriminatedUnion('kind', [
|
|
zKnowledgeFsSourceEditWebsiteSelectionPayload,
|
|
zKnowledgeFsSourceEditOnlineDocumentSelectionPayload,
|
|
zKnowledgeFsSourceEditOnlineDriveSelectionPayload,
|
|
])
|
|
.nullish(),
|
|
status: z.enum(['active', 'disabled', 'error', 'syncing']).nullish(),
|
|
syncAfterUpdate: z.boolean().nullish(),
|
|
syncPolicy: zKnowledgeFsSourceEditSyncPolicyPayload.nullish(),
|
|
uri: z.string().min(1).max(4096).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceWorkflowCancelPayload
|
|
*/
|
|
export const zKnowledgeFsSourceWorkflowCancelPayload = z.object({
|
|
reason: z.string().max(1000).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceWorkflowImportPayload
|
|
*/
|
|
export const zKnowledgeFsSourceWorkflowImportPayload = z.discriminatedUnion('kind', [
|
|
zKnowledgeFsOnlineDocumentWorkflowImportPayload,
|
|
zKnowledgeFsOnlineDriveWorkflowImportPayload,
|
|
])
|
|
|
|
/**
|
|
* KnowledgeFSSourceWorkflowListQuery
|
|
*/
|
|
export const zKnowledgeFsSourceWorkflowListQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).nullish(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
sourceId: z.string().min(1).max(255).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceWorkflowResponse
|
|
*/
|
|
export const zKnowledgeFsSourceWorkflowResponse = z.object({
|
|
canceled_at: z.iso.datetime().nullish(),
|
|
checkpoint: z.string(),
|
|
completed_at: z.iso.datetime().nullish(),
|
|
created_at: z.iso.datetime(),
|
|
cursor: z.string().nullish(),
|
|
execution_attempts: z.int().gte(0),
|
|
failure: zKnowledgeFsPublicFailureResponse.nullish(),
|
|
id: z.string(),
|
|
kind: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
last_error_code: z
|
|
.enum([
|
|
'DOCUMENT_COMPILATION_FAILED',
|
|
'DOCUMENT_COMPILATION_LEASE_LOST',
|
|
'DOCUMENT_COMPILATION_PROFILE_CHANGED',
|
|
'DOCUMENT_COMPILATION_RETRYABLE',
|
|
'DOCUMENT_COUNT_QUOTA_EXCEEDED',
|
|
'DOCUMENT_COUNT_QUOTA_UNAVAILABLE',
|
|
'DOCUMENT_DISABLED',
|
|
'DOCUMENT_PARSER_INPUT_INVALID',
|
|
'DOCUMENT_PARSER_NOT_CONFIGURED',
|
|
'DOCUMENT_PARSER_RATE_LIMITED',
|
|
'DOCUMENT_PARSER_RESPONSE_INVALID',
|
|
'DOCUMENT_PARSER_TIMEOUT',
|
|
'DOCUMENT_PARSER_UNAVAILABLE',
|
|
'DOCUMENT_PARSER_UNSUPPORTED_TYPE',
|
|
'DOCUMENT_PDF_RENDER_FAILED',
|
|
'DURABLE_DELETION_IDEMPOTENCY_CONFLICT',
|
|
'EMBEDDING_DIMENSION_INVALID',
|
|
'EMBEDDING_DIMENSION_UNSUPPORTED',
|
|
'EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'KNOWLEDGE_FS_ACCESS_DENIED',
|
|
'KNOWLEDGE_FS_CONFLICT',
|
|
'KNOWLEDGE_FS_INTERNAL_ERROR',
|
|
'KNOWLEDGE_FS_INVALID_REQUEST',
|
|
'KNOWLEDGE_FS_NOT_FOUND',
|
|
'KNOWLEDGE_FS_RATE_LIMITED',
|
|
'KNOWLEDGE_FS_TIMEOUT',
|
|
'KNOWLEDGE_FS_UNAVAILABLE',
|
|
'KNOWLEDGE_SPACE_MANIFEST_NOT_FOUND',
|
|
'KNOWLEDGE_SPACE_MODEL_CONFIGURATION_REQUIRED',
|
|
'KNOWLEDGE_SPACE_SETTINGS_COMPILATION_IN_PROGRESS',
|
|
'KNOWLEDGE_SPACE_SETTINGS_MIGRATION_REQUIRED',
|
|
'KNOWLEDGE_SPACE_SETTINGS_REVISION_CONFLICT',
|
|
'LOGICAL_DOCUMENT_CAS_CONFLICT',
|
|
'MODEL_CAPABILITY_MISMATCH',
|
|
'MODEL_CONFIGURATION_STALE',
|
|
'MODEL_CREDENTIAL_INVALID',
|
|
'MODEL_CREDENTIAL_VALIDATION_UNAVAILABLE',
|
|
'MODEL_IDENTITY_MISMATCH',
|
|
'MODEL_PREFLIGHT_CANCELED',
|
|
'MODEL_PREFLIGHT_FAILED',
|
|
'MODEL_PREFLIGHT_TIMEOUT',
|
|
'MODEL_PREFLIGHT_UNAVAILABLE',
|
|
'MODEL_PROFILE_ACTIVATION_INCOMPLETE',
|
|
'MODEL_PROFILE_ACTIVATION_PERMISSION_REQUIRED',
|
|
'MODEL_RUNTIME_CONTEXT_LIMIT',
|
|
'MODEL_RUNTIME_FAILED',
|
|
'MODEL_RUNTIME_OUTPUT_LIMIT',
|
|
'MODEL_RUNTIME_RESPONSE_INVALID',
|
|
'MODEL_RUNTIME_TIMEOUT',
|
|
'MODEL_RUNTIME_UNAVAILABLE',
|
|
'MODEL_SELECTION_NOT_FOUND',
|
|
'RESEARCH_TASK_CAPABILITY_REVOKED',
|
|
'RESEARCH_TASK_DISPATCH_DEAD',
|
|
'RESEARCH_TASK_EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'RESEARCH_TASK_FAILED',
|
|
'RESEARCH_TASK_PERMISSION_SNAPSHOT_INVALID',
|
|
'RESEARCH_TASK_RUNTIME_SNAPSHOT_INVALID',
|
|
'RETRIEVAL_DELETION_IN_PROGRESS',
|
|
'RETRIEVAL_EXECUTION_LEASE_LOST',
|
|
'SOURCE_BULK_ACTION_FAILED',
|
|
'SOURCE_CONNECTION_UNAVAILABLE',
|
|
'SOURCE_CRAWL_PAGE_NOT_FOUND',
|
|
'SOURCE_CRAWL_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_CRAWL_RESULT_LIMIT_EXCEEDED',
|
|
'SOURCE_CREDENTIAL_CONFIG_INVALID',
|
|
'SOURCE_CREDENTIAL_MUTATION_FAILED',
|
|
'SOURCE_CREDENTIAL_TEST_FAILED',
|
|
'SOURCE_CREDENTIAL_UNAVAILABLE',
|
|
'SOURCE_DOCUMENT_COMPILATION_FAILED',
|
|
'SOURCE_DOCUMENT_MATERIALIZATION_FAILED',
|
|
'SOURCE_DOCUMENT_REPLACEMENT_SAGA_REQUIRED',
|
|
'SOURCE_IMPORT_PARTIAL_FAILURE',
|
|
'SOURCE_ONLINE_DOCUMENT_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DOCUMENT_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_PAGE_FETCH_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_UNAVAILABLE',
|
|
'SOURCE_ONLINE_DRIVE_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DRIVE_FILE_DOWNLOAD_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_UNAVAILABLE',
|
|
'SOURCE_OPERATION_FAILED',
|
|
'SOURCE_PROVIDER_REJECTED',
|
|
'SOURCE_PROVIDER_TIMEOUT',
|
|
'SOURCE_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_SECRET_INTEGRITY_FAILED',
|
|
'SOURCE_SECRET_REF_CONFLICT',
|
|
'SOURCE_SYNC_FAILED',
|
|
'SOURCE_SYNC_SELECTION_MISMATCH',
|
|
'SOURCE_VERSION_CONFLICT',
|
|
'SOURCE_WEBSITE_CRAWL_CONFIG_INVALID',
|
|
'SOURCE_WEBSITE_CRAWL_FAILED',
|
|
'SOURCE_WORKFLOW_CONTENT_MISSING',
|
|
'SOURCE_WORKFLOW_CONTENT_TOO_LARGE',
|
|
'SOURCE_WORKFLOW_EXTERNAL_TIMEOUT',
|
|
'SOURCE_WORKFLOW_FAILED',
|
|
'UPLOAD_INITIALIZATION_FAILED',
|
|
'UPLOAD_INTEGRITY_MISMATCH',
|
|
'VECTOR_SPACE_QUOTA_EXCEEDED',
|
|
'VECTOR_SPACE_QUOTA_UNAVAILABLE',
|
|
])
|
|
.nullish(),
|
|
max_execution_attempts: z.int().gte(1),
|
|
progress_completed: z.int().gte(0),
|
|
progress_failed: z.int().gte(0),
|
|
progress_skipped: z.int().gte(0),
|
|
progress_total: z.int().gte(0).nullish(),
|
|
source_id: z.string().nullish(),
|
|
state: z.string(),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceResponse
|
|
*/
|
|
export const zKnowledgeFsSourceResponse = z.object({
|
|
connection_id: z.string().nullish(),
|
|
created_at: z.iso.datetime(),
|
|
credential_configured: z.boolean().nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
last_synced_at: z.iso.datetime().nullish(),
|
|
metadata: z.record(z.string(), z.unknown()),
|
|
name: z.string(),
|
|
permission_scope: z.array(z.string()),
|
|
status: z.enum(['active', 'disabled', 'error', 'syncing']),
|
|
sync_policy: zKnowledgeFsSourceSyncPolicyResponse.nullish(),
|
|
sync_workflow: zKnowledgeFsSourceWorkflowResponse.nullish(),
|
|
type: z.enum(['connector', 'object-storage', 'upload', 'web']),
|
|
updated_at: z.iso.datetime(),
|
|
uri: z.string(),
|
|
version: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceListResponse
|
|
*/
|
|
export const zKnowledgeFsSourceListResponse = z.object({
|
|
data: z.array(zKnowledgeFsSourceResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceWorkflowListResponse
|
|
*/
|
|
export const zKnowledgeFsSourceWorkflowListResponse = z.object({
|
|
data: z.array(zKnowledgeFsSourceWorkflowResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceWorkspacePagesResponse
|
|
*/
|
|
export const zKnowledgeFsSourceWorkspacePagesResponse = z.object({
|
|
pages: z.array(zKnowledgeFsSourcePageResponse),
|
|
total: z.int().gte(0).nullish(),
|
|
workspace_id: z.string().nullish(),
|
|
workspace_name: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourcePagesResponse
|
|
*/
|
|
export const zKnowledgeFsSourcePagesResponse = z.object({
|
|
next_cursor: z.string().nullish(),
|
|
workspaces: z.array(zKnowledgeFsSourceWorkspacePagesResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceEntriesQuery
|
|
*/
|
|
export const zKnowledgeFsTraceEntriesQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).nullish(),
|
|
limit: z.int().gte(1).lte(200).optional().default(100),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceEntryResponse
|
|
*/
|
|
export const zKnowledgeFsTraceEntryResponse = z.object({
|
|
kind: z.enum(['directory', 'resource']),
|
|
metadata: z.record(z.string(), z.unknown()),
|
|
name: z.string(),
|
|
path: z.string(),
|
|
resource_type: z.string().nullish(),
|
|
target_id: z.string().nullish(),
|
|
version: z.int().gte(1).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceEntryListResponse
|
|
*/
|
|
export const zKnowledgeFsTraceEntryListResponse = z.object({
|
|
consistency_class: z.string().nullish(),
|
|
data: z.array(zKnowledgeFsTraceEntryResponse),
|
|
next_cursor: z.string().nullish(),
|
|
path: z.string(),
|
|
preview: z.boolean().nullish(),
|
|
truncated: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceProfileResponse
|
|
*/
|
|
export const zKnowledgeFsTraceProfileResponse = z.object({
|
|
embedding_model: z.string().nullish(),
|
|
embedding_vector_space_id: z.string().nullish(),
|
|
projection_publication_id: z.string().nullish(),
|
|
projection_version: z.int().gte(1).nullish(),
|
|
reasoning_model: z.string().nullish(),
|
|
rerank_model: z.string().nullish(),
|
|
retrieval_profile_revision: z.int().gte(1).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceScoresResponse
|
|
*/
|
|
export const zKnowledgeFsTraceScoresResponse = z.object({
|
|
final: z.number().gte(0).lte(1).nullish(),
|
|
rerank: z.number().gte(0).lte(1).nullish(),
|
|
retrieval: z.number().gte(0).lte(1).nullish(),
|
|
})
|
|
|
|
export const zKnowledgeFsTraceSource = z.enum([
|
|
'agent',
|
|
'mcp',
|
|
'retrieval_test',
|
|
'service_api',
|
|
'workflow',
|
|
])
|
|
|
|
/**
|
|
* KnowledgeFSAnswerTraceResponse
|
|
*/
|
|
export const zKnowledgeFsAnswerTraceResponse = z.object({
|
|
created_at: z.iso.datetime(),
|
|
evidence_bundle_id: z.string().nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
mode: z.enum(['auto', 'deep', 'fast', 'research']),
|
|
query: z.string(),
|
|
query_images: z.array(zKnowledgeFsQueryImageResponse).optional(),
|
|
source: zKnowledgeFsTraceSource.optional().default('retrieval_test'),
|
|
steps: z.array(zKnowledgeFsAnswerTraceStepResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceStageResponse
|
|
*/
|
|
export const zKnowledgeFsTraceStageResponse = z.object({
|
|
candidate_count: z.int().gte(0).nullish(),
|
|
name: z.string(),
|
|
status: z.enum(['error', 'ok', 'skipped']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceResponse
|
|
*/
|
|
export const zKnowledgeFsTraceResponse = z.object({
|
|
completed: z.boolean(),
|
|
created_at: z.iso.datetime(),
|
|
duration_ms: z.int().gte(0).nullish(),
|
|
evidence_bundle_id: z.string().nullish(),
|
|
evidence_state: z.string().nullish(),
|
|
final_score: z.number().gte(0).lte(1).nullish(),
|
|
id: z.string(),
|
|
mode: z.enum(['auto', 'deep', 'fast', 'research']),
|
|
open_bad_case_id: z.string().nullish(),
|
|
profile: zKnowledgeFsTraceProfileResponse,
|
|
query: z.string(),
|
|
query_images: z.array(zKnowledgeFsQueryImageResponse).optional(),
|
|
result_count: z.int().gte(0),
|
|
scores: zKnowledgeFsTraceScoresResponse,
|
|
source: zKnowledgeFsTraceSource.optional().default('retrieval_test'),
|
|
stages: z.array(zKnowledgeFsTraceStageResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceListResponse
|
|
*/
|
|
export const zKnowledgeFsTraceListResponse = z.object({
|
|
data: z.array(zKnowledgeFsTraceResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFsAccessDeniedError
|
|
*
|
|
* Agent Knowledge Base operation is not allowed.
|
|
*/
|
|
export const zKnowledgeFsAccessDeniedError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('knowledge_fs_access_denied'),
|
|
status: z.literal(403),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* KnowledgeFsCitation
|
|
*
|
|
* Immutable evidence identity; no signed URLs, tokens or storage keys.
|
|
*/
|
|
export const zKnowledgeFsCitation = z.object({
|
|
artifact_hash: z.string().min(1).max(255),
|
|
control_space_id: z.string().length(36),
|
|
document_asset_id: z.string().min(1).max(512),
|
|
document_title: z.string().max(2000).nullish(),
|
|
document_version: z.int().gte(1).nullish(),
|
|
end_offset: z.int().gte(0).nullish(),
|
|
id: z.string().regex(/^kfs_[a-f0-9]{32}$/),
|
|
node_id: z.string().min(1).max(512),
|
|
page_number: z.int().gte(0).nullish(),
|
|
parse_artifact_id: z.string().max(512).nullish(),
|
|
section_path: z.array(z.string()).max(64).optional(),
|
|
space_name: z.string().min(1).max(120),
|
|
start_offset: z.int().gte(0).nullish(),
|
|
})
|
|
|
|
/**
|
|
* BlockingRetrieverResourceResponse
|
|
*/
|
|
export const zBlockingRetrieverResourceResponse = z.object({
|
|
content: z.string().nullish(),
|
|
created_at: z.int().nullish(),
|
|
data_source_type: z.string().nullish(),
|
|
dataset_id: z.uuid().nullish(),
|
|
dataset_name: z.string().nullish(),
|
|
document_id: z.uuid().nullish(),
|
|
document_name: z.string().nullish(),
|
|
hit_count: z.int().nullish(),
|
|
id: z.uuid().nullish(),
|
|
index_node_hash: z.string().nullish(),
|
|
knowledge_fs_citation: zKnowledgeFsCitation.nullish(),
|
|
message_id: z.uuid().nullish(),
|
|
position: z.int(),
|
|
score: z.number().nullish(),
|
|
segment_id: z.uuid().nullish(),
|
|
segment_position: z.int().nullish(),
|
|
summary: z.string().nullish(),
|
|
word_count: z.int().nullish(),
|
|
})
|
|
|
|
/**
|
|
* BlockingMetadataResponse
|
|
*/
|
|
export const zBlockingMetadataResponse = z.object({
|
|
retriever_resources: z.array(zBlockingRetrieverResourceResponse).nullish(),
|
|
usage: zBlockingUsageResponse.nullish(),
|
|
})
|
|
|
|
/**
|
|
* ChatMessageBlockingResponse
|
|
*/
|
|
export const zChatMessageBlockingResponse = z.object({
|
|
answer: z.string(),
|
|
conversation_id: z.uuid(),
|
|
created_at: z.int(),
|
|
event: z.literal('message'),
|
|
id: z.uuid(),
|
|
message_id: z.uuid(),
|
|
metadata: zBlockingMetadataResponse,
|
|
mode: z.string(),
|
|
task_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* ChatPausedBlockingDataResponse
|
|
*/
|
|
export const zChatPausedBlockingDataResponse = z.object({
|
|
answer: z.string(),
|
|
conversation_id: z.uuid(),
|
|
created_at: z.int(),
|
|
elapsed_time: z.number(),
|
|
id: z.uuid(),
|
|
message_id: z.uuid(),
|
|
metadata: zBlockingMetadataResponse,
|
|
mode: z.string(),
|
|
paused_nodes: z.array(z.string()),
|
|
reasons: z.array(zChatPauseReasonResponse),
|
|
status: z.literal('paused'),
|
|
total_steps: z.int(),
|
|
total_tokens: z.int(),
|
|
workflow_run_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* ChatPausedBlockingResponse
|
|
*/
|
|
export const zChatPausedBlockingResponse = z.object({
|
|
answer: z.string(),
|
|
conversation_id: z.uuid(),
|
|
created_at: z.int(),
|
|
data: zChatPausedBlockingDataResponse,
|
|
event: z.literal('workflow_paused'),
|
|
id: z.uuid(),
|
|
message_id: z.uuid(),
|
|
metadata: zBlockingMetadataResponse,
|
|
mode: z.string(),
|
|
task_id: z.uuid(),
|
|
workflow_run_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* ChatBlockingResponse
|
|
*
|
|
* Blocking chat response for a completed message or paused Chatflow.
|
|
*/
|
|
export const zChatBlockingResponse = z.discriminatedUnion('event', [
|
|
zChatMessageBlockingResponse,
|
|
zChatPausedBlockingResponse,
|
|
])
|
|
|
|
/**
|
|
* CompletionBlockingResponse
|
|
*/
|
|
export const zCompletionBlockingResponse = z.object({
|
|
answer: z.string(),
|
|
created_at: z.int(),
|
|
event: z.string(),
|
|
id: z.uuid(),
|
|
message_id: z.uuid(),
|
|
metadata: zBlockingMetadataResponse,
|
|
mode: z.string(),
|
|
task_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFsConflictError
|
|
*
|
|
* Agent Knowledge Base operation conflicts with the current resource state.
|
|
*/
|
|
export const zKnowledgeFsConflictError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('knowledge_fs_conflict'),
|
|
status: z.literal(409),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* KnowledgeFsInvalidCredentialError
|
|
*
|
|
* Invalid Agent Knowledge Base service credential.
|
|
*/
|
|
export const zKnowledgeFsInvalidCredentialError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('knowledge_fs_invalid_credential'),
|
|
status: z.literal(401),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* KnowledgeFsInvalidRequestError
|
|
*
|
|
* Agent Knowledge Base request is invalid.
|
|
*/
|
|
export const zKnowledgeFsInvalidRequestError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('knowledge_fs_invalid_request'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* KnowledgeFsOperationUnavailableError
|
|
*
|
|
* Agent Knowledge Base operation is not available.
|
|
*/
|
|
export const zKnowledgeFsOperationUnavailableError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('knowledge_fs_operation_unavailable'),
|
|
status: z.literal(503),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* KnowledgeFsRateLimitExceededError
|
|
*
|
|
* Agent Knowledge Base request rate limit exceeded.
|
|
*/
|
|
export const zKnowledgeFsRateLimitExceededError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('knowledge_fs_rate_limit_exceeded'),
|
|
status: z.literal(429),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* KnowledgeFsRequestRejectedError
|
|
*
|
|
* Agent Knowledge Base request was rejected.
|
|
*/
|
|
export const zKnowledgeFsRequestRejectedError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('knowledge_fs_request_rejected'),
|
|
status: z.literal(422),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* KnowledgeFsRequestTooLargeError
|
|
*
|
|
* Agent Knowledge Base request is too large.
|
|
*/
|
|
export const zKnowledgeFsRequestTooLargeError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('knowledge_fs_request_too_large'),
|
|
status: z.literal(413),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* KnowledgeFsResourceNotFoundError
|
|
*
|
|
* Agent Knowledge Base resource was not found.
|
|
*/
|
|
export const zKnowledgeFsResourceNotFoundError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('knowledge_fs_resource_not_found'),
|
|
status: z.literal(404),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* KnowledgeFsUpstreamUnavailableError
|
|
*
|
|
* Agent Knowledge Base is unavailable.
|
|
*/
|
|
export const zKnowledgeFsUpstreamUnavailableError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('knowledge_fs_upstream_unavailable'),
|
|
status: z.literal(502),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* KnowledgeTagResponse
|
|
*/
|
|
export const zKnowledgeTagResponse = z.object({
|
|
binding_count: z.string().nullish(),
|
|
id: z.string(),
|
|
name: z.string(),
|
|
type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeTagListResponse
|
|
*/
|
|
export const zKnowledgeTagListResponse = z.array(zKnowledgeTagResponse)
|
|
|
|
/**
|
|
* MessageFeedbackPayload
|
|
*/
|
|
export const zMessageFeedbackPayload = z.object({
|
|
content: z.string().nullish(),
|
|
rating: z.enum(['dislike', 'like']).nullish(),
|
|
})
|
|
|
|
/**
|
|
* MessageFeedbackPayload
|
|
*/
|
|
export const zMessageFeedbackPayloadWithUser = z.object({
|
|
content: z.string().nullish(),
|
|
rating: z.enum(['dislike', 'like']).nullish(),
|
|
user: z.string(),
|
|
})
|
|
|
|
/**
|
|
* MessageFeedbackRatingRequiredError
|
|
*
|
|
* A rating is required when there is no existing feedback to remove.
|
|
*/
|
|
export const zMessageFeedbackRatingRequiredError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('message_feedback_rating_required'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* MessageFile
|
|
*/
|
|
export const zMessageFile = z.object({
|
|
belongs_to: z.string().nullish(),
|
|
filename: z.string(),
|
|
id: z.uuid(),
|
|
mime_type: z.string().nullish(),
|
|
size: z.int().nullish(),
|
|
transfer_method: z.string(),
|
|
type: z.string(),
|
|
upload_file_id: z.uuid().nullish(),
|
|
url: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* MessageListQuery
|
|
*/
|
|
export const zMessageListQuery = z.object({
|
|
conversation_id: z.string(),
|
|
first_id: z.string().nullish(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
})
|
|
|
|
/**
|
|
* MetadataArgs
|
|
*/
|
|
export const zMetadataArgs = z.object({
|
|
name: z.string(),
|
|
type: z.enum(['number', 'string', 'time']),
|
|
})
|
|
|
|
/**
|
|
* MetadataDetail
|
|
*/
|
|
export const zMetadataDetail = z.object({
|
|
id: z.uuid(),
|
|
name: z.string(),
|
|
value: z.union([z.string(), z.int(), z.number()]).nullish(),
|
|
})
|
|
|
|
/**
|
|
* DocumentMetadataOperation
|
|
*/
|
|
export const zDocumentMetadataOperation = z.object({
|
|
document_id: z.uuid(),
|
|
metadata_list: z.array(zMetadataDetail),
|
|
partial_update: z.boolean().optional().default(false),
|
|
})
|
|
|
|
/**
|
|
* MetadataFilteringCondition
|
|
*
|
|
* Metadata Filtering Condition.
|
|
*/
|
|
export const zMetadataFilteringCondition = z.object({
|
|
conditions: z.array(zCondition).nullish(),
|
|
logical_operator: z.enum(['and', 'or']).nullish().default('and'),
|
|
})
|
|
|
|
/**
|
|
* MetadataOperationData
|
|
*
|
|
* Metadata operation data
|
|
*/
|
|
export const zMetadataOperationData = z.object({
|
|
operation_data: z.array(zDocumentMetadataOperation),
|
|
})
|
|
|
|
/**
|
|
* MetadataUpdatePayload
|
|
*/
|
|
export const zMetadataUpdatePayload = z.object({
|
|
name: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ModelCurrentlyNotSupportError
|
|
*
|
|
* Dify Hosted OpenAI trial currently not support the GPT-4 model.
|
|
*/
|
|
export const zModelCurrentlyNotSupportError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('model_currently_not_support'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* ModelFeature
|
|
*
|
|
* Enum class for llm feature.
|
|
*/
|
|
export const zModelFeature = z.enum([
|
|
'agent-thought',
|
|
'audio',
|
|
'document',
|
|
'multi-tool-call',
|
|
'polling',
|
|
'stream-tool-call',
|
|
'structured-output',
|
|
'tool-call',
|
|
'video',
|
|
'vision',
|
|
])
|
|
|
|
/**
|
|
* ModelPropertyKey
|
|
*
|
|
* Enum class for model property key.
|
|
*/
|
|
export const zModelPropertyKey = z.enum([
|
|
'audio_type',
|
|
'context_size',
|
|
'default_voice',
|
|
'file_upload_limit',
|
|
'max_characters_per_chunk',
|
|
'max_chunks',
|
|
'max_workers',
|
|
'mode',
|
|
'supported_file_extensions',
|
|
'voices',
|
|
'word_limit',
|
|
])
|
|
|
|
/**
|
|
* I18nObject
|
|
*
|
|
* Model class for i18n object.
|
|
*/
|
|
export const zModelRuntimeI18nObject = z.object({
|
|
en_US: z.string(),
|
|
zh_Hans: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* ModelStatus
|
|
*
|
|
* Enum class for model status.
|
|
*/
|
|
export const zModelStatus = z.enum([
|
|
'active',
|
|
'credential-removed',
|
|
'disabled',
|
|
'no-configure',
|
|
'no-permission',
|
|
'quota-exceeded',
|
|
])
|
|
|
|
/**
|
|
* ModelType
|
|
*
|
|
* Enum class for model type.
|
|
*/
|
|
export const zModelType = z.enum([
|
|
'llm',
|
|
'moderation',
|
|
'rerank',
|
|
'speech2text',
|
|
'text-embedding',
|
|
'tts',
|
|
])
|
|
|
|
/**
|
|
* NoAudioUploadedError
|
|
*
|
|
* Please upload your audio.
|
|
*/
|
|
export const zNoAudioUploadedError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('no_audio_uploaded'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* NoFileUploadedError
|
|
*
|
|
* Please upload your file.
|
|
*/
|
|
export const zNoFileUploadedError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('no_file_uploaded'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* NotChatAppError
|
|
*
|
|
* Please check if your app mode matches the right API route.
|
|
*/
|
|
export const zNotChatAppError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('not_chat_app'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* NotWorkflowAppError
|
|
*
|
|
* Please check if your app mode matches the right API route.
|
|
*/
|
|
export const zNotWorkflowAppError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('not_workflow_app'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* ServiceApiUserPayload
|
|
*/
|
|
export const zOptionalServiceApiUserPayload = z.object({
|
|
user: z.string().optional(),
|
|
})
|
|
|
|
/**
|
|
* PermissionEnum
|
|
*
|
|
* Shared permission levels for resources (datasets, credentials, etc.)
|
|
*/
|
|
export const zPermissionEnum = z.enum(['all_team_members', 'only_me', 'partial_members'])
|
|
|
|
/**
|
|
* PipelineDataset
|
|
*/
|
|
export const zPipelineDataset = z.object({
|
|
chunk_structure: z.string(),
|
|
description: z.string().optional().default(''),
|
|
id: z.string(),
|
|
name: z.string(),
|
|
})
|
|
|
|
/**
|
|
* PipelineDocument
|
|
*/
|
|
export const zPipelineDocument = z.object({
|
|
data_source_info: z.record(z.string(), z.unknown()).nullish(),
|
|
data_source_type: z.string(),
|
|
enabled: z.boolean(),
|
|
error: z.string().nullish(),
|
|
id: z.string(),
|
|
indexing_status: z.string(),
|
|
name: z.string(),
|
|
position: z.int(),
|
|
})
|
|
|
|
/**
|
|
* PipelineRunApiEntity
|
|
*/
|
|
export const zPipelineRunApiEntity = z.object({
|
|
datasource_info_list: z.array(
|
|
z.union([
|
|
z.object({
|
|
name: z.string().optional(),
|
|
reference: z.string(),
|
|
}),
|
|
z.object({
|
|
credential_id: z.string().optional(),
|
|
page: z.object({
|
|
page_id: z.string(),
|
|
page_name: z.string().optional(),
|
|
type: z.string(),
|
|
}),
|
|
workspace_id: z.string(),
|
|
}),
|
|
z.object({
|
|
title: z.string().optional(),
|
|
url: z.string(),
|
|
}),
|
|
z.object({
|
|
bucket: z.string().optional(),
|
|
id: z.string(),
|
|
name: z.string().optional(),
|
|
type: z.enum(['file', 'folder']),
|
|
}),
|
|
]),
|
|
),
|
|
datasource_type: z.enum(['local_file', 'online_document', 'online_drive', 'website_crawl']),
|
|
inputs: z.record(z.string(), z.unknown()),
|
|
is_published: z.boolean(),
|
|
response_mode: z.enum(['blocking', 'streaming']),
|
|
start_node_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* PipelineRunError
|
|
*
|
|
* An error occurred while running the pipeline.
|
|
*/
|
|
export const zPipelineRunError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('pipeline_run_error'),
|
|
status: z.literal(500),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* PipelineUploadFileResponse
|
|
*/
|
|
export const zPipelineUploadFileResponse = z.object({
|
|
created_at: z.string().nullish(),
|
|
created_by: z.string(),
|
|
extension: z.string(),
|
|
id: z.string(),
|
|
mime_type: z.string().nullish(),
|
|
name: z.string(),
|
|
size: z.int(),
|
|
})
|
|
|
|
export const zPreProcessingRuleKey = z.enum([
|
|
'remove_extra_spaces',
|
|
'remove_stopwords',
|
|
'remove_urls_emails',
|
|
])
|
|
|
|
/**
|
|
* PreProcessingRule
|
|
*/
|
|
export const zPreProcessingRule = z.object({
|
|
enabled: z.boolean(),
|
|
id: zPreProcessingRuleKey,
|
|
})
|
|
|
|
/**
|
|
* ProcessRuleMode
|
|
*
|
|
* Dataset Process Rule Mode
|
|
*/
|
|
export const zProcessRuleMode = z.enum(['automatic', 'custom', 'hierarchical'])
|
|
|
|
/**
|
|
* ProviderModelWithStatusEntity
|
|
*
|
|
* Model class for model response.
|
|
*/
|
|
export const zProviderModelWithStatusEntity = z.object({
|
|
deprecated: z.boolean().optional().default(false),
|
|
features: z.array(zModelFeature).nullish(),
|
|
fetch_from: zFetchFrom,
|
|
has_invalid_load_balancing_configs: z.boolean().optional().default(false),
|
|
label: zModelRuntimeI18nObject,
|
|
load_balancing_enabled: z.boolean().optional().default(false),
|
|
model: z.string(),
|
|
model_properties: z.record(z.string(), z.unknown()),
|
|
model_type: zModelType,
|
|
status: zModelStatus,
|
|
})
|
|
|
|
/**
|
|
* ProviderNotInitializeError
|
|
*
|
|
* No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.
|
|
*/
|
|
export const zProviderNotInitializeError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('provider_not_initialize'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* ProviderNotSupportSpeechToTextError
|
|
*
|
|
* Provider not support speech to text.
|
|
*/
|
|
export const zProviderNotSupportSpeechToTextError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('provider_not_support_speech_to_text'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* ProviderQuotaExceededError
|
|
*
|
|
* Your quota for Dify Hosted OpenAI has been exhausted. Please go to Settings -> Model Provider to complete your own provider credentials.
|
|
*/
|
|
export const zProviderQuotaExceededError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('provider_quota_exceeded'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* ProviderWithModelsResponse
|
|
*
|
|
* Model class for provider with models response.
|
|
*/
|
|
export const zProviderWithModelsResponse = z.object({
|
|
icon_small: zModelRuntimeI18nObject.nullish(),
|
|
icon_small_dark: zModelRuntimeI18nObject.nullish(),
|
|
label: zModelRuntimeI18nObject,
|
|
models: z.array(zProviderModelWithStatusEntity),
|
|
provider: z.string(),
|
|
status: zCustomConfigurationStatus,
|
|
tenant_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ProviderWithModelsListResponse
|
|
*/
|
|
export const zProviderWithModelsListResponse = z.object({
|
|
data: z.array(zProviderWithModelsResponse),
|
|
})
|
|
|
|
/**
|
|
* PublishedPipelineRunResponse
|
|
*/
|
|
export const zPublishedPipelineRunResponse = z.object({
|
|
batch: z.string(),
|
|
dataset: zPipelineDataset,
|
|
documents: z.array(zPipelineDocument),
|
|
})
|
|
|
|
/**
|
|
* RateLimitError
|
|
*
|
|
* Rate Limit Error
|
|
*/
|
|
export const zRateLimitError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('rate_limit_error'),
|
|
status: z.literal(429),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* RerankingModel
|
|
*/
|
|
export const zRerankingModel = z.object({
|
|
reranking_model_name: z.string().nullish(),
|
|
reranking_provider_name: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* ResultResponse
|
|
*/
|
|
export const zResultResponse = z.object({
|
|
result: z.string(),
|
|
})
|
|
|
|
/**
|
|
* RetrievalMethod
|
|
*/
|
|
export const zRetrievalMethod = z.enum([
|
|
'full_text_search',
|
|
'hybrid_search',
|
|
'keyword_search',
|
|
'semantic_search',
|
|
])
|
|
|
|
/**
|
|
* DatasetRetrievalModelResponse
|
|
*/
|
|
export const zDatasetRetrievalModelResponse = z.object({
|
|
reranking_enable: z.boolean(),
|
|
reranking_mode: z.string().nullish(),
|
|
reranking_model: zDatasetRerankingModelResponse.optional(),
|
|
score_threshold: z.number().nullish(),
|
|
score_threshold_enabled: z.boolean(),
|
|
search_method: zRetrievalMethod,
|
|
top_k: z.int(),
|
|
weights: zDatasetWeightedScoreResponse.nullish(),
|
|
})
|
|
|
|
/**
|
|
* DatasetDetailResponse
|
|
*/
|
|
export const zDatasetDetailResponse = z.object({
|
|
app_count: z.int(),
|
|
author_name: z.string().nullable(),
|
|
built_in_field_enabled: z.boolean(),
|
|
chunk_structure: z.string().nullable(),
|
|
created_at: z.int(),
|
|
created_by: z.string(),
|
|
data_source_type: z
|
|
.enum([
|
|
'local_file',
|
|
'notion_import',
|
|
'online_document',
|
|
'online_drive',
|
|
'upload_file',
|
|
'website_crawl',
|
|
])
|
|
.nullable(),
|
|
description: z.string().nullable(),
|
|
doc_form: z.string().nullable(),
|
|
doc_metadata: z.array(zDatasetDocMetadataResponse),
|
|
document_count: z.int(),
|
|
embedding_available: z.boolean().nullish(),
|
|
embedding_model: z.string().nullable(),
|
|
embedding_model_provider: z.string().nullable(),
|
|
enable_api: z.boolean(),
|
|
external_knowledge_info: zDatasetExternalKnowledgeInfoResponse.optional(),
|
|
external_retrieval_model: zDatasetExternalRetrievalModelResponse.nullable(),
|
|
icon_info: zDatasetIconInfoResponse.optional(),
|
|
id: z.string(),
|
|
indexing_technique: zIndexTechniqueType.nullable(),
|
|
is_multimodal: z.boolean(),
|
|
is_published: z.boolean(),
|
|
maintainer: z.string().nullish(),
|
|
name: z.string(),
|
|
permission: z.enum(['all_team_members', 'only_me', 'partial_members']),
|
|
pipeline_id: z.string().nullable(),
|
|
provider: z.string(),
|
|
retrieval_model_dict: zDatasetRetrievalModelResponse,
|
|
runtime_mode: z.enum(['general', 'rag_pipeline']).nullable(),
|
|
summary_index_setting: zDatasetSummaryIndexSettingResponse.optional(),
|
|
tags: z.array(zDatasetTagResponse),
|
|
total_available_documents: z.int(),
|
|
total_documents: z.int(),
|
|
updated_at: z.int(),
|
|
updated_by: z.string().nullable(),
|
|
word_count: z.int(),
|
|
})
|
|
|
|
/**
|
|
* DatasetDetailWithPartialMembersResponse
|
|
*/
|
|
export const zDatasetDetailWithPartialMembersResponse = z.object({
|
|
app_count: z.int(),
|
|
author_name: z.string().nullable(),
|
|
built_in_field_enabled: z.boolean(),
|
|
chunk_structure: z.string().nullable(),
|
|
created_at: z.int(),
|
|
created_by: z.string(),
|
|
data_source_type: z
|
|
.enum([
|
|
'local_file',
|
|
'notion_import',
|
|
'online_document',
|
|
'online_drive',
|
|
'upload_file',
|
|
'website_crawl',
|
|
])
|
|
.nullable(),
|
|
description: z.string().nullable(),
|
|
doc_form: z.string().nullable(),
|
|
doc_metadata: z.array(zDatasetDocMetadataResponse),
|
|
document_count: z.int(),
|
|
embedding_available: z.boolean().nullish(),
|
|
embedding_model: z.string().nullable(),
|
|
embedding_model_provider: z.string().nullable(),
|
|
enable_api: z.boolean(),
|
|
external_knowledge_info: zDatasetExternalKnowledgeInfoResponse.optional(),
|
|
external_retrieval_model: zDatasetExternalRetrievalModelResponse.nullable(),
|
|
icon_info: zDatasetIconInfoResponse.optional(),
|
|
id: z.string(),
|
|
indexing_technique: zIndexTechniqueType.nullable(),
|
|
is_multimodal: z.boolean(),
|
|
is_published: z.boolean(),
|
|
maintainer: z.string().nullish(),
|
|
name: z.string(),
|
|
partial_member_list: z.array(z.string()).nullish(),
|
|
permission: z.enum(['all_team_members', 'only_me', 'partial_members']),
|
|
pipeline_id: z.string().nullable(),
|
|
provider: z.string(),
|
|
retrieval_model_dict: zDatasetRetrievalModelResponse,
|
|
runtime_mode: z.enum(['general', 'rag_pipeline']).nullable(),
|
|
summary_index_setting: zDatasetSummaryIndexSettingResponse.optional(),
|
|
tags: z.array(zDatasetTagResponse),
|
|
total_available_documents: z.int(),
|
|
total_documents: z.int(),
|
|
updated_at: z.int(),
|
|
updated_by: z.string().nullable(),
|
|
word_count: z.int(),
|
|
})
|
|
|
|
/**
|
|
* DatasetListResponse
|
|
*/
|
|
export const zDatasetListResponse = z.object({
|
|
data: z.array(zDatasetDetailResponse),
|
|
has_more: z.boolean(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* RetrieverResource
|
|
*/
|
|
export const zRetrieverResource = z.object({
|
|
content: z.string().nullish(),
|
|
created_at: z.int().nullish(),
|
|
data_source_type: z.string().nullish(),
|
|
dataset_id: z.uuid().nullish(),
|
|
dataset_name: z.string().nullish(),
|
|
doc_metadata: z.record(z.string(), zJsonValueType).nullish(),
|
|
document_asset_id: z.uuid().nullish(),
|
|
document_id: z.uuid().nullish(),
|
|
document_name: z.string().nullish(),
|
|
document_revision: z.int().nullish(),
|
|
document_version: z.int().nullish(),
|
|
files: z.array(z.record(z.string(), zJsonValueType)).nullish(),
|
|
hit_count: z.int().nullish(),
|
|
id: z.uuid().optional(),
|
|
index_node_hash: z.string().nullish(),
|
|
knowledge_fs_citation: zKnowledgeFsCitation.nullish(),
|
|
message_id: z.uuid().optional(),
|
|
page: z.int().nullish(),
|
|
position: z.int(),
|
|
retriever_from: z.string().nullish(),
|
|
score: z.number().nullish(),
|
|
segment_id: z.uuid().nullish(),
|
|
segment_position: z.int().nullish(),
|
|
summary: z.string().nullish(),
|
|
title: z.string().nullish(),
|
|
word_count: z.int().nullish(),
|
|
})
|
|
|
|
/**
|
|
* ServiceApiUserPayload
|
|
*/
|
|
export const zScopedTaskStopPayload = z.object({
|
|
user: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SegmentAttachmentResponse
|
|
*/
|
|
export const zSegmentAttachmentResponse = z.object({
|
|
extension: z.string(),
|
|
id: z.string(),
|
|
mime_type: z.string().nullable(),
|
|
name: z.string(),
|
|
size: z.int(),
|
|
source_url: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SegmentCreateItemPayload
|
|
*/
|
|
export const zSegmentCreateItemPayload = z.object({
|
|
answer: z.string().nullish(),
|
|
attachment_ids: z.array(z.string()).nullish(),
|
|
content: z.string().min(1),
|
|
keywords: z.array(z.string()).nullish(),
|
|
})
|
|
|
|
/**
|
|
* SegmentCreatePayload
|
|
*/
|
|
export const zSegmentCreatePayload = z.object({
|
|
segments: z.array(zSegmentCreateItemPayload).min(1),
|
|
})
|
|
|
|
/**
|
|
* SegmentListQuery
|
|
*/
|
|
export const zSegmentListQuery = z.object({
|
|
keyword: z.string().nullish(),
|
|
limit: z.int().gte(1).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
status: z.array(z.string()).optional(),
|
|
})
|
|
|
|
/**
|
|
* SegmentResponse
|
|
*/
|
|
export const zSegmentResponse = z.object({
|
|
answer: z.string().nullable(),
|
|
attachments: z.array(zSegmentAttachmentResponse),
|
|
child_chunks: z.array(zChildChunkResponse),
|
|
completed_at: z.int().nullable(),
|
|
content: z.string(),
|
|
created_at: z.int(),
|
|
created_by: z.string(),
|
|
disabled_at: z.int().nullable(),
|
|
disabled_by: z.string().nullable(),
|
|
document_id: z.string(),
|
|
enabled: z.boolean(),
|
|
error: z.string().nullable(),
|
|
hit_count: z.int(),
|
|
id: z.string(),
|
|
index_node_hash: z.string().nullable(),
|
|
index_node_id: z.string().nullable(),
|
|
indexing_at: z.int().nullable(),
|
|
keywords: z.array(z.string()).nullable(),
|
|
position: z.int(),
|
|
sign_content: z.string(),
|
|
status: z.enum(['completed', 'error', 'indexing', 'paused', 're_segment', 'waiting']),
|
|
stopped_at: z.int().nullable(),
|
|
summary: z.string().nullable(),
|
|
tokens: z.int(),
|
|
updated_at: z.int(),
|
|
updated_by: z.string().nullable(),
|
|
word_count: z.int(),
|
|
})
|
|
|
|
/**
|
|
* SegmentCreateListResponse
|
|
*/
|
|
export const zSegmentCreateListResponse = z.object({
|
|
data: z.array(zSegmentResponse),
|
|
doc_form: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SegmentDetailResponse
|
|
*/
|
|
export const zSegmentDetailResponse = z.object({
|
|
data: zSegmentResponse,
|
|
doc_form: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SegmentListResponse
|
|
*/
|
|
export const zSegmentListResponse = z.object({
|
|
data: z.array(zSegmentResponse),
|
|
doc_form: z.string(),
|
|
has_more: z.boolean(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* SegmentUpdateArgs
|
|
*/
|
|
export const zSegmentUpdateArgs = z.object({
|
|
answer: z.string().nullish(),
|
|
attachment_ids: z.array(z.string()).nullish(),
|
|
content: z.string().nullish(),
|
|
enabled: z.boolean().nullish(),
|
|
keywords: z.array(z.string()).nullish(),
|
|
regenerate_child_chunks: z.boolean().optional().default(false),
|
|
summary: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* SegmentUpdatePayload
|
|
*/
|
|
export const zSegmentUpdatePayload = z.object({
|
|
segment: zSegmentUpdateArgs,
|
|
})
|
|
|
|
/**
|
|
* Segmentation
|
|
*/
|
|
export const zSegmentation = z.object({
|
|
chunk_overlap: z.int().gte(0).optional().default(0),
|
|
max_tokens: z.int(),
|
|
separator: z.string().optional().default('\n'),
|
|
})
|
|
|
|
/**
|
|
* Rule
|
|
*/
|
|
export const zRule = z.object({
|
|
parent_mode: z.enum(['full-doc', 'paragraph']).nullish(),
|
|
pre_processing_rules: z.array(zPreProcessingRule).nullish(),
|
|
segmentation: zSegmentation.nullish(),
|
|
subchunk_segmentation: zSegmentation.nullish(),
|
|
})
|
|
|
|
/**
|
|
* ProcessRule
|
|
*/
|
|
export const zProcessRule = z.object({
|
|
mode: zProcessRuleMode,
|
|
rules: zRule.nullish(),
|
|
})
|
|
|
|
/**
|
|
* SimpleAccountResponse
|
|
*/
|
|
export const zSimpleAccountResponse = z.object({
|
|
email: z.string(),
|
|
id: z.string(),
|
|
name: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SimpleConversation
|
|
*/
|
|
export const zSimpleConversation = z.object({
|
|
created_at: z.int().nullish(),
|
|
id: z.uuid(),
|
|
inputs: z.record(z.string(), zAnyJsonValue),
|
|
introduction: z.string().nullish(),
|
|
name: z.string(),
|
|
status: z.string(),
|
|
updated_at: z.int().nullish(),
|
|
})
|
|
|
|
/**
|
|
* ConversationInfiniteScrollPagination
|
|
*/
|
|
export const zConversationInfiniteScrollPagination = z.object({
|
|
data: z.array(zSimpleConversation),
|
|
has_more: z.boolean(),
|
|
limit: z.int(),
|
|
})
|
|
|
|
/**
|
|
* SimpleEndUser
|
|
*/
|
|
export const zSimpleEndUser = z.object({
|
|
id: z.string(),
|
|
is_anonymous: z.boolean(),
|
|
session_id: z.string().nullish(),
|
|
type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SimpleFeedback
|
|
*/
|
|
export const zSimpleFeedback = z.object({
|
|
rating: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* SimpleResultResponse
|
|
*/
|
|
export const zSimpleResultResponse = z.object({
|
|
result: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SimpleResultStringListResponse
|
|
*/
|
|
export const zSimpleResultStringListResponse = z.object({
|
|
data: z.array(z.string()),
|
|
result: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Site
|
|
*/
|
|
export const zSite = z.object({
|
|
chat_color_theme: z.string().nullish(),
|
|
chat_color_theme_inverted: z.boolean(),
|
|
copyright: z.string().nullish(),
|
|
custom_disclaimer: z.string().nullish(),
|
|
default_language: z.string(),
|
|
description: z.string().nullish(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.string().nullish(),
|
|
icon_url: z.string().nullable(),
|
|
input_placeholder: z.string().nullish(),
|
|
privacy_policy: z.string().nullish(),
|
|
show_workflow_steps: z.boolean(),
|
|
title: z.string(),
|
|
use_icon_as_answer_icon: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* SpeechToTextDisabledError
|
|
*
|
|
* Speech to text is disabled.
|
|
*/
|
|
export const zSpeechToTextDisabledError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('speech_to_text_disabled'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* SystemParameters
|
|
*/
|
|
export const zSystemParameters = z.object({
|
|
audio_file_size_limit: z.int(),
|
|
file_size_limit: z.int(),
|
|
image_file_size_limit: z.int(),
|
|
video_file_size_limit: z.int(),
|
|
workflow_file_upload_limit: z.int(),
|
|
})
|
|
|
|
/**
|
|
* Parameters
|
|
*/
|
|
export const zParameters = z.object({
|
|
annotation_reply: z.object({
|
|
enabled: z.boolean().optional(),
|
|
}),
|
|
file_upload: z.object({
|
|
allowed_file_extensions: z.array(z.string()).optional(),
|
|
allowed_file_types: z
|
|
.array(z.enum(['audio', 'custom', 'document', 'image', 'video']))
|
|
.optional(),
|
|
allowed_file_upload_methods: z.array(z.enum(['local_file', 'remote_url'])).optional(),
|
|
enabled: z.boolean().optional(),
|
|
image: z
|
|
.object({
|
|
detail: z.string().optional(),
|
|
enabled: z.boolean().optional(),
|
|
number_limits: z.int().optional(),
|
|
transfer_methods: z.array(z.string()).optional(),
|
|
})
|
|
.optional(),
|
|
number_limits: z.int().optional(),
|
|
}),
|
|
more_like_this: z.object({
|
|
enabled: z.boolean().optional(),
|
|
}),
|
|
opening_statement: z.string().nullish(),
|
|
retriever_resource: z.object({
|
|
enabled: z.boolean().optional(),
|
|
}),
|
|
sensitive_word_avoidance: z.object({
|
|
enabled: z.boolean().optional(),
|
|
}),
|
|
show_thoughts: z
|
|
.object({
|
|
enabled: z.boolean().optional(),
|
|
})
|
|
.optional(),
|
|
speech_to_text: z.object({
|
|
enabled: z.boolean().optional(),
|
|
}),
|
|
suggested_questions: z.array(z.string()),
|
|
suggested_questions_after_answer: z.object({
|
|
enabled: z.boolean().optional(),
|
|
}),
|
|
system_parameters: zSystemParameters,
|
|
text_to_speech: z.object({
|
|
autoPlay: z.string().optional(),
|
|
enabled: z.boolean().optional(),
|
|
language: z.string().optional(),
|
|
voice: z.string().optional(),
|
|
}),
|
|
user_input_form: z.array(
|
|
z.union([
|
|
z
|
|
.object({
|
|
'text-input': z.object({
|
|
allowed_file_extensions: z.array(z.string()).nullish(),
|
|
allowed_file_types: z.array(z.string()).nullish(),
|
|
allowed_file_upload_methods: z.array(z.string()).nullish(),
|
|
config: z.record(z.string(), z.unknown()).optional(),
|
|
default: z.unknown().optional(),
|
|
description: z.string().optional(),
|
|
hide: z.boolean().optional(),
|
|
json_schema: z.record(z.string(), z.unknown()).nullish(),
|
|
label: z.string(),
|
|
max_length: z.int().nullish(),
|
|
options: z.array(z.string()).optional(),
|
|
required: z.boolean().optional(),
|
|
type: z
|
|
.enum([
|
|
'checkbox',
|
|
'external_data_tool',
|
|
'file',
|
|
'file-list',
|
|
'json_object',
|
|
'number',
|
|
'paragraph',
|
|
'select',
|
|
'text-input',
|
|
])
|
|
.optional(),
|
|
variable: z.string(),
|
|
}),
|
|
})
|
|
.strict(),
|
|
z
|
|
.object({
|
|
select: z.object({
|
|
allowed_file_extensions: z.array(z.string()).nullish(),
|
|
allowed_file_types: z.array(z.string()).nullish(),
|
|
allowed_file_upload_methods: z.array(z.string()).nullish(),
|
|
config: z.record(z.string(), z.unknown()).optional(),
|
|
default: z.unknown().optional(),
|
|
description: z.string().optional(),
|
|
hide: z.boolean().optional(),
|
|
json_schema: z.record(z.string(), z.unknown()).nullish(),
|
|
label: z.string(),
|
|
max_length: z.int().nullish(),
|
|
options: z.array(z.string()).optional(),
|
|
required: z.boolean().optional(),
|
|
type: z
|
|
.enum([
|
|
'checkbox',
|
|
'external_data_tool',
|
|
'file',
|
|
'file-list',
|
|
'json_object',
|
|
'number',
|
|
'paragraph',
|
|
'select',
|
|
'text-input',
|
|
])
|
|
.optional(),
|
|
variable: z.string(),
|
|
}),
|
|
})
|
|
.strict(),
|
|
z
|
|
.object({
|
|
paragraph: z.object({
|
|
allowed_file_extensions: z.array(z.string()).nullish(),
|
|
allowed_file_types: z.array(z.string()).nullish(),
|
|
allowed_file_upload_methods: z.array(z.string()).nullish(),
|
|
config: z.record(z.string(), z.unknown()).optional(),
|
|
default: z.unknown().optional(),
|
|
description: z.string().optional(),
|
|
hide: z.boolean().optional(),
|
|
json_schema: z.record(z.string(), z.unknown()).nullish(),
|
|
label: z.string(),
|
|
max_length: z.int().nullish(),
|
|
options: z.array(z.string()).optional(),
|
|
required: z.boolean().optional(),
|
|
type: z
|
|
.enum([
|
|
'checkbox',
|
|
'external_data_tool',
|
|
'file',
|
|
'file-list',
|
|
'json_object',
|
|
'number',
|
|
'paragraph',
|
|
'select',
|
|
'text-input',
|
|
])
|
|
.optional(),
|
|
variable: z.string(),
|
|
}),
|
|
})
|
|
.strict(),
|
|
z
|
|
.object({
|
|
number: z.object({
|
|
allowed_file_extensions: z.array(z.string()).nullish(),
|
|
allowed_file_types: z.array(z.string()).nullish(),
|
|
allowed_file_upload_methods: z.array(z.string()).nullish(),
|
|
config: z.record(z.string(), z.unknown()).optional(),
|
|
default: z.unknown().optional(),
|
|
description: z.string().optional(),
|
|
hide: z.boolean().optional(),
|
|
json_schema: z.record(z.string(), z.unknown()).nullish(),
|
|
label: z.string(),
|
|
max_length: z.int().nullish(),
|
|
options: z.array(z.string()).optional(),
|
|
required: z.boolean().optional(),
|
|
type: z
|
|
.enum([
|
|
'checkbox',
|
|
'external_data_tool',
|
|
'file',
|
|
'file-list',
|
|
'json_object',
|
|
'number',
|
|
'paragraph',
|
|
'select',
|
|
'text-input',
|
|
])
|
|
.optional(),
|
|
variable: z.string(),
|
|
}),
|
|
})
|
|
.strict(),
|
|
z
|
|
.object({
|
|
external_data_tool: z.object({
|
|
allowed_file_extensions: z.array(z.string()).nullish(),
|
|
allowed_file_types: z.array(z.string()).nullish(),
|
|
allowed_file_upload_methods: z.array(z.string()).nullish(),
|
|
config: z.record(z.string(), z.unknown()).optional(),
|
|
default: z.unknown().optional(),
|
|
description: z.string().optional(),
|
|
hide: z.boolean().optional(),
|
|
json_schema: z.record(z.string(), z.unknown()).nullish(),
|
|
label: z.string(),
|
|
max_length: z.int().nullish(),
|
|
options: z.array(z.string()).optional(),
|
|
required: z.boolean().optional(),
|
|
type: z
|
|
.enum([
|
|
'checkbox',
|
|
'external_data_tool',
|
|
'file',
|
|
'file-list',
|
|
'json_object',
|
|
'number',
|
|
'paragraph',
|
|
'select',
|
|
'text-input',
|
|
])
|
|
.optional(),
|
|
variable: z.string(),
|
|
}),
|
|
})
|
|
.strict(),
|
|
z
|
|
.object({
|
|
file: z.object({
|
|
allowed_file_extensions: z.array(z.string()).nullish(),
|
|
allowed_file_types: z.array(z.string()).nullish(),
|
|
allowed_file_upload_methods: z.array(z.string()).nullish(),
|
|
config: z.record(z.string(), z.unknown()).optional(),
|
|
default: z.unknown().optional(),
|
|
description: z.string().optional(),
|
|
hide: z.boolean().optional(),
|
|
json_schema: z.record(z.string(), z.unknown()).nullish(),
|
|
label: z.string(),
|
|
max_length: z.int().nullish(),
|
|
options: z.array(z.string()).optional(),
|
|
required: z.boolean().optional(),
|
|
type: z
|
|
.enum([
|
|
'checkbox',
|
|
'external_data_tool',
|
|
'file',
|
|
'file-list',
|
|
'json_object',
|
|
'number',
|
|
'paragraph',
|
|
'select',
|
|
'text-input',
|
|
])
|
|
.optional(),
|
|
variable: z.string(),
|
|
}),
|
|
})
|
|
.strict(),
|
|
z
|
|
.object({
|
|
'file-list': z.object({
|
|
allowed_file_extensions: z.array(z.string()).nullish(),
|
|
allowed_file_types: z.array(z.string()).nullish(),
|
|
allowed_file_upload_methods: z.array(z.string()).nullish(),
|
|
config: z.record(z.string(), z.unknown()).optional(),
|
|
default: z.unknown().optional(),
|
|
description: z.string().optional(),
|
|
hide: z.boolean().optional(),
|
|
json_schema: z.record(z.string(), z.unknown()).nullish(),
|
|
label: z.string(),
|
|
max_length: z.int().nullish(),
|
|
options: z.array(z.string()).optional(),
|
|
required: z.boolean().optional(),
|
|
type: z
|
|
.enum([
|
|
'checkbox',
|
|
'external_data_tool',
|
|
'file',
|
|
'file-list',
|
|
'json_object',
|
|
'number',
|
|
'paragraph',
|
|
'select',
|
|
'text-input',
|
|
])
|
|
.optional(),
|
|
variable: z.string(),
|
|
}),
|
|
})
|
|
.strict(),
|
|
z
|
|
.object({
|
|
checkbox: z.object({
|
|
allowed_file_extensions: z.array(z.string()).nullish(),
|
|
allowed_file_types: z.array(z.string()).nullish(),
|
|
allowed_file_upload_methods: z.array(z.string()).nullish(),
|
|
config: z.record(z.string(), z.unknown()).optional(),
|
|
default: z.unknown().optional(),
|
|
description: z.string().optional(),
|
|
hide: z.boolean().optional(),
|
|
json_schema: z.record(z.string(), z.unknown()).nullish(),
|
|
label: z.string(),
|
|
max_length: z.int().nullish(),
|
|
options: z.array(z.string()).optional(),
|
|
required: z.boolean().optional(),
|
|
type: z
|
|
.enum([
|
|
'checkbox',
|
|
'external_data_tool',
|
|
'file',
|
|
'file-list',
|
|
'json_object',
|
|
'number',
|
|
'paragraph',
|
|
'select',
|
|
'text-input',
|
|
])
|
|
.optional(),
|
|
variable: z.string(),
|
|
}),
|
|
})
|
|
.strict(),
|
|
z
|
|
.object({
|
|
json_object: z.object({
|
|
allowed_file_extensions: z.array(z.string()).nullish(),
|
|
allowed_file_types: z.array(z.string()).nullish(),
|
|
allowed_file_upload_methods: z.array(z.string()).nullish(),
|
|
config: z.record(z.string(), z.unknown()).optional(),
|
|
default: z.unknown().optional(),
|
|
description: z.string().optional(),
|
|
hide: z.boolean().optional(),
|
|
json_schema: z.record(z.string(), z.unknown()).nullish(),
|
|
label: z.string(),
|
|
max_length: z.int().nullish(),
|
|
options: z.array(z.string()).optional(),
|
|
required: z.boolean().optional(),
|
|
type: z
|
|
.enum([
|
|
'checkbox',
|
|
'external_data_tool',
|
|
'file',
|
|
'file-list',
|
|
'json_object',
|
|
'number',
|
|
'paragraph',
|
|
'select',
|
|
'text-input',
|
|
])
|
|
.optional(),
|
|
variable: z.string(),
|
|
}),
|
|
})
|
|
.strict(),
|
|
]),
|
|
),
|
|
})
|
|
|
|
/**
|
|
* TagBindingPayload
|
|
*/
|
|
export const zTagBindingPayload = z.object({
|
|
tag_ids: z.array(z.string()).min(1),
|
|
target_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* TagCreatePayload
|
|
*/
|
|
export const zTagCreatePayload = z.object({
|
|
name: z.string().min(1).max(50),
|
|
})
|
|
|
|
/**
|
|
* TagDeletePayload
|
|
*/
|
|
export const zTagDeletePayload = z.object({
|
|
tag_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* TagUnbindingPayload
|
|
*
|
|
* Accepts either the legacy tag_id payload or the normalized tag_ids payload.
|
|
*/
|
|
export const zTagUnbindingPayload = z.union([
|
|
z.object({
|
|
tag_id: z.string(),
|
|
tag_ids: z.array(z.string()).min(1).optional(),
|
|
target_id: z.string(),
|
|
}),
|
|
z.object({
|
|
tag_id: z.string().nullish(),
|
|
tag_ids: z.array(z.string()).min(1),
|
|
target_id: z.string(),
|
|
}),
|
|
])
|
|
|
|
/**
|
|
* TagUpdatePayload
|
|
*/
|
|
export const zTagUpdatePayload = z.object({
|
|
name: z.string().min(1).max(50),
|
|
tag_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* TextToAudioPayload
|
|
*/
|
|
export const zTextToAudioPayload = z.object({
|
|
message_id: z.uuid().nullish(),
|
|
streaming: z.boolean().nullish(),
|
|
text: z.string().nullish(),
|
|
voice: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* TextToAudioPayload
|
|
*/
|
|
export const zTextToAudioPayloadWithUser = z.object({
|
|
message_id: z.uuid().nullish(),
|
|
streaming: z.boolean().nullish(),
|
|
text: z.string().nullish(),
|
|
user: z.string().optional(),
|
|
voice: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* TooManyFilesError
|
|
*
|
|
* Only one file is allowed.
|
|
*/
|
|
export const zTooManyFilesError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('too_many_files'),
|
|
status: z.literal(400),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* ToolIcon
|
|
*/
|
|
export const zToolIcon = z.object({
|
|
background: z.string(),
|
|
content: z.string(),
|
|
})
|
|
|
|
/**
|
|
* AppMetaResponse
|
|
*/
|
|
export const zAppMetaResponse = z.object({
|
|
tool_icons: z.record(z.string(), z.union([z.string(), zToolIcon])).optional(),
|
|
})
|
|
|
|
/**
|
|
* TriggerWorkflowServiceModeUnavailableError
|
|
*
|
|
* This workflow uses a trigger entry and cannot be invoked through Web App, Service API, OpenAPI, or MCP.
|
|
*/
|
|
export const zTriggerWorkflowServiceModeUnavailableError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('trigger_workflow_service_mode_unavailable'),
|
|
status: z.literal(403),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* UnsupportedAudioTypeError
|
|
*
|
|
* Audio type not allowed.
|
|
*/
|
|
export const zUnsupportedAudioTypeError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('unsupported_audio_type'),
|
|
status: z.literal(415),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* UnsupportedFileTypeError
|
|
*
|
|
* File type not allowed.
|
|
*/
|
|
export const zUnsupportedFileTypeError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('unsupported_file_type'),
|
|
status: z.literal(415),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* UrlResponse
|
|
*/
|
|
export const zUrlResponse = z.object({
|
|
url: z.string(),
|
|
})
|
|
|
|
/**
|
|
* UserActionConfig
|
|
*
|
|
* User action configuration.
|
|
*/
|
|
export const zUserActionConfig = z.object({
|
|
button_style: zButtonStyle.optional().default('default'),
|
|
id: z
|
|
.string()
|
|
.max(20)
|
|
.regex(/^[A-Za-z_][A-Za-z0-9_]*$/),
|
|
title: z.string().max(100),
|
|
})
|
|
|
|
/**
|
|
* ValueSourceType
|
|
*
|
|
* ValueSourceType records whether the value comes from a static setting
|
|
* in form definition, or a variable while the workflow is running.
|
|
*/
|
|
export const zValueSourceType = z.enum(['constant', 'variable'])
|
|
|
|
/**
|
|
* StringListSource
|
|
*/
|
|
export const zStringListSource = z.object({
|
|
selector: z.array(z.string()).optional(),
|
|
type: zValueSourceType,
|
|
value: z.array(z.string()).optional(),
|
|
})
|
|
|
|
/**
|
|
* SelectInputConfig
|
|
*/
|
|
export const zSelectInputConfig = z.object({
|
|
option_source: zStringListSource,
|
|
output_variable_name: z.string(),
|
|
type: z.literal('select').optional().default('select'),
|
|
})
|
|
|
|
/**
|
|
* StringSource
|
|
*
|
|
* Default configuration for form inputs.
|
|
*/
|
|
export const zStringSource = z.object({
|
|
selector: z.array(z.string()).optional(),
|
|
type: zValueSourceType,
|
|
value: z.string().optional().default(''),
|
|
})
|
|
|
|
/**
|
|
* ParagraphInputConfig
|
|
*
|
|
* Form input definition.
|
|
*/
|
|
export const zParagraphInputConfig = z.object({
|
|
default: zStringSource.nullish(),
|
|
output_variable_name: z.string(),
|
|
type: z.literal('paragraph').optional().default('paragraph'),
|
|
})
|
|
|
|
export const zFormInputConfig = z.discriminatedUnion('type', [
|
|
zParagraphInputConfig,
|
|
zSelectInputConfig,
|
|
zFileInputConfig,
|
|
zFileListInputConfig,
|
|
])
|
|
|
|
/**
|
|
* HumanInputFormDefinition
|
|
*/
|
|
export const zHumanInputFormDefinition = z.object({
|
|
actions: z.array(zUserActionConfig).optional(),
|
|
display_in_ui: z.boolean().optional().default(false),
|
|
expiration_time: z.int(),
|
|
form_content: z.string(),
|
|
form_id: z.string(),
|
|
form_token: z.string().nullish(),
|
|
form_version: z.enum(['1', '2']).optional().default('1'),
|
|
inputs: z.array(zFormInputConfig).optional(),
|
|
node_id: z.string(),
|
|
node_title: z.string(),
|
|
resolved_default_values: z.record(z.string(), z.unknown()).optional(),
|
|
})
|
|
|
|
/**
|
|
* HumanInputContent
|
|
*/
|
|
export const zHumanInputContent = z.object({
|
|
form_definition: zHumanInputFormDefinition.nullish(),
|
|
form_submission_data: zHumanInputFormSubmissionData.nullish(),
|
|
submitted: z.boolean(),
|
|
type: zExecutionContentType.optional().default('human_input'),
|
|
workflow_run_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* HumanInputFormDefinitionResponse
|
|
*/
|
|
export const zHumanInputFormDefinitionResponse = z.object({
|
|
expiration_time: z.int().nullish(),
|
|
form_content: z.string(),
|
|
inputs: z.array(zFormInputConfig),
|
|
resolved_default_values: z.record(z.string(), z.string()),
|
|
user_actions: z.array(zUserActionConfig),
|
|
})
|
|
|
|
/**
|
|
* MessageListItem
|
|
*/
|
|
export const zMessageListItem = z.object({
|
|
agent_thoughts: z.array(zAgentThought),
|
|
answer: z.string(),
|
|
answer_tokens: z.int().optional().default(0),
|
|
conversation_id: z.uuid(),
|
|
created_at: z.int().nullish(),
|
|
currency: z.string().nullish(),
|
|
error: z.string().nullish(),
|
|
extra_contents: z.array(zHumanInputContent),
|
|
feedback: zSimpleFeedback.nullish(),
|
|
id: z.uuid(),
|
|
inputs: z.record(z.string(), zJsonValueType),
|
|
message_files: z.array(zMessageFile),
|
|
message_tokens: z.int().optional().default(0),
|
|
parent_message_id: z.uuid().nullish(),
|
|
provider_response_latency: z.number().optional().default(0),
|
|
query: z.string(),
|
|
retriever_resources: z.array(zRetrieverResource),
|
|
status: z.string(),
|
|
total_price: z
|
|
.string()
|
|
.regex(/^(?![-+.]*$)[+-]?0*\d*\.?\d*$/)
|
|
.nullish(),
|
|
total_tokens: z.int().readonly(),
|
|
})
|
|
|
|
/**
|
|
* MessageInfiniteScrollPagination
|
|
*/
|
|
export const zMessageInfiniteScrollPagination = z.object({
|
|
data: z.array(zMessageListItem),
|
|
has_more: z.boolean(),
|
|
limit: z.int(),
|
|
})
|
|
|
|
/**
|
|
* WeightKeywordSetting
|
|
*/
|
|
export const zWeightKeywordSetting = z.object({
|
|
keyword_weight: z.number(),
|
|
})
|
|
|
|
/**
|
|
* WeightVectorSetting
|
|
*/
|
|
export const zWeightVectorSetting = z.object({
|
|
embedding_model_name: z.string(),
|
|
embedding_provider_name: z.string(),
|
|
vector_weight: z.number(),
|
|
})
|
|
|
|
/**
|
|
* WeightModel
|
|
*/
|
|
export const zWeightModel = z.object({
|
|
keyword_setting: zWeightKeywordSetting.nullish(),
|
|
vector_setting: zWeightVectorSetting.nullish(),
|
|
weight_type: z.enum(['customized', 'keyword_first', 'semantic_first']).nullish(),
|
|
})
|
|
|
|
/**
|
|
* RetrievalModel
|
|
*/
|
|
export const zRetrievalModel = z.object({
|
|
metadata_filtering_conditions: zMetadataFilteringCondition.nullish(),
|
|
reranking_enable: z.boolean(),
|
|
reranking_mode: z.enum(['reranking_model', 'weighted_score']).nullish(),
|
|
reranking_model: zRerankingModel.nullish(),
|
|
score_threshold: z.number().nullish(),
|
|
score_threshold_enabled: z.boolean(),
|
|
search_method: zRetrievalMethod,
|
|
top_k: z.int(),
|
|
weights: zWeightModel.nullish(),
|
|
})
|
|
|
|
/**
|
|
* DatasetCreatePayload
|
|
*/
|
|
export const zDatasetCreatePayload = z.object({
|
|
description: z.string().max(400).optional().default(''),
|
|
embedding_model: z.string().nullish(),
|
|
embedding_model_provider: z.string().nullish(),
|
|
external_knowledge_api_id: z.string().nullish(),
|
|
external_knowledge_id: z.string().nullish(),
|
|
indexing_technique: z.enum(['economy', 'high_quality']).nullish(),
|
|
name: z.string().min(1).max(40),
|
|
permission: zPermissionEnum.nullish().default('only_me'),
|
|
provider: z.enum(['external', 'vendor']).optional().default('vendor'),
|
|
retrieval_model: zRetrievalModel.nullish(),
|
|
summary_index_setting: z
|
|
.object({
|
|
enable: z.boolean().optional(),
|
|
model_name: z.string().optional(),
|
|
model_provider_name: z.string().optional(),
|
|
summary_prompt: z.string().optional(),
|
|
})
|
|
.nullish(),
|
|
})
|
|
|
|
/**
|
|
* DatasetUpdatePayload
|
|
*/
|
|
export const zDatasetUpdatePayload = z.object({
|
|
description: z.string().max(400).nullish(),
|
|
embedding_model: z.string().nullish(),
|
|
embedding_model_provider: z.string().nullish(),
|
|
external_knowledge_api_id: z.string().nullish(),
|
|
external_knowledge_id: z.string().nullish(),
|
|
external_retrieval_model: z
|
|
.object({
|
|
score_threshold: z.number().optional(),
|
|
score_threshold_enabled: z.boolean().optional(),
|
|
top_k: z.int().optional(),
|
|
})
|
|
.nullish(),
|
|
indexing_technique: z.enum(['economy', 'high_quality']).nullish(),
|
|
name: z.string().min(1).max(40).nullish(),
|
|
partial_member_list: z
|
|
.array(
|
|
z.object({
|
|
user_id: z.string().optional(),
|
|
}),
|
|
)
|
|
.nullish(),
|
|
permission: zPermissionEnum.nullish(),
|
|
retrieval_model: zRetrievalModel.nullish(),
|
|
})
|
|
|
|
/**
|
|
* DocumentTextCreatePayload
|
|
*/
|
|
export const zDocumentTextCreatePayload = z.object({
|
|
doc_form: z
|
|
.enum(['hierarchical_model', 'qa_model', 'text_model'])
|
|
.optional()
|
|
.default('text_model'),
|
|
doc_language: z.string().optional().default('English'),
|
|
embedding_model: z.string().nullish(),
|
|
embedding_model_provider: z.string().nullish(),
|
|
indexing_technique: z.enum(['economy', 'high_quality']).nullish(),
|
|
name: z.string(),
|
|
original_document_id: z.string().nullish(),
|
|
process_rule: zProcessRule.nullish(),
|
|
retrieval_model: zRetrievalModel.nullish(),
|
|
text: z.string(),
|
|
})
|
|
|
|
export const zDocumentTextUpdate = z.intersection(
|
|
z.union([
|
|
z.object({
|
|
doc_form: z
|
|
.enum(['hierarchical_model', 'qa_model', 'text_model'])
|
|
.optional()
|
|
.default('text_model'),
|
|
doc_language: z.string().optional().default('English'),
|
|
name: z.string(),
|
|
process_rule: zProcessRule.nullish(),
|
|
retrieval_model: zRetrievalModel.nullish(),
|
|
text: z.string(),
|
|
}),
|
|
z.object({
|
|
doc_form: z
|
|
.enum(['hierarchical_model', 'qa_model', 'text_model'])
|
|
.optional()
|
|
.default('text_model'),
|
|
doc_language: z.string().optional().default('English'),
|
|
name: z.string().nullish(),
|
|
process_rule: zProcessRule.nullish(),
|
|
retrieval_model: zRetrievalModel.nullish(),
|
|
text: z.null().optional(),
|
|
}),
|
|
]),
|
|
z.object({
|
|
doc_form: z
|
|
.enum(['hierarchical_model', 'qa_model', 'text_model'])
|
|
.optional()
|
|
.default('text_model'),
|
|
doc_language: z.string().optional().default('English'),
|
|
name: z.string().nullish(),
|
|
process_rule: zProcessRule.nullish(),
|
|
retrieval_model: zRetrievalModel.nullish(),
|
|
text: z.string().nullish(),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* HitTestingPayload
|
|
*/
|
|
export const zHitTestingPayload = z.object({
|
|
attachment_ids: z.array(z.string()).nullish(),
|
|
external_retrieval_model: z
|
|
.object({
|
|
score_threshold: z.number().optional(),
|
|
score_threshold_enabled: z.boolean().optional(),
|
|
top_k: z.int().optional(),
|
|
})
|
|
.nullish(),
|
|
query: z.string().max(250),
|
|
retrieval_model: zRetrievalModel.nullish(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowEventsQuery
|
|
*/
|
|
export const zWorkflowEventsQuery = z.object({
|
|
continue_on_pause: z.boolean().optional().default(false),
|
|
include_state_snapshot: z.boolean().optional().default(false),
|
|
user: z.string(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowFinishedBlockingDataResponse
|
|
*/
|
|
export const zWorkflowFinishedBlockingDataResponse = z.object({
|
|
created_at: z.int(),
|
|
elapsed_time: z.number(),
|
|
error: z.string().nullable(),
|
|
finished_at: z.int().nullable(),
|
|
id: z.uuid(),
|
|
outputs: z.record(z.string(), z.unknown()).nullable(),
|
|
status: z.enum(['failed', 'partial-succeeded', 'stopped', 'succeeded']),
|
|
total_steps: z.int(),
|
|
total_tokens: z.int(),
|
|
workflow_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowFinishedBlockingResponse
|
|
*/
|
|
export const zWorkflowFinishedBlockingResponse = z.object({
|
|
data: zWorkflowFinishedBlockingDataResponse,
|
|
task_id: z.uuid(),
|
|
workflow_run_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowLogQuery
|
|
*/
|
|
export const zWorkflowLogQuery = z.object({
|
|
created_at__after: z.string().nullish(),
|
|
created_at__before: z.string().nullish(),
|
|
created_by_account: z.string().nullish(),
|
|
created_by_end_user_session_id: z.string().nullish(),
|
|
keyword: z.string().nullish(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
page: z.int().gte(1).lte(99999).optional().default(1),
|
|
status: z.enum(['failed', 'stopped', 'succeeded']).nullish(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowPauseReasonResponse
|
|
*
|
|
* Public pause reason emitted by a blocking Workflow execution.
|
|
*/
|
|
export const zWorkflowPauseReasonResponse = z.object({
|
|
TYPE: z.string(),
|
|
actions: z.array(zJsonObject).optional(),
|
|
approval_channels: z.array(z.string()).optional(),
|
|
display_in_ui: z.boolean().nullish(),
|
|
expiration_time: z.int().nullish(),
|
|
form_content: z.string().nullish(),
|
|
form_id: z.uuid().nullish(),
|
|
form_token: z.string().nullish(),
|
|
inputs: z.array(zJsonObject).optional(),
|
|
message: z.string().nullish(),
|
|
node_id: z.string().nullish(),
|
|
node_title: z.string().nullish(),
|
|
resolved_default_values: z.record(z.string(), z.unknown()).optional(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowPausedBlockingDataResponse
|
|
*/
|
|
export const zWorkflowPausedBlockingDataResponse = z.object({
|
|
created_at: z.int(),
|
|
elapsed_time: z.number(),
|
|
error: z.string().nullable(),
|
|
finished_at: z.int().nullable(),
|
|
id: z.uuid(),
|
|
outputs: z.record(z.string(), z.unknown()).nullable(),
|
|
paused_nodes: z.array(z.string()),
|
|
reasons: z.array(zWorkflowPauseReasonResponse),
|
|
status: z.literal('paused'),
|
|
total_steps: z.int(),
|
|
total_tokens: z.int(),
|
|
workflow_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowPausedBlockingResponse
|
|
*/
|
|
export const zWorkflowPausedBlockingResponse = z.object({
|
|
data: zWorkflowPausedBlockingDataResponse,
|
|
task_id: z.uuid(),
|
|
workflow_run_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowBlockingResponse
|
|
*
|
|
* Blocking workflow response for a finished or paused execution.
|
|
*/
|
|
export const zWorkflowBlockingResponse = z.union([
|
|
zWorkflowFinishedBlockingResponse,
|
|
zWorkflowPausedBlockingResponse,
|
|
])
|
|
|
|
/**
|
|
* PipelineRunJsonResponse
|
|
*
|
|
* JSON result for published runs and draft runs using `response_mode: blocking`.
|
|
*/
|
|
export const zPipelineRunJsonResponse = z.union([
|
|
zPublishedPipelineRunResponse,
|
|
zWorkflowBlockingResponse,
|
|
])
|
|
|
|
/**
|
|
* WorkflowRunForLogResponse
|
|
*/
|
|
export const zWorkflowRunForLogResponse = z.object({
|
|
created_at: z.int().nullish(),
|
|
elapsed_time: z.union([z.number(), z.int()]).nullish(),
|
|
error: z.string().nullish(),
|
|
exceptions_count: z.int().nullish(),
|
|
finished_at: z.int().nullish(),
|
|
id: z.uuid(),
|
|
status: z.string().nullish(),
|
|
total_steps: z.int().nullish(),
|
|
total_tokens: z.int().nullish(),
|
|
triggered_from: z.string().nullish(),
|
|
version: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowAppLogPartialResponse
|
|
*/
|
|
export const zWorkflowAppLogPartialResponse = z.object({
|
|
created_at: z.int().nullish(),
|
|
created_by_account: zSimpleAccountResponse.nullish(),
|
|
created_by_end_user: zSimpleEndUser.nullish(),
|
|
created_by_role: z.string().nullish(),
|
|
created_from: z.string().nullish(),
|
|
details: z
|
|
.union([
|
|
z.record(z.string(), z.unknown()),
|
|
z.array(z.unknown()),
|
|
z.string(),
|
|
z.int(),
|
|
z.number(),
|
|
z.boolean(),
|
|
])
|
|
.nullish(),
|
|
id: z.uuid(),
|
|
workflow_run: zWorkflowRunForLogResponse.nullish(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowAppLogPaginationResponse
|
|
*/
|
|
export const zWorkflowAppLogPaginationResponse = z.object({
|
|
data: z.array(zWorkflowAppLogPartialResponse),
|
|
has_more: z.boolean(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowRunPayload
|
|
*/
|
|
export const zWorkflowRunPayload = z.object({
|
|
files: z
|
|
.array(
|
|
z.union([
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string().optional(),
|
|
url: z.string(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string().optional(),
|
|
url: z.string().optional(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string(),
|
|
url: z.string().optional(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['local_file']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string(),
|
|
url: z.string().optional(),
|
|
}),
|
|
]),
|
|
)
|
|
.nullish(),
|
|
inputs: z.record(z.string(), z.unknown()),
|
|
response_mode: z.enum(['blocking', 'streaming']).nullish(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowRunPayload
|
|
*/
|
|
export const zWorkflowRunPayloadWithUser = z.object({
|
|
files: z
|
|
.array(
|
|
z.union([
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string().optional(),
|
|
url: z.string(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string().optional(),
|
|
url: z.string().optional(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['remote_url']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string(),
|
|
url: z.string().optional(),
|
|
}),
|
|
z.object({
|
|
remote_url: z.string().optional(),
|
|
transfer_method: z.enum(['local_file']),
|
|
type: z.enum(['audio', 'custom', 'document', 'image', 'video']),
|
|
upload_file_id: z.string(),
|
|
url: z.string().optional(),
|
|
}),
|
|
]),
|
|
)
|
|
.nullish(),
|
|
inputs: z.record(z.string(), z.unknown()),
|
|
response_mode: z.enum(['blocking', 'streaming']).nullish(),
|
|
user: z.string(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowRunResponse
|
|
*/
|
|
export const zWorkflowRunResponse = z.object({
|
|
created_at: z.int().nullish(),
|
|
elapsed_time: z.union([z.number(), z.int()]).nullish(),
|
|
error: z.string().nullish(),
|
|
finished_at: z.int().nullish(),
|
|
id: z.uuid(),
|
|
inputs: z
|
|
.union([
|
|
z.record(z.string(), z.unknown()),
|
|
z.array(z.unknown()),
|
|
z.string(),
|
|
z.int(),
|
|
z.number(),
|
|
z.boolean(),
|
|
])
|
|
.nullish(),
|
|
outputs: z.record(z.string(), z.unknown()).optional(),
|
|
status: z.string(),
|
|
total_steps: z.int().nullish(),
|
|
total_tokens: z.int().nullish(),
|
|
workflow_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* ServiceApiUserPayload
|
|
*/
|
|
export const zWorkflowTaskStopPayload = z.object({
|
|
user: z.string(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowVersionExecutionNotAllowedError
|
|
*
|
|
* Workflow version execution is not available on your current plan. Please upgrade to a paid plan.
|
|
*/
|
|
export const zWorkflowVersionExecutionNotAllowedError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('workflow_version_execution_not_allowed'),
|
|
status: z.literal(403),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* WorkspaceArchivedError
|
|
*
|
|
* The workspace's status is archived.
|
|
*/
|
|
export const zWorkspaceArchivedError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('workspace_archived'),
|
|
status: z.literal(403),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* WorkspaceNotFoundError
|
|
*
|
|
* Tenant does not exist.
|
|
*/
|
|
export const zWorkspaceNotFoundError = zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('workspace_not_found'),
|
|
status: z.literal(403),
|
|
}),
|
|
)
|
|
|
|
/**
|
|
* HumanInputFormSubmitResponse
|
|
*/
|
|
export const zHumanInputFormSubmitResponseWritable = z.record(z.string(), z.never())
|
|
|
|
/**
|
|
* MessageListItem
|
|
*/
|
|
export const zMessageListItemWritable = z.object({
|
|
agent_thoughts: z.array(zAgentThought),
|
|
answer: z.string(),
|
|
answer_tokens: z.int().optional().default(0),
|
|
conversation_id: z.uuid(),
|
|
created_at: z.int().nullish(),
|
|
currency: z.string().nullish(),
|
|
error: z.string().nullish(),
|
|
extra_contents: z.array(zHumanInputContent),
|
|
feedback: zSimpleFeedback.nullish(),
|
|
id: z.uuid(),
|
|
inputs: z.record(z.string(), zJsonValueType),
|
|
message_files: z.array(zMessageFile),
|
|
message_tokens: z.int().optional().default(0),
|
|
parent_message_id: z.uuid().nullish(),
|
|
provider_response_latency: z.number().optional().default(0),
|
|
query: z.string(),
|
|
retriever_resources: z.array(zRetrieverResource),
|
|
status: z.string(),
|
|
total_price: z
|
|
.string()
|
|
.regex(/^(?![-+.]*$)[+-]?0*\d*\.?\d*$/)
|
|
.nullish(),
|
|
})
|
|
|
|
/**
|
|
* MessageInfiniteScrollPagination
|
|
*/
|
|
export const zMessageInfiniteScrollPaginationWritable = z.object({
|
|
data: z.array(zMessageListItemWritable),
|
|
has_more: z.boolean(),
|
|
limit: z.int(),
|
|
})
|
|
|
|
/**
|
|
* Site
|
|
*/
|
|
export const zSiteWritable = z.object({
|
|
chat_color_theme: z.string().nullish(),
|
|
chat_color_theme_inverted: z.boolean(),
|
|
copyright: z.string().nullish(),
|
|
custom_disclaimer: z.string().nullish(),
|
|
default_language: z.string(),
|
|
description: z.string().nullish(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.string().nullish(),
|
|
input_placeholder: z.string().nullish(),
|
|
privacy_policy: z.string().nullish(),
|
|
show_workflow_steps: z.boolean(),
|
|
title: z.string(),
|
|
use_icon_as_answer_icon: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zGetRootResponse = zIndexInfoResponse
|
|
|
|
export const zGetAppFeedbacksQuery = z.object({
|
|
limit: z.int().gte(1).lte(101).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* A list of application feedbacks.
|
|
*/
|
|
export const zGetAppFeedbacksResponse = zAppFeedbackListResponse
|
|
|
|
export const zPostAppsAnnotationReplyByActionBody = zAnnotationReplyActionPayload
|
|
|
|
export const zPostAppsAnnotationReplyByActionPath = z.object({
|
|
action: z.enum(['disable', 'enable']),
|
|
})
|
|
|
|
/**
|
|
* Annotation reply settings task initiated.
|
|
*/
|
|
export const zPostAppsAnnotationReplyByActionResponse = zAnnotationJobStatusResponse
|
|
|
|
export const zGetAppsAnnotationReplyByActionStatusByJobIdPath = z.object({
|
|
action: z.enum(['disable', 'enable']),
|
|
job_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Successfully retrieved task status.
|
|
*/
|
|
export const zGetAppsAnnotationReplyByActionStatusByJobIdResponse =
|
|
zAnnotationJobStatusDetailResponse
|
|
|
|
export const zGetAppsAnnotationsQuery = z.object({
|
|
keyword: z.string().optional().default(''),
|
|
limit: z.int().gte(1).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* Successfully retrieved annotation list.
|
|
*/
|
|
export const zGetAppsAnnotationsResponse = zAnnotationList
|
|
|
|
export const zPostAppsAnnotationsBody = zAnnotationCreatePayload
|
|
|
|
/**
|
|
* Annotation created successfully.
|
|
*/
|
|
export const zPostAppsAnnotationsResponse = zAnnotation
|
|
|
|
export const zDeleteAppsAnnotationsByAnnotationIdPath = z.object({
|
|
annotation_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Annotation deleted successfully.
|
|
*/
|
|
export const zDeleteAppsAnnotationsByAnnotationIdResponse = z.void()
|
|
|
|
export const zPutAppsAnnotationsByAnnotationIdBody = zAnnotationCreatePayload
|
|
|
|
export const zPutAppsAnnotationsByAnnotationIdPath = z.object({
|
|
annotation_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Annotation updated successfully.
|
|
*/
|
|
export const zPutAppsAnnotationsByAnnotationIdResponse = zAnnotation
|
|
|
|
export const zPostAudioToTextBody = z.object({
|
|
file: z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
user: z.string().optional(),
|
|
})
|
|
|
|
/**
|
|
* Successfully converted audio to text.
|
|
*/
|
|
export const zPostAudioToTextResponse = zAudioTranscriptResponse
|
|
|
|
export const zPostChatMessagesBody = zChatRequestPayloadWithUser
|
|
|
|
/**
|
|
* Successful response. The content type and structure depend on the `response_mode` parameter in the request.
|
|
*
|
|
* - If `response_mode` is `blocking`, returns `application/json` with a `ChatCompletionResponse` object.
|
|
* - If `response_mode` is `streaming`, returns `text/event-stream` with a stream of Server-Sent Events.
|
|
*/
|
|
export const zPostChatMessagesResponse = z.union([zChatBlockingResponse, z.string()])
|
|
|
|
export const zPostChatMessagesByTaskIdStopBody = zScopedTaskStopPayload
|
|
|
|
export const zPostChatMessagesByTaskIdStopPath = z.object({
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Task stopped successfully
|
|
*/
|
|
export const zPostChatMessagesByTaskIdStopResponse = zSimpleResultResponse
|
|
|
|
export const zPostCompletionMessagesBody = zCompletionRequestPayloadWithUser
|
|
|
|
/**
|
|
* Successful response. The content type and structure depend on the `response_mode` parameter in the request.
|
|
*
|
|
* - If `response_mode` is `blocking`, returns `application/json` with a `CompletionResponse` object.
|
|
* - If `response_mode` is `streaming`, returns `text/event-stream` with a stream of `ChunkCompletionEvent` objects.
|
|
*/
|
|
export const zPostCompletionMessagesResponse = z.union([zCompletionBlockingResponse, z.string()])
|
|
|
|
export const zPostCompletionMessagesByTaskIdStopBody = zScopedTaskStopPayload
|
|
|
|
export const zPostCompletionMessagesByTaskIdStopPath = z.object({
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Task stopped successfully
|
|
*/
|
|
export const zPostCompletionMessagesByTaskIdStopResponse = zSimpleResultResponse
|
|
|
|
export const zGetConversationsQuery = z.object({
|
|
last_id: z.string().optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
sort_by: z
|
|
.enum(['-created_at', '-updated_at', 'created_at', 'updated_at'])
|
|
.optional()
|
|
.default('-updated_at'),
|
|
user: z.string().optional(),
|
|
})
|
|
|
|
/**
|
|
* Conversations retrieved successfully.
|
|
*/
|
|
export const zGetConversationsResponse = zConversationInfiniteScrollPagination
|
|
|
|
export const zDeleteConversationsByConversationIdBody = zOptionalServiceApiUserPayload
|
|
|
|
export const zDeleteConversationsByConversationIdPath = z.object({
|
|
conversation_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Conversation deleted successfully.
|
|
*/
|
|
export const zDeleteConversationsByConversationIdResponse = z.void()
|
|
|
|
export const zPostConversationsByConversationIdNameBody = zConversationRenamePayloadWithUser
|
|
|
|
export const zPostConversationsByConversationIdNamePath = z.object({
|
|
conversation_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Conversation renamed successfully; model failure preserves the existing name.
|
|
*/
|
|
export const zPostConversationsByConversationIdNameResponse = zSimpleConversation
|
|
|
|
export const zGetConversationsByConversationIdVariablesPath = z.object({
|
|
conversation_id: z.uuid(),
|
|
})
|
|
|
|
export const zGetConversationsByConversationIdVariablesQuery = z.object({
|
|
last_id: z.string().optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
user: z.string().optional(),
|
|
variable_name: z.string().min(1).max(255).optional(),
|
|
})
|
|
|
|
/**
|
|
* Conversation variables retrieved successfully.
|
|
*/
|
|
export const zGetConversationsByConversationIdVariablesResponse =
|
|
zConversationVariableInfiniteScrollPaginationResponse
|
|
|
|
export const zPutConversationsByConversationIdVariablesByVariableIdBody =
|
|
zConversationVariableUpdatePayloadWithUser
|
|
|
|
export const zPutConversationsByConversationIdVariablesByVariableIdPath = z.object({
|
|
conversation_id: z.uuid(),
|
|
variable_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Variable updated successfully.
|
|
*/
|
|
export const zPutConversationsByConversationIdVariablesByVariableIdResponse =
|
|
zConversationVariableResponse
|
|
|
|
export const zGetDatasetsQuery = z.object({
|
|
include_all: z.boolean().optional().default(false),
|
|
keyword: z.string().optional(),
|
|
limit: z.int().optional().default(20),
|
|
page: z.int().optional().default(1),
|
|
tag_ids: z.array(z.string()).optional(),
|
|
})
|
|
|
|
/**
|
|
* List of knowledge bases.
|
|
*/
|
|
export const zGetDatasetsResponse = zDatasetListResponse
|
|
|
|
export const zPostDatasetsBody = zDatasetCreatePayload
|
|
|
|
/**
|
|
* Knowledge base created successfully.
|
|
*/
|
|
export const zPostDatasetsResponse = zDatasetDetailResponse
|
|
|
|
export const zPostDatasetsPipelineFileUploadBody = z.object({
|
|
file: z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
})
|
|
|
|
/**
|
|
* File uploaded successfully.
|
|
*/
|
|
export const zPostDatasetsPipelineFileUploadResponse = zPipelineUploadFileResponse
|
|
|
|
export const zDeleteDatasetsTagsBody = zTagDeletePayload
|
|
|
|
/**
|
|
* Success.
|
|
*/
|
|
export const zDeleteDatasetsTagsResponse = z.void()
|
|
|
|
/**
|
|
* List of tags.
|
|
*/
|
|
export const zGetDatasetsTagsResponse = zKnowledgeTagListResponse
|
|
|
|
export const zPatchDatasetsTagsBody = zTagUpdatePayload
|
|
|
|
/**
|
|
* Tag updated successfully.
|
|
*/
|
|
export const zPatchDatasetsTagsResponse = zKnowledgeTagResponse
|
|
|
|
export const zPostDatasetsTagsBody = zTagCreatePayload
|
|
|
|
/**
|
|
* Tag created successfully.
|
|
*/
|
|
export const zPostDatasetsTagsResponse = zKnowledgeTagResponse
|
|
|
|
export const zPostDatasetsTagsBindingBody = zTagBindingPayload
|
|
|
|
/**
|
|
* Success.
|
|
*/
|
|
export const zPostDatasetsTagsBindingResponse = z.void()
|
|
|
|
export const zPostDatasetsTagsUnbindingBody = zTagUnbindingPayload
|
|
|
|
/**
|
|
* Success.
|
|
*/
|
|
export const zPostDatasetsTagsUnbindingResponse = z.void()
|
|
|
|
export const zDeleteDatasetsByDatasetIdPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Success.
|
|
*/
|
|
export const zDeleteDatasetsByDatasetIdResponse = z.void()
|
|
|
|
export const zGetDatasetsByDatasetIdPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Knowledge base details.
|
|
*/
|
|
export const zGetDatasetsByDatasetIdResponse = zDatasetDetailWithPartialMembersResponse
|
|
|
|
export const zPatchDatasetsByDatasetIdBody = zDatasetUpdatePayload
|
|
|
|
export const zPatchDatasetsByDatasetIdPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Knowledge base updated successfully.
|
|
*/
|
|
export const zPatchDatasetsByDatasetIdResponse = zDatasetDetailWithPartialMembersResponse
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentCreateByFileBody = z.object({
|
|
data: z.string().optional(),
|
|
file: z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
})
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentCreateByFilePath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Document created successfully.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdDocumentCreateByFileResponse = zDocumentAndBatchResponse
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentCreateByTextBody = zDocumentTextCreatePayload
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentCreateByTextPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Document created successfully.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdDocumentCreateByTextResponse = zDocumentAndBatchResponse
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentCreateByFile2Body = z.object({
|
|
data: z.string().optional(),
|
|
file: z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
})
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentCreateByFile2Path = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Document created successfully.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdDocumentCreateByFile2Response = zDocumentAndBatchResponse
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentCreateByText2Body = zDocumentTextCreatePayload
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentCreateByText2Path = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Document created successfully
|
|
*/
|
|
export const zPostDatasetsByDatasetIdDocumentCreateByText2Response = zDocumentAndBatchResponse
|
|
|
|
export const zGetDatasetsByDatasetIdDocumentsPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
export const zGetDatasetsByDatasetIdDocumentsQuery = z.object({
|
|
keyword: z.string().optional(),
|
|
limit: z.int().optional().default(20),
|
|
page: z.int().optional().default(1),
|
|
status: z
|
|
.enum(['archived', 'available', 'disabled', 'error', 'indexing', 'paused', 'queuing'])
|
|
.optional(),
|
|
})
|
|
|
|
/**
|
|
* List of documents.
|
|
*/
|
|
export const zGetDatasetsByDatasetIdDocumentsResponse = zDocumentListResponse
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsDownloadZipBody = zDocumentBatchDownloadZipPayload
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsDownloadZipPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* ZIP archive containing the requested documents.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdDocumentsDownloadZipResponse = z.custom<Blob | File>(
|
|
(value) => value instanceof Blob || value instanceof File,
|
|
)
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsMetadataBody = zMetadataOperationData
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsMetadataPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Document metadata updated successfully.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdDocumentsMetadataResponse = zDatasetMetadataActionResponse
|
|
|
|
export const zPatchDatasetsByDatasetIdDocumentsStatusByActionBody = zDocumentStatusPayload
|
|
|
|
export const zPatchDatasetsByDatasetIdDocumentsStatusByActionPath = z.object({
|
|
action: z.enum(['archive', 'disable', 'enable', 'un_archive']),
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Document status updated successfully
|
|
*/
|
|
export const zPatchDatasetsByDatasetIdDocumentsStatusByActionResponse = zSimpleResultResponse
|
|
|
|
export const zGetDatasetsByDatasetIdDocumentsByBatchIndexingStatusPath = z.object({
|
|
batch: z.string(),
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Indexing status for documents in the batch.
|
|
*/
|
|
export const zGetDatasetsByDatasetIdDocumentsByBatchIndexingStatusResponse =
|
|
zDocumentStatusListResponse
|
|
|
|
export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Success.
|
|
*/
|
|
export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdResponse = z.void()
|
|
|
|
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
})
|
|
|
|
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdQuery = z.object({
|
|
metadata: z.enum(['all', 'only', 'without']).optional().default('all'),
|
|
})
|
|
|
|
/**
|
|
* Document details. The response shape varies based on the `metadata` query parameter. When `metadata` is `only`, only `id`, `doc_type`, and `doc_metadata` are returned. When `metadata` is `without`, `doc_type` and `doc_metadata` are omitted.
|
|
*/
|
|
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdResponse = zDocumentDetailResponse
|
|
|
|
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdBody = z.object({
|
|
data: z.string().optional(),
|
|
file: z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File).optional(),
|
|
})
|
|
|
|
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Document updated successfully.
|
|
*/
|
|
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdResponse = zDocumentAndBatchResponse
|
|
|
|
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Download URL generated successfully.
|
|
*/
|
|
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadResponse = zUrlResponse
|
|
|
|
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
})
|
|
|
|
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsQuery = z.object({
|
|
keyword: z.string().optional(),
|
|
limit: z.int().gte(1).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
status: z.array(z.string()).optional(),
|
|
})
|
|
|
|
/**
|
|
* List of chunks.
|
|
*/
|
|
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponse = zSegmentListResponse
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBody = zSegmentCreatePayload
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Chunks created successfully.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponse =
|
|
zSegmentCreateListResponse
|
|
|
|
export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
segment_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Success.
|
|
*/
|
|
export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse = z.void()
|
|
|
|
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
segment_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Chunk details.
|
|
*/
|
|
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse =
|
|
zSegmentDetailResponse
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdBody =
|
|
zSegmentUpdatePayload
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
segment_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Chunk updated successfully.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse =
|
|
zSegmentDetailResponse
|
|
|
|
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksPath =
|
|
z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
segment_id: z.uuid(),
|
|
})
|
|
|
|
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksQuery =
|
|
z.object({
|
|
keyword: z.string().optional(),
|
|
limit: z.int().gte(1).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* List of child chunks.
|
|
*/
|
|
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse =
|
|
zChildChunkListResponse
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksBody =
|
|
zChildChunkCreatePayload
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksPath =
|
|
z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
segment_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Child chunk created successfully.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse =
|
|
zChildChunkDetailResponse
|
|
|
|
export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath =
|
|
z.object({
|
|
child_chunk_id: z.uuid(),
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
segment_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Success.
|
|
*/
|
|
export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse =
|
|
z.void()
|
|
|
|
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdBody =
|
|
zChildChunkUpdatePayload
|
|
|
|
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath =
|
|
z.object({
|
|
child_chunk_id: z.uuid(),
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
segment_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Child chunk updated successfully.
|
|
*/
|
|
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse =
|
|
zChildChunkDetailResponse
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFileBody = z.object({
|
|
data: z.string().optional(),
|
|
file: z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File).optional(),
|
|
})
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFilePath = z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Document updated successfully.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFileResponse =
|
|
zDocumentAndBatchResponse
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextBody = zDocumentTextUpdate
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Document updated successfully.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByTextResponse =
|
|
zDocumentAndBatchResponse
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Body = z.object({
|
|
data: z.string().optional(),
|
|
file: z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File).optional(),
|
|
})
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Path = z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Document updated successfully.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByFile2Response =
|
|
zDocumentAndBatchResponse
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Body = zDocumentTextUpdate
|
|
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Path = z.object({
|
|
dataset_id: z.uuid(),
|
|
document_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Document updated successfully
|
|
*/
|
|
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdUpdateByText2Response =
|
|
zDocumentAndBatchResponse
|
|
|
|
export const zPostDatasetsByDatasetIdHitTestingBody = zHitTestingPayload
|
|
|
|
export const zPostDatasetsByDatasetIdHitTestingPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Retrieval results.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdHitTestingResponse = zHitTestingResponse
|
|
|
|
export const zGetDatasetsByDatasetIdMetadataPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Metadata fields for the knowledge base.
|
|
*/
|
|
export const zGetDatasetsByDatasetIdMetadataResponse = zDatasetMetadataListResponse
|
|
|
|
export const zPostDatasetsByDatasetIdMetadataBody = zMetadataArgs
|
|
|
|
export const zPostDatasetsByDatasetIdMetadataPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Metadata field created successfully.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdMetadataResponse = zDatasetMetadataResponse
|
|
|
|
export const zGetDatasetsByDatasetIdMetadataBuiltInPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Built-in metadata fields.
|
|
*/
|
|
export const zGetDatasetsByDatasetIdMetadataBuiltInResponse = zDatasetMetadataBuiltInFieldsResponse
|
|
|
|
export const zPostDatasetsByDatasetIdMetadataBuiltInByActionPath = z.object({
|
|
action: z.enum(['disable', 'enable']),
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Built-in metadata field toggled successfully.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdMetadataBuiltInByActionResponse =
|
|
zDatasetMetadataActionResponse
|
|
|
|
export const zDeleteDatasetsByDatasetIdMetadataByMetadataIdPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
metadata_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Success.
|
|
*/
|
|
export const zDeleteDatasetsByDatasetIdMetadataByMetadataIdResponse = z.void()
|
|
|
|
export const zPatchDatasetsByDatasetIdMetadataByMetadataIdBody = zMetadataUpdatePayload
|
|
|
|
export const zPatchDatasetsByDatasetIdMetadataByMetadataIdPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
metadata_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Metadata field updated successfully.
|
|
*/
|
|
export const zPatchDatasetsByDatasetIdMetadataByMetadataIdResponse = zDatasetMetadataResponse
|
|
|
|
export const zGetDatasetsByDatasetIdPipelineDatasourcePluginsPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
export const zGetDatasetsByDatasetIdPipelineDatasourcePluginsQuery = z.object({
|
|
is_published: z.boolean().optional().default(true),
|
|
})
|
|
|
|
/**
|
|
* List of datasource nodes configured in the pipeline.
|
|
*/
|
|
export const zGetDatasetsByDatasetIdPipelineDatasourcePluginsResponse =
|
|
zDatasourcePluginListResponse
|
|
|
|
export const zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunBody =
|
|
zDatasourceNodeRunPayload
|
|
|
|
export const zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
node_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Streaming response with node execution events.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdPipelineDatasourceNodesByNodeIdRunResponse = z.string()
|
|
|
|
export const zPostDatasetsByDatasetIdPipelineRunBody = zPipelineRunApiEntity
|
|
|
|
export const zPostDatasetsByDatasetIdPipelineRunPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Pipeline execution result. Published runs return a JSON object containing `batch`, `dataset`, and `documents`. Draft runs return `text/event-stream` for streaming mode or a workflow result JSON object for blocking mode.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdPipelineRunResponse = z.union([
|
|
zPipelineRunJsonResponse,
|
|
z.string(),
|
|
])
|
|
|
|
export const zPostDatasetsByDatasetIdRetrieveBody = zHitTestingPayload
|
|
|
|
export const zPostDatasetsByDatasetIdRetrievePath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Retrieval results.
|
|
*/
|
|
export const zPostDatasetsByDatasetIdRetrieveResponse = zHitTestingResponse
|
|
|
|
export const zGetDatasetsByDatasetIdTagsPath = z.object({
|
|
dataset_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Tags bound to the knowledge base.
|
|
*/
|
|
export const zGetDatasetsByDatasetIdTagsResponse = zDatasetBoundTagListResponse
|
|
|
|
export const zGetEndUsersByEndUserIdPath = z.object({
|
|
end_user_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* End user retrieved successfully.
|
|
*/
|
|
export const zGetEndUsersByEndUserIdResponse = zEndUserDetail
|
|
|
|
export const zPostFilesUploadBody = z.object({
|
|
file: z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
user: z.string().optional(),
|
|
})
|
|
|
|
/**
|
|
* File uploaded successfully.
|
|
*/
|
|
export const zPostFilesUploadResponse = zFileResponse
|
|
|
|
export const zGetFilesByFileIdPreviewPath = z.object({
|
|
file_id: z.uuid(),
|
|
})
|
|
|
|
export const zGetFilesByFileIdPreviewQuery = z.object({
|
|
as_attachment: z.boolean().optional().default(false),
|
|
user: z.string().optional(),
|
|
})
|
|
|
|
/**
|
|
* Returns the raw file content. The `Content-Type` header is set to the file's MIME type. If `as_attachment` is `true`, the file is returned as a download with `Content-Disposition: attachment`.
|
|
*/
|
|
export const zGetFilesByFileIdPreviewResponse = z.custom<Blob | File>(
|
|
(value) => value instanceof Blob || value instanceof File,
|
|
)
|
|
|
|
export const zGetFormHumanInputByFormTokenPath = z.object({
|
|
form_token: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Form contents retrieved successfully.
|
|
*/
|
|
export const zGetFormHumanInputByFormTokenResponse = zHumanInputFormDefinitionResponse
|
|
|
|
export const zPostFormHumanInputByFormTokenBody = zHumanInputFormSubmitPayloadWithUser
|
|
|
|
export const zPostFormHumanInputByFormTokenPath = z.object({
|
|
form_token: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Form submitted successfully. The response body is an empty object.
|
|
*/
|
|
export const zPostFormHumanInputByFormTokenResponse = zHumanInputFormSubmitResponse
|
|
|
|
/**
|
|
* Basic information of the application.
|
|
*/
|
|
export const zGetInfoResponse = zAppInfoResponse
|
|
|
|
export const zPostKnowledgeFsQueryStreamBody = zKnowledgeFsAdmittedQueryRequest
|
|
|
|
/**
|
|
* Agent Knowledge Base query event stream
|
|
*/
|
|
export const zPostKnowledgeFsQueryStreamResponse = z.string()
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdBackgroundTasksPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdBackgroundTasksQuery = z.object({
|
|
cursor: z.string().min(1).max(8192).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
task_ids: z
|
|
.string()
|
|
.max(3699)
|
|
.regex(
|
|
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(,[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}){0,99}$/,
|
|
)
|
|
.optional(),
|
|
})
|
|
|
|
/**
|
|
* listBackgroundTasks
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdBackgroundTasksResponse =
|
|
zKnowledgeFsBackgroundTaskListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdBulkJobsByJobIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
job_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base bulk job
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdBulkJobsByJobIdResponse =
|
|
zKnowledgeFsBulkJobResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDeletionBatchesByBatchIdPath = z.object({
|
|
batch_id: z.string(),
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Deletion batch status
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDeletionBatchesByBatchIdResponse =
|
|
zKnowledgeFsBulkDeletionAcceptedResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDeletionJobsByJobIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
job_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* getDeletionJob
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDeletionJobsByJobIdResponse =
|
|
zKnowledgeFsDurableDeletionJobResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdDeletionJobsByJobIdRetryHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdDeletionJobsByJobIdRetryPath = z.object({
|
|
control_space_id: z.string(),
|
|
job_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* retryDeletionJob
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdDeletionJobsByJobIdRetryResponse =
|
|
zKnowledgeFsDurableDeletionJobResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentReferencesResolvePath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentReferencesResolveQuery = z.object({
|
|
document_asset_id: z.string().min(1).max(255),
|
|
document_asset_version: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* resolveDocumentReference
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentReferencesResolveResponse =
|
|
zKnowledgeFsResolvedDocumentReferenceResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base documents
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsResponse =
|
|
zKnowledgeFsDocumentListResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsBulkBody =
|
|
zKnowledgeFsBulkDocumentDeletePayload
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsBulkHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsBulkPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base document deletions accepted
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsBulkResponse =
|
|
zKnowledgeFsBulkDeletionAcceptedResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdDocumentsReindexBody =
|
|
zKnowledgeFsDocumentReindexPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdDocumentsReindexHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255).optional(),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdDocumentsReindexPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base document reindex queued
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdDocumentsReindexResponse =
|
|
zKnowledgeFsDocumentReindexResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdBody =
|
|
zKnowledgeFsDocumentDeletePayload
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base document deletion accepted
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdResponse =
|
|
zKnowledgeFsDurableDeletionAcceptedResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base document
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdResponse =
|
|
zKnowledgeFsDocumentResponse
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdBody =
|
|
zKnowledgeFsDocumentMetadataPayload
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base document metadata updated
|
|
*/
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdResponse =
|
|
zKnowledgeFsLogicalDocumentResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdOutlinePath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base document outline
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdOutlineResponse =
|
|
zKnowledgeFsDocumentOutlineResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsPath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base document revisions
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsResponse =
|
|
zKnowledgeFsDocumentRevisionListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsByRevisionChunksPath =
|
|
z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
revision: z.int(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsByRevisionChunksQuery =
|
|
z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
query: z.string().min(1).max(512).optional(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base document chunks
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsByRevisionChunksResponse =
|
|
zKnowledgeFsDocumentChunkListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdPath =
|
|
z.object({
|
|
chunk_id: z.string(),
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
revision: z.int(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base document chunk
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdResponse =
|
|
zKnowledgeFsDocumentChunkResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdJobsByJobIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
job_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base compilation job canceled
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdJobsByJobIdResponse =
|
|
zKnowledgeFsDocumentCompilationJobResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdJobsByJobIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
job_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base compilation job
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdJobsByJobIdResponse =
|
|
zKnowledgeFsDocumentCompilationJobResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdJobsByJobIdRetryPath = z.object({
|
|
control_space_id: z.string(),
|
|
job_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base compilation job retried
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdJobsByJobIdRetryResponse =
|
|
zKnowledgeFsDocumentCompilationJobResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* listLogicalDocuments
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsResponse =
|
|
zKnowledgeFsLogicalDocumentListResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdBody =
|
|
zKnowledgeFsLogicalDocumentDeletePayload
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdHeaders = z.object(
|
|
{
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
},
|
|
)
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base logical document deletion accepted
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdResponse =
|
|
zKnowledgeFsDurableDeletionAcceptedResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* getLogicalDocument
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdResponse =
|
|
zKnowledgeFsLogicalDocumentResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdProcessingTasksPath =
|
|
z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdProcessingTasksQuery =
|
|
z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* Document processing history
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdProcessingTasksResponse =
|
|
zKnowledgeFsDocumentProcessingTaskListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdProcessingTasksByTaskIdPath =
|
|
z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Document processing task
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdProcessingTasksByTaskIdResponse =
|
|
zKnowledgeFsDocumentProcessingTaskResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQueriesAdmissionBody =
|
|
zKnowledgeFsQueryCreatePayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQueriesAdmissionPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base streaming query admitted through Dify API
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQueriesAdmissionResponse =
|
|
zKnowledgeFsQueryAdmissionResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQueryImagesBody = z.object({
|
|
file: z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQueryImagesPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Query image uploaded
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQueryImagesResponse =
|
|
zKnowledgeFsServiceQueryImageUploadResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base research tasks
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksResponse =
|
|
zKnowledgeFsResearchTaskListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksBody =
|
|
zKnowledgeFsResearchTaskCreatePayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255).optional(),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base research task accepted
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksResponse =
|
|
zKnowledgeFsResearchTaskResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksPlanBody =
|
|
zKnowledgeFsResearchTaskPlanPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksPlanPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base research task plan
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksPlanResponse =
|
|
zKnowledgeFsResearchTaskPlanResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base research task canceled
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdResponse =
|
|
zKnowledgeFsResearchTaskResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base research task
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdResponse =
|
|
zKnowledgeFsResearchTaskResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdPartialsPath = z.object({
|
|
control_space_id: z.string(),
|
|
task_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdPartialsQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(25),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base research task partial evidence
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdPartialsResponse =
|
|
zKnowledgeFsResearchTaskPartialListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdResumePath = z.object({
|
|
control_space_id: z.string(),
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* resumeResearchTask
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdResumeResponse =
|
|
zKnowledgeFsResearchTaskResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSettingsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base settings
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSettingsResponse = zKnowledgeFsSettingsResponse
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdSettingsBody = zKnowledgeFsSettingsPayload
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdSettingsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base settings updated
|
|
*/
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdSettingsResponse =
|
|
zKnowledgeFsSettingsUpdateResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSettingsMigrationsByMigrationIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
migration_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* getProfileMigration
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSettingsMigrationsByMigrationIdResponse =
|
|
zKnowledgeFsProfileMigrationResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceConnectionsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceConnectionsQuery = z.object({
|
|
cursor: z.string().min(1).max(4096).optional(),
|
|
limit: z.int().gte(1).lte(200).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* listSourceConnections
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceConnectionsResponse =
|
|
zKnowledgeFsSourceConnectionListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceConnectionsBody =
|
|
zKnowledgeFsServiceSourceConnectionCreatePayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceConnectionsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* createSourceConnection
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceConnectionsResponse =
|
|
zKnowledgeFsSourceConnectionResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceConnectionsByConnectionIdRefreshBody =
|
|
zKnowledgeFsSourceConnectionRefreshPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceConnectionsByConnectionIdRefreshPath =
|
|
z.object({
|
|
connection_id: z.string(),
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* refreshSourceConnection
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceConnectionsByConnectionIdRefreshResponse =
|
|
zKnowledgeFsSourceConnectionResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceProvidersPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Source providers
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceProvidersResponse =
|
|
zKnowledgeFsSourceProviderListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
sourceId: z.string().min(1).max(255).optional(),
|
|
})
|
|
|
|
/**
|
|
* listSourceWorkflows
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsResponse =
|
|
zKnowledgeFsSourceWorkflowListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
run_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* getSourceWorkflow
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdCancelBody =
|
|
zKnowledgeFsSourceWorkflowCancelPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdCancelPath = z.object({
|
|
control_space_id: z.string(),
|
|
run_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* cancelSourceWorkflow
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdCancelResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdPagesPath = z.object({
|
|
control_space_id: z.string(),
|
|
run_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdPagesQuery = z.object({
|
|
cursor: z.string().min(1).max(4096).optional(),
|
|
limit: z.int().gte(1).lte(200).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* listCrawlPreviewPages
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdPagesResponse =
|
|
zKnowledgeFsCrawlPreviewPageListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdRetryPath = z.object({
|
|
control_space_id: z.string(),
|
|
run_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* retrySourceWorkflow
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdRetryResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdSelectionBody =
|
|
zKnowledgeFsCrawlPreviewSelectionPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdSelectionHeaders =
|
|
z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdSelectionPath = z.object({
|
|
control_space_id: z.string(),
|
|
run_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* selectCrawlPreviewPages
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdSelectionResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base sources
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesResponse = zKnowledgeFsSourceListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBody =
|
|
zKnowledgeFsServiceSourceCreatePayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base source created
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesResponse = zKnowledgeFsSourceResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdBody =
|
|
zKnowledgeFsSourceDeletePayload
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdQuery = z.object({
|
|
documents: z.enum(['cascade', 'keep']).optional().default('cascade'),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base source deletion accepted
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdResponse =
|
|
zKnowledgeFsDurableDeletionAcceptedResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base source
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdResponse =
|
|
zKnowledgeFsSourceResponse
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdBody =
|
|
zKnowledgeFsServiceSourceUpdatePayload
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base source updated
|
|
*/
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdResponse =
|
|
zKnowledgeFsSourceResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base source crawl
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlImportBody =
|
|
zKnowledgeFsCrawlImportPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlImportHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlImportPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* importSelectedSourceCrawl
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlImportResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlPreviewHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlPreviewPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* previewSourceCrawl
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlPreviewResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdFilesPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdFilesQuery = z.object({
|
|
bucket: z.string().optional(),
|
|
continuationToken: z.string().min(1).max(4096).optional(),
|
|
maxKeys: z.int().gte(1).lte(1000).optional(),
|
|
prefix: z.string().optional(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base source files
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdFilesResponse =
|
|
zKnowledgeFsSourceFilesResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdImportBody =
|
|
zKnowledgeFsSourceImportPagesPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdImportHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdImportPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base source pages imported
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdImportResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdImportFilesBody =
|
|
zKnowledgeFsSourceImportFilesPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdImportFilesHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdImportFilesPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base source files imported
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdImportFilesResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdPagesPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdPagesQuery = z.object({
|
|
cursor: z.string().min(1).max(4096).optional(),
|
|
limit: z.int().gte(1).lte(200).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base source pages
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdPagesResponse =
|
|
zKnowledgeFsSourcePagesResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* syncSource
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncPolicyPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* getSourceSyncPolicy
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncPolicyResponse =
|
|
zKnowledgeFsSourceSyncPolicyResponse
|
|
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncPolicyBody =
|
|
zKnowledgeFsSourceSyncPolicyPayload
|
|
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncPolicyPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* updateSourceSyncPolicy
|
|
*/
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncPolicyResponse =
|
|
zKnowledgeFsSourceSyncPolicyResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdTestPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base source credential test
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdTestResponse =
|
|
zKnowledgeFsSourceCredentialTestResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdWorkflowImportsBody =
|
|
zKnowledgeFsSourceWorkflowImportPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdWorkflowImportsHeaders =
|
|
z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdWorkflowImportsPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* importSourceWorkflow
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdWorkflowImportsResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
source: z.enum(['agent', 'mcp', 'retrieval_test', 'service_api', 'workflow']).optional(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base traces
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesResponse = zKnowledgeFsTraceListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
trace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base answer trace
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdResponse =
|
|
zKnowledgeFsAnswerTraceResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdConflictsPath = z.object({
|
|
control_space_id: z.string(),
|
|
trace_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdConflictsQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(200).optional().default(100),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base trace conflicts
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdConflictsResponse =
|
|
zKnowledgeFsTraceEntryListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdEvidencePath = z.object({
|
|
control_space_id: z.string(),
|
|
trace_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdEvidenceQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(200).optional().default(100),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base trace evidence view
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdEvidenceResponse =
|
|
zKnowledgeFsTraceEntryListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdMissingPath = z.object({
|
|
control_space_id: z.string(),
|
|
trace_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdMissingQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(200).optional().default(100),
|
|
})
|
|
|
|
/**
|
|
* Agent Knowledge Base trace missing evidence
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdMissingResponse =
|
|
zKnowledgeFsTraceEntryListResponse
|
|
|
|
export const zGetMessagesQuery = z.object({
|
|
conversation_id: z.string(),
|
|
first_id: z.string().optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
user: z.string().optional(),
|
|
})
|
|
|
|
/**
|
|
* Successfully retrieved conversation history.
|
|
*/
|
|
export const zGetMessagesResponse = zMessageInfiniteScrollPagination
|
|
|
|
export const zPostMessagesByMessageIdFeedbacksBody = zMessageFeedbackPayloadWithUser
|
|
|
|
export const zPostMessagesByMessageIdFeedbacksPath = z.object({
|
|
message_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* Feedback submitted successfully
|
|
*/
|
|
export const zPostMessagesByMessageIdFeedbacksResponse = zResultResponse
|
|
|
|
export const zGetMessagesByMessageIdSuggestedPath = z.object({
|
|
message_id: z.uuid(),
|
|
})
|
|
|
|
export const zGetMessagesByMessageIdSuggestedQuery = z.object({
|
|
user: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Suggested questions retrieved successfully
|
|
*/
|
|
export const zGetMessagesByMessageIdSuggestedResponse = zSimpleResultStringListResponse
|
|
|
|
/**
|
|
* Successfully retrieved application meta information.
|
|
*/
|
|
export const zGetMetaResponse = zAppMetaResponse
|
|
|
|
/**
|
|
* Application parameters information.
|
|
*/
|
|
export const zGetParametersResponse = zParameters
|
|
|
|
/**
|
|
* WebApp settings of the application.
|
|
*/
|
|
export const zGetSiteResponse = zSite
|
|
|
|
export const zPostTextToAudioBody = zTextToAudioPayloadWithUser
|
|
|
|
/**
|
|
* Returns the generated audio. The `Content-Type` header reflects the provider audio container, verified from the response bytes when recognizable. The binary response can be AAC, FLAC, MP4, MP3, Ogg, WAV, or WebM.
|
|
*/
|
|
export const zPostTextToAudioResponse = z.custom<Blob | File>(
|
|
(value) => value instanceof Blob || value instanceof File,
|
|
)
|
|
|
|
export const zGetWorkflowByWorkflowRunIdEventsPath = z.object({
|
|
workflow_run_id: z.string(),
|
|
})
|
|
|
|
export const zGetWorkflowByWorkflowRunIdEventsQuery = z.object({
|
|
continue_on_pause: z.boolean().optional().default(false),
|
|
include_state_snapshot: z.boolean().optional().default(false),
|
|
user: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Server-Sent Events stream. Each event is delivered as `data: {JSON}\n\n`. Event payloads follow the same schemas as the original streaming response.
|
|
*/
|
|
export const zGetWorkflowByWorkflowRunIdEventsResponse = z.string()
|
|
|
|
export const zGetWorkflowsLogsQuery = z.object({
|
|
created_at__after: z.iso.datetime().optional(),
|
|
created_at__before: z.iso.datetime().optional(),
|
|
created_by_account: z.string().optional(),
|
|
created_by_end_user_session_id: z.string().optional(),
|
|
keyword: z.string().optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
page: z.int().gte(1).lte(99999).optional().default(1),
|
|
status: z.enum(['failed', 'stopped', 'succeeded']).optional(),
|
|
})
|
|
|
|
/**
|
|
* Successfully retrieved workflow logs.
|
|
*/
|
|
export const zGetWorkflowsLogsResponse = zWorkflowAppLogPaginationResponse
|
|
|
|
export const zPostWorkflowsRunBody = zWorkflowRunPayloadWithUser
|
|
|
|
/**
|
|
* Successful response. The content type and structure depend on the `response_mode` parameter in the request.
|
|
*
|
|
* - If `response_mode` is `blocking`, returns `application/json` with a `WorkflowBlockingResponse` object.
|
|
* - If `response_mode` is `streaming`, returns `text/event-stream` with a stream of `ChunkWorkflowEvent` objects.
|
|
*/
|
|
export const zPostWorkflowsRunResponse = z.union([zWorkflowBlockingResponse, z.string()])
|
|
|
|
export const zGetWorkflowsRunByWorkflowRunIdPath = z.object({
|
|
workflow_run_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Successfully retrieved workflow run details.
|
|
*/
|
|
export const zGetWorkflowsRunByWorkflowRunIdResponse = zWorkflowRunResponse
|
|
|
|
export const zPostWorkflowsTasksByTaskIdStopBody = zWorkflowTaskStopPayload
|
|
|
|
export const zPostWorkflowsTasksByTaskIdStopPath = z.object({
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Task stopped successfully
|
|
*/
|
|
export const zPostWorkflowsTasksByTaskIdStopResponse = zSimpleResultResponse
|
|
|
|
export const zPostWorkflowsByWorkflowIdRunBody = zWorkflowRunPayloadWithUser
|
|
|
|
export const zPostWorkflowsByWorkflowIdRunPath = z.object({
|
|
workflow_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Successful response. The content type and structure depend on the `response_mode` parameter in the request.
|
|
*
|
|
* - If `response_mode` is `blocking`, returns `application/json` with a `WorkflowBlockingResponse` object.
|
|
* - If `response_mode` is `streaming`, returns `text/event-stream` with a stream of `ChunkWorkflowEvent` objects.
|
|
*/
|
|
export const zPostWorkflowsByWorkflowIdRunResponse = z.union([
|
|
zWorkflowBlockingResponse,
|
|
z.string(),
|
|
])
|
|
|
|
export const zGetWorkspacesCurrentModelsModelTypesByModelTypePath = z.object({
|
|
model_type: z.enum(['llm', 'moderation', 'rerank', 'speech2text', 'text-embedding', 'tts']),
|
|
})
|
|
|
|
/**
|
|
* Available models for the specified type.
|
|
*/
|
|
export const zGetWorkspacesCurrentModelsModelTypesByModelTypeResponse =
|
|
zProviderWithModelsListResponse
|