mirror of
https://github.com/langgenius/dify.git
synced 2026-09-21 05:11:22 +08:00
refactor(api): migrate workspace model endpoints to BaseModel (#37963)
Co-authored-by: Asuka Minato <i@asukaminato.eu.org> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Byron Wang <byron@dify.ai>
This commit is contained in:
co-authored by
Asuka Minato
autofix-ci[bot]
Byron Wang
parent
c5cef80ea4
commit
3cd8d850fa
@@ -217,7 +217,7 @@ export type ParserCredentialDelete = {
|
||||
credential_id: string
|
||||
}
|
||||
|
||||
export type ProviderCredentialResponse = {
|
||||
export type ProviderCredentialsResponse = {
|
||||
credentials?: {
|
||||
[key: string]: unknown
|
||||
} | null
|
||||
@@ -248,7 +248,7 @@ export type ParserCredentialValidate = {
|
||||
}
|
||||
}
|
||||
|
||||
export type ProviderCredentialValidateResponse = {
|
||||
export type ValidationResultResponse = {
|
||||
error?: string | null
|
||||
result: 'error' | 'success'
|
||||
}
|
||||
@@ -258,7 +258,7 @@ export type ParserDeleteModels = {
|
||||
model_type: ModelType
|
||||
}
|
||||
|
||||
export type ModelWithProviderListResponse = {
|
||||
export type ProviderModelListResponse = {
|
||||
data: Array<ModelWithProviderEntityResponse>
|
||||
}
|
||||
|
||||
@@ -278,12 +278,12 @@ export type ParserDeleteCredential = {
|
||||
|
||||
export type ModelCredentialResponse = {
|
||||
available_credentials: Array<CredentialConfiguration>
|
||||
credentials?: {
|
||||
credentials: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
current_credential_id?: string | null
|
||||
current_credential_name?: string | null
|
||||
load_balancing: ModelCredentialLoadBalancingResponse
|
||||
load_balancing: ModelLoadBalancingResponse
|
||||
}
|
||||
|
||||
export type ParserCreateCredential = {
|
||||
@@ -319,11 +319,6 @@ export type ParserValidate = {
|
||||
model_type: ModelType
|
||||
}
|
||||
|
||||
export type ModelCredentialValidateResponse = {
|
||||
error?: string | null
|
||||
result: string
|
||||
}
|
||||
|
||||
export type LoadBalancingCredentialPayload = {
|
||||
credentials: {
|
||||
[key: string]: unknown
|
||||
@@ -337,7 +332,7 @@ export type LoadBalancingCredentialValidateResponse = {
|
||||
result: string
|
||||
}
|
||||
|
||||
export type ModelParameterRulesResponse = {
|
||||
export type ModelParameterRuleListResponse = {
|
||||
data: Array<ParameterRule>
|
||||
}
|
||||
|
||||
@@ -345,7 +340,7 @@ export type ParserPreferredProviderType = {
|
||||
preferred_provider_type: 'custom' | 'system'
|
||||
}
|
||||
|
||||
export type ProviderWithModelsDataResponse = {
|
||||
export type AvailableModelListResponse = {
|
||||
data: Array<ProviderWithModelsResponse>
|
||||
}
|
||||
|
||||
@@ -384,7 +379,7 @@ export type PluginDebuggingKeyResponse = {
|
||||
}
|
||||
|
||||
export type PluginManifestResponse = {
|
||||
manifest: unknown
|
||||
manifest: PluginDeclaration
|
||||
}
|
||||
|
||||
export type ParserGithubInstall = {
|
||||
@@ -394,14 +389,18 @@ export type ParserGithubInstall = {
|
||||
version: string
|
||||
}
|
||||
|
||||
export type PluginDaemonOperationResponse = unknown
|
||||
export type PluginInstallTaskStartResponse = {
|
||||
all_installed: boolean
|
||||
task?: PluginInstallTask | null
|
||||
task_id: string
|
||||
}
|
||||
|
||||
export type ParserPluginIdentifiers = {
|
||||
plugin_unique_identifiers: Array<string>
|
||||
}
|
||||
|
||||
export type PluginListResponse = {
|
||||
plugins: unknown
|
||||
plugins: Array<PluginEntity>
|
||||
total: number
|
||||
}
|
||||
|
||||
@@ -420,7 +419,7 @@ export type PluginVersionsResponse = {
|
||||
}
|
||||
|
||||
export type PluginDynamicOptionsResponse = {
|
||||
options: unknown
|
||||
options: Array<PluginParameterOption>
|
||||
}
|
||||
|
||||
export type ParserDynamicOptionsWithCredentials = {
|
||||
@@ -449,11 +448,11 @@ export type PluginReadmeResponse = {
|
||||
}
|
||||
|
||||
export type PluginTasksResponse = {
|
||||
tasks: unknown
|
||||
tasks: Array<PluginInstallTask>
|
||||
}
|
||||
|
||||
export type PluginTaskResponse = {
|
||||
task: unknown
|
||||
task: PluginInstallTask
|
||||
}
|
||||
|
||||
export type ParserUninstall = {
|
||||
@@ -473,12 +472,20 @@ export type ParserMarketplaceUpgrade = {
|
||||
original_plugin_unique_identifier: string
|
||||
}
|
||||
|
||||
export type PluginBundleUploadResponse = Array<PluginBundleDependency>
|
||||
|
||||
export type ParserGithubUpload = {
|
||||
package: string
|
||||
repo: string
|
||||
version: string
|
||||
}
|
||||
|
||||
export type PluginDecodeResponse = {
|
||||
manifest: PluginDeclaration
|
||||
unique_identifier: string
|
||||
verification?: PluginVerification | null
|
||||
}
|
||||
|
||||
export type PluginCategoryListResponse = {
|
||||
builtin_tools: Array<PluginCategoryBuiltinToolProviderResponse>
|
||||
has_more: boolean
|
||||
@@ -1175,10 +1182,8 @@ export type CredentialConfiguration = {
|
||||
credential_name: string
|
||||
}
|
||||
|
||||
export type ModelCredentialLoadBalancingResponse = {
|
||||
configs?: Array<{
|
||||
[key: string]: unknown
|
||||
}>
|
||||
export type ModelLoadBalancingResponse = {
|
||||
configs: Array<ModelLoadBalancingConfigResponse>
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
@@ -1230,6 +1235,61 @@ export type PluginAutoUpgradeSettingsResponseModel = {
|
||||
upgrade_time_of_day: number
|
||||
}
|
||||
|
||||
export type PluginDeclaration = {
|
||||
agent_strategy?: AgentStrategyProviderEntity | null
|
||||
author: string | null
|
||||
category: PluginCategory
|
||||
created_at: string
|
||||
datasource?: DatasourceProviderEntity | null
|
||||
description: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
endpoint?: EndpointProviderDeclaration | null
|
||||
icon: string
|
||||
icon_dark?: string | null
|
||||
label: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
meta: Meta
|
||||
model?: ProviderEntity | null
|
||||
name: string
|
||||
plugins: Plugins
|
||||
repo?: string | null
|
||||
resource: PluginResourceRequirements
|
||||
tags?: Array<string>
|
||||
tool?: ToolProviderEntity | null
|
||||
trigger?: TriggerProviderEntity | null
|
||||
verified?: boolean
|
||||
version: string
|
||||
}
|
||||
|
||||
export type PluginInstallTask = {
|
||||
completed_plugins: number
|
||||
created_at: string
|
||||
id: string
|
||||
plugins: Array<PluginInstallTaskPluginStatus>
|
||||
status: PluginInstallTaskStatus
|
||||
total_plugins: number
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export type PluginEntity = {
|
||||
checksum: string
|
||||
created_at: string
|
||||
declaration: PluginDeclaration
|
||||
endpoints_active: number
|
||||
endpoints_setups: number
|
||||
id: string
|
||||
installation_id: string
|
||||
meta: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
name: string
|
||||
plugin_id: string
|
||||
plugin_unique_identifier: string
|
||||
runtime_type: string
|
||||
source: PluginInstallationSource
|
||||
tenant_id: string
|
||||
updated_at: string
|
||||
version: string
|
||||
}
|
||||
|
||||
export type PluginInstallationItemResponse = {
|
||||
checksum: string
|
||||
created_at: string
|
||||
@@ -1258,10 +1318,25 @@ export type LatestPluginCache = {
|
||||
version: string
|
||||
}
|
||||
|
||||
export type PluginParameterOption = {
|
||||
icon?: string | null
|
||||
label: I18nObject
|
||||
value: string
|
||||
}
|
||||
|
||||
export type TenantPluginDebugPermission = 'admins' | 'everyone' | 'noone'
|
||||
|
||||
export type TenantPluginInstallPermission = 'admins' | 'everyone' | 'noone'
|
||||
|
||||
export type PluginBundleDependency = {
|
||||
type: PluginBundleDependencyType
|
||||
value: Github | Marketplace | Package
|
||||
}
|
||||
|
||||
export type PluginVerification = {
|
||||
authorized_category: AuthorizedCategory
|
||||
}
|
||||
|
||||
export type PluginCategoryBuiltinToolProviderResponse = {
|
||||
allow_delete: boolean
|
||||
author: string
|
||||
@@ -1650,6 +1725,18 @@ export type ModelStatus
|
||||
| 'no-permission'
|
||||
| 'quota-exceeded'
|
||||
|
||||
export type ModelLoadBalancingConfigResponse = {
|
||||
credential_id?: string | null
|
||||
credentials: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
enabled: boolean
|
||||
id: string
|
||||
in_cooldown: boolean
|
||||
name: string
|
||||
ttl: number
|
||||
}
|
||||
|
||||
export type GraphonModelRuntimeEntitiesCommonEntitiesI18nObject = {
|
||||
en_US: string
|
||||
zh_Hans?: string | null
|
||||
@@ -1678,6 +1765,103 @@ export type TenantPluginAutoUpgradeStrategySetting = 'disabled' | 'fix_only' | '
|
||||
|
||||
export type TenantPluginAutoUpgradeMode = 'all' | 'exclude' | 'partial'
|
||||
|
||||
export type AgentStrategyProviderEntity = {
|
||||
identity: AgentStrategyProviderIdentity
|
||||
plugin_id?: string | null
|
||||
}
|
||||
|
||||
export type PluginCategory
|
||||
= | 'agent-strategy'
|
||||
| 'datasource'
|
||||
| 'extension'
|
||||
| 'model'
|
||||
| 'tool'
|
||||
| 'trigger'
|
||||
|
||||
export type DatasourceProviderEntity = {
|
||||
credentials_schema?: Array<ProviderConfig>
|
||||
identity: DatasourceProviderIdentity
|
||||
oauth_schema?: OAuthSchema | null
|
||||
provider_type: DatasourceProviderType
|
||||
}
|
||||
|
||||
export type CoreToolsEntitiesCommonEntitiesI18nObject = {
|
||||
en_US: string
|
||||
ja_JP?: string | null
|
||||
pt_BR?: string | null
|
||||
zh_Hans?: string | null
|
||||
}
|
||||
|
||||
export type EndpointProviderDeclaration = {
|
||||
endpoints?: Array<EndpointDeclaration> | null
|
||||
settings?: Array<ProviderConfig>
|
||||
}
|
||||
|
||||
export type Meta = {
|
||||
minimum_dify_version?: string | null
|
||||
version?: string | null
|
||||
}
|
||||
|
||||
export type ProviderEntity = {
|
||||
background?: string | null
|
||||
configurate_methods: Array<ConfigurateMethod>
|
||||
description?: GraphonModelRuntimeEntitiesCommonEntitiesI18nObject | null
|
||||
help?: ProviderHelpEntity | null
|
||||
icon_small?: GraphonModelRuntimeEntitiesCommonEntitiesI18nObject | null
|
||||
icon_small_dark?: GraphonModelRuntimeEntitiesCommonEntitiesI18nObject | null
|
||||
label: GraphonModelRuntimeEntitiesCommonEntitiesI18nObject
|
||||
model_credential_schema?: ModelCredentialSchema | null
|
||||
models?: Array<AiModelEntity>
|
||||
position?: {
|
||||
[key: string]: Array<string>
|
||||
} | null
|
||||
provider: string
|
||||
provider_credential_schema?: ProviderCredentialSchema | null
|
||||
provider_name?: string
|
||||
supported_model_types: Array<ModelType>
|
||||
}
|
||||
|
||||
export type Plugins = {
|
||||
datasources?: Array<string> | null
|
||||
endpoints?: Array<string> | null
|
||||
models?: Array<string> | null
|
||||
tools?: Array<string> | null
|
||||
triggers?: Array<string> | null
|
||||
}
|
||||
|
||||
export type PluginResourceRequirements = {
|
||||
memory: number
|
||||
permission?: Permission | null
|
||||
}
|
||||
|
||||
export type ToolProviderEntity = {
|
||||
credentials_schema?: Array<ProviderConfig>
|
||||
identity: ToolProviderIdentity
|
||||
oauth_schema?: OAuthSchema | null
|
||||
plugin_id?: string | null
|
||||
}
|
||||
|
||||
export type TriggerProviderEntity = {
|
||||
events?: Array<EventEntity>
|
||||
identity: TriggerProviderIdentity
|
||||
subscription_constructor?: SubscriptionConstructor | null
|
||||
subscription_schema?: Array<ProviderConfig>
|
||||
}
|
||||
|
||||
export type PluginInstallTaskPluginStatus = {
|
||||
icon: string
|
||||
labels: I18nObject
|
||||
message: string
|
||||
plugin_id: string
|
||||
plugin_unique_identifier: string
|
||||
source?: string | null
|
||||
status: PluginInstallTaskStatus
|
||||
}
|
||||
|
||||
export type PluginInstallTaskStatus = 'failed' | 'pending' | 'running' | 'success'
|
||||
|
||||
export type PluginInstallationSource = 'github' | 'marketplace' | 'package' | 'remote'
|
||||
|
||||
export type PluginDeclarationResponse = {
|
||||
agent_strategy?: {
|
||||
[key: string]: unknown
|
||||
@@ -1718,14 +1902,9 @@ export type PluginDeclarationResponse = {
|
||||
version: string
|
||||
}
|
||||
|
||||
export type PluginInstallationSource = 'github' | 'marketplace' | 'package' | 'remote'
|
||||
export type PluginBundleDependencyType = 'github' | 'marketplace' | 'package'
|
||||
|
||||
export type CoreToolsEntitiesCommonEntitiesI18nObject = {
|
||||
en_US: string
|
||||
ja_JP?: string | null
|
||||
pt_BR?: string | null
|
||||
zh_Hans?: string | null
|
||||
}
|
||||
export type AuthorizedCategory = 'community' | 'langgenius' | 'partner'
|
||||
|
||||
export type PluginCategoryBuiltinToolResponse = {
|
||||
author: string
|
||||
@@ -1928,13 +2107,87 @@ export type QuotaConfiguration = {
|
||||
restrict_models?: Array<RestrictModel>
|
||||
}
|
||||
|
||||
export type PluginCategory
|
||||
= | 'agent-strategy'
|
||||
| 'datasource'
|
||||
| 'extension'
|
||||
| 'model'
|
||||
| 'tool'
|
||||
| 'trigger'
|
||||
export type AgentStrategyProviderIdentity = {
|
||||
author: string
|
||||
description: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
icon: string
|
||||
icon_dark?: string | null
|
||||
label: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
name: string
|
||||
tags?: Array<ToolLabelEnum> | null
|
||||
}
|
||||
|
||||
export type DatasourceProviderIdentity = {
|
||||
author: string
|
||||
description: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
icon: string
|
||||
label: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
name: string
|
||||
tags?: Array<ToolLabelEnum> | null
|
||||
}
|
||||
|
||||
export type DatasourceProviderType
|
||||
= | 'local_file'
|
||||
| 'online_document'
|
||||
| 'online_drive'
|
||||
| 'website_crawl'
|
||||
|
||||
export type EndpointDeclaration = {
|
||||
hidden?: boolean
|
||||
method: string
|
||||
path: string
|
||||
}
|
||||
|
||||
export type AiModelEntity = {
|
||||
deprecated?: boolean
|
||||
features?: Array<ModelFeature> | null
|
||||
fetch_from: FetchFrom
|
||||
label: GraphonModelRuntimeEntitiesCommonEntitiesI18nObject
|
||||
model: string
|
||||
model_properties: {
|
||||
[key in ModelPropertyKey]?: unknown
|
||||
}
|
||||
model_type: ModelType
|
||||
parameter_rules?: Array<ParameterRule>
|
||||
pricing?: PriceConfig | null
|
||||
}
|
||||
|
||||
export type Permission = {
|
||||
endpoint?: Endpoint | null
|
||||
model?: Model | null
|
||||
node?: Node | null
|
||||
storage?: Storage | null
|
||||
tool?: Tool | null
|
||||
}
|
||||
|
||||
export type ToolProviderIdentity = {
|
||||
author: string
|
||||
description: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
icon: string
|
||||
icon_dark?: string | null
|
||||
label: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
name: string
|
||||
tags?: Array<ToolLabelEnum> | null
|
||||
}
|
||||
|
||||
export type EventEntity = {
|
||||
description: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
identity: EventIdentity
|
||||
output_schema?: {
|
||||
[key: string]: unknown
|
||||
} | null
|
||||
parameters?: Array<EventParameter>
|
||||
}
|
||||
|
||||
export type TriggerProviderIdentity = {
|
||||
author: string
|
||||
description: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
icon?: string | null
|
||||
icon_dark?: string | null
|
||||
label: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
name: string
|
||||
tags?: Array<string>
|
||||
}
|
||||
|
||||
export type ProviderEntityResponse = {
|
||||
background?: string | null
|
||||
@@ -1959,12 +2212,6 @@ export type PluginParameterAutoGenerate = {
|
||||
type: PluginParameterAutoGenerateType
|
||||
}
|
||||
|
||||
export type PluginParameterOption = {
|
||||
icon?: string | null
|
||||
label: I18nObject
|
||||
value: string
|
||||
}
|
||||
|
||||
export type PluginParameterTemplate = {
|
||||
enabled?: boolean
|
||||
}
|
||||
@@ -2055,6 +2302,59 @@ export type RestrictModel = {
|
||||
model_type: ModelType
|
||||
}
|
||||
|
||||
export type ToolLabelEnum
|
||||
= | 'business'
|
||||
| 'design'
|
||||
| 'education'
|
||||
| 'entertainment'
|
||||
| 'finance'
|
||||
| 'image'
|
||||
| 'medical'
|
||||
| 'news'
|
||||
| 'other'
|
||||
| 'productivity'
|
||||
| 'rag'
|
||||
| 'search'
|
||||
| 'social'
|
||||
| 'travel'
|
||||
| 'utilities'
|
||||
| 'videos'
|
||||
| 'weather'
|
||||
|
||||
export type PriceConfig = {
|
||||
currency: string
|
||||
input: string
|
||||
output?: string | null
|
||||
unit: string
|
||||
}
|
||||
|
||||
export type Endpoint = {
|
||||
enabled?: boolean | null
|
||||
}
|
||||
|
||||
export type Model = {
|
||||
enabled?: boolean | null
|
||||
llm?: boolean | null
|
||||
moderation?: boolean | null
|
||||
rerank?: boolean | null
|
||||
speech2text?: boolean | null
|
||||
text_embedding?: boolean | null
|
||||
tts?: boolean | null
|
||||
}
|
||||
|
||||
export type Node = {
|
||||
enabled?: boolean | null
|
||||
}
|
||||
|
||||
export type Storage = {
|
||||
enabled?: boolean | null
|
||||
size?: number
|
||||
}
|
||||
|
||||
export type Tool = {
|
||||
enabled?: boolean | null
|
||||
}
|
||||
|
||||
export type PluginParameterAutoGenerateType = 'prompt_instruction'
|
||||
|
||||
export type AccountWithRoleListResponseWritable = {
|
||||
@@ -2725,7 +3025,7 @@ export type GetWorkspacesCurrentModelProvidersByProviderCredentialsData = {
|
||||
}
|
||||
|
||||
export type GetWorkspacesCurrentModelProvidersByProviderCredentialsResponses = {
|
||||
200: ProviderCredentialResponse
|
||||
200: ProviderCredentialsResponse
|
||||
}
|
||||
|
||||
export type GetWorkspacesCurrentModelProvidersByProviderCredentialsResponse
|
||||
@@ -2789,7 +3089,7 @@ export type PostWorkspacesCurrentModelProvidersByProviderCredentialsValidateData
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentModelProvidersByProviderCredentialsValidateResponses = {
|
||||
200: ProviderCredentialValidateResponse
|
||||
200: ValidationResultResponse
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentModelProvidersByProviderCredentialsValidateResponse
|
||||
@@ -2821,7 +3121,7 @@ export type GetWorkspacesCurrentModelProvidersByProviderModelsData = {
|
||||
}
|
||||
|
||||
export type GetWorkspacesCurrentModelProvidersByProviderModelsResponses = {
|
||||
200: ModelWithProviderListResponse
|
||||
200: ProviderModelListResponse
|
||||
}
|
||||
|
||||
export type GetWorkspacesCurrentModelProvidersByProviderModelsResponse
|
||||
@@ -2938,7 +3238,7 @@ export type PostWorkspacesCurrentModelProvidersByProviderModelsCredentialsValida
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentModelProvidersByProviderModelsCredentialsValidateResponses = {
|
||||
200: ModelCredentialValidateResponse
|
||||
200: ValidationResultResponse
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentModelProvidersByProviderModelsCredentialsValidateResponse
|
||||
@@ -3025,7 +3325,7 @@ export type GetWorkspacesCurrentModelProvidersByProviderModelsParameterRulesData
|
||||
}
|
||||
|
||||
export type GetWorkspacesCurrentModelProvidersByProviderModelsParameterRulesResponses = {
|
||||
200: ModelParameterRulesResponse
|
||||
200: ModelParameterRuleListResponse
|
||||
}
|
||||
|
||||
export type GetWorkspacesCurrentModelProvidersByProviderModelsParameterRulesResponse
|
||||
@@ -3057,7 +3357,7 @@ export type GetWorkspacesCurrentModelsModelTypesByModelTypeData = {
|
||||
}
|
||||
|
||||
export type GetWorkspacesCurrentModelsModelTypesByModelTypeResponses = {
|
||||
200: ProviderWithModelsDataResponse
|
||||
200: AvailableModelListResponse
|
||||
}
|
||||
|
||||
export type GetWorkspacesCurrentModelsModelTypesByModelTypeResponse
|
||||
@@ -3193,7 +3493,7 @@ export type PostWorkspacesCurrentPluginInstallGithubData = {
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginInstallGithubResponses = {
|
||||
200: PluginDaemonOperationResponse
|
||||
200: PluginInstallTaskStartResponse
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginInstallGithubResponse
|
||||
@@ -3207,7 +3507,7 @@ export type PostWorkspacesCurrentPluginInstallMarketplaceData = {
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginInstallMarketplaceResponses = {
|
||||
200: PluginDaemonOperationResponse
|
||||
200: PluginInstallTaskStartResponse
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginInstallMarketplaceResponse
|
||||
@@ -3221,7 +3521,7 @@ export type PostWorkspacesCurrentPluginInstallPkgData = {
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginInstallPkgResponses = {
|
||||
200: PluginDaemonOperationResponse
|
||||
200: PluginInstallTaskStartResponse
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginInstallPkgResponse
|
||||
@@ -3470,7 +3770,7 @@ export type PostWorkspacesCurrentPluginUpgradeGithubData = {
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginUpgradeGithubResponses = {
|
||||
200: PluginDaemonOperationResponse
|
||||
200: PluginInstallTaskStartResponse
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginUpgradeGithubResponse
|
||||
@@ -3484,7 +3784,7 @@ export type PostWorkspacesCurrentPluginUpgradeMarketplaceData = {
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginUpgradeMarketplaceResponses = {
|
||||
200: PluginDaemonOperationResponse
|
||||
200: PluginInstallTaskStartResponse
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginUpgradeMarketplaceResponse
|
||||
@@ -3498,7 +3798,7 @@ export type PostWorkspacesCurrentPluginUploadBundleData = {
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginUploadBundleResponses = {
|
||||
200: PluginDaemonOperationResponse
|
||||
200: PluginBundleUploadResponse
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginUploadBundleResponse
|
||||
@@ -3512,7 +3812,7 @@ export type PostWorkspacesCurrentPluginUploadGithubData = {
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginUploadGithubResponses = {
|
||||
200: PluginDaemonOperationResponse
|
||||
200: PluginDecodeResponse
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginUploadGithubResponse
|
||||
@@ -3526,7 +3826,7 @@ export type PostWorkspacesCurrentPluginUploadPkgData = {
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginUploadPkgResponses = {
|
||||
200: PluginDaemonOperationResponse
|
||||
200: PluginDecodeResponse
|
||||
}
|
||||
|
||||
export type PostWorkspacesCurrentPluginUploadPkgResponse
|
||||
@@ -5246,7 +5546,9 @@ export type GetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangData
|
||||
}
|
||||
|
||||
export type GetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangResponses = {
|
||||
200: BinaryFileResponse
|
||||
200: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type GetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangResponse
|
||||
|
||||
@@ -164,9 +164,9 @@ export const zParserCredentialDelete = z.object({
|
||||
})
|
||||
|
||||
/**
|
||||
* ProviderCredentialResponse
|
||||
* ProviderCredentialsResponse
|
||||
*/
|
||||
export const zProviderCredentialResponse = z.object({
|
||||
export const zProviderCredentialsResponse = z.object({
|
||||
credentials: z.record(z.string(), z.unknown()).nullish(),
|
||||
})
|
||||
|
||||
@@ -202,21 +202,13 @@ export const zParserCredentialValidate = z.object({
|
||||
})
|
||||
|
||||
/**
|
||||
* ProviderCredentialValidateResponse
|
||||
* ValidationResultResponse
|
||||
*/
|
||||
export const zProviderCredentialValidateResponse = z.object({
|
||||
export const zValidationResultResponse = z.object({
|
||||
error: z.string().nullish(),
|
||||
result: z.enum(['error', 'success']),
|
||||
})
|
||||
|
||||
/**
|
||||
* ModelCredentialValidateResponse
|
||||
*/
|
||||
export const zModelCredentialValidateResponse = z.object({
|
||||
error: z.string().nullish(),
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* LoadBalancingCredentialValidateResponse
|
||||
*/
|
||||
@@ -263,13 +255,6 @@ export const zPluginDebuggingKeyResponse = z.object({
|
||||
port: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginManifestResponse
|
||||
*/
|
||||
export const zPluginManifestResponse = z.object({
|
||||
manifest: z.unknown(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ParserGithubInstall
|
||||
*/
|
||||
@@ -280,11 +265,6 @@ export const zParserGithubInstall = z.object({
|
||||
version: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginDaemonOperationResponse
|
||||
*/
|
||||
export const zPluginDaemonOperationResponse = z.unknown()
|
||||
|
||||
/**
|
||||
* ParserPluginIdentifiers
|
||||
*/
|
||||
@@ -292,14 +272,6 @@ export const zParserPluginIdentifiers = z.object({
|
||||
plugin_unique_identifiers: z.array(z.string()),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginListResponse
|
||||
*/
|
||||
export const zPluginListResponse = z.object({
|
||||
plugins: z.unknown(),
|
||||
total: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ParserLatest
|
||||
*/
|
||||
@@ -307,13 +279,6 @@ export const zParserLatest = z.object({
|
||||
plugin_ids: z.array(z.string()),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginDynamicOptionsResponse
|
||||
*/
|
||||
export const zPluginDynamicOptionsResponse = z.object({
|
||||
options: z.unknown(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ParserDynamicOptionsWithCredentials
|
||||
*/
|
||||
@@ -333,20 +298,6 @@ export const zPluginReadmeResponse = z.object({
|
||||
readme: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginTasksResponse
|
||||
*/
|
||||
export const zPluginTasksResponse = z.object({
|
||||
tasks: z.unknown(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginTaskResponse
|
||||
*/
|
||||
export const zPluginTaskResponse = z.object({
|
||||
task: z.unknown(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ParserUninstall
|
||||
*/
|
||||
@@ -1006,25 +957,6 @@ export const zCredentialConfiguration = z.object({
|
||||
credential_name: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ModelCredentialLoadBalancingResponse
|
||||
*/
|
||||
export const zModelCredentialLoadBalancingResponse = z.object({
|
||||
configs: z.array(z.record(z.string(), z.unknown())).optional(),
|
||||
enabled: z.boolean(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ModelCredentialResponse
|
||||
*/
|
||||
export const zModelCredentialResponse = z.object({
|
||||
available_credentials: z.array(zCredentialConfiguration),
|
||||
credentials: z.record(z.string(), z.unknown()).optional(),
|
||||
current_credential_id: z.string().nullish(),
|
||||
current_credential_name: z.string().nullish(),
|
||||
load_balancing: zModelCredentialLoadBalancingResponse,
|
||||
})
|
||||
|
||||
/**
|
||||
* TenantPluginAutoUpgradeCategory
|
||||
*/
|
||||
@@ -1428,6 +1360,22 @@ export const zI18nObject = z.object({
|
||||
zh_Hans: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginParameterOption
|
||||
*/
|
||||
export const zPluginParameterOption = z.object({
|
||||
icon: z.string().nullish(),
|
||||
label: zI18nObject,
|
||||
value: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginDynamicOptionsResponse
|
||||
*/
|
||||
export const zPluginDynamicOptionsResponse = z.object({
|
||||
options: z.array(zPluginParameterOption),
|
||||
})
|
||||
|
||||
/**
|
||||
* ToolLabel
|
||||
*
|
||||
@@ -1661,6 +1609,38 @@ export const zModelStatus = z.enum([
|
||||
'quota-exceeded',
|
||||
])
|
||||
|
||||
/**
|
||||
* ModelLoadBalancingConfigResponse
|
||||
*/
|
||||
export const zModelLoadBalancingConfigResponse = z.object({
|
||||
credential_id: z.string().nullish(),
|
||||
credentials: z.record(z.string(), z.unknown()),
|
||||
enabled: z.boolean(),
|
||||
id: z.string(),
|
||||
in_cooldown: z.boolean(),
|
||||
name: z.string(),
|
||||
ttl: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ModelLoadBalancingResponse
|
||||
*/
|
||||
export const zModelLoadBalancingResponse = z.object({
|
||||
configs: z.array(zModelLoadBalancingConfigResponse),
|
||||
enabled: z.boolean(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ModelCredentialResponse
|
||||
*/
|
||||
export const zModelCredentialResponse = z.object({
|
||||
available_credentials: z.array(zCredentialConfiguration),
|
||||
credentials: z.record(z.string(), z.unknown()),
|
||||
current_credential_id: z.string().nullish(),
|
||||
current_credential_name: z.string().nullish(),
|
||||
load_balancing: zModelLoadBalancingResponse,
|
||||
})
|
||||
|
||||
/**
|
||||
* I18nObject
|
||||
*
|
||||
@@ -1708,9 +1688,9 @@ export const zParameterRule = z.object({
|
||||
})
|
||||
|
||||
/**
|
||||
* ModelParameterRulesResponse
|
||||
* ModelParameterRuleListResponse
|
||||
*/
|
||||
export const zModelParameterRulesResponse = z.object({
|
||||
export const zModelParameterRuleListResponse = z.object({
|
||||
data: z.array(zParameterRule),
|
||||
})
|
||||
|
||||
@@ -1755,9 +1735,9 @@ export const zProviderWithModelsResponse = z.object({
|
||||
})
|
||||
|
||||
/**
|
||||
* ProviderWithModelsDataResponse
|
||||
* AvailableModelListResponse
|
||||
*/
|
||||
export const zProviderWithModelsDataResponse = z.object({
|
||||
export const zAvailableModelListResponse = z.object({
|
||||
data: z.array(zProviderWithModelsResponse),
|
||||
})
|
||||
|
||||
@@ -1810,9 +1790,16 @@ export const zPluginAutoUpgradeFetchResponse = z.object({
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginInstallationSource
|
||||
* PluginCategory
|
||||
*/
|
||||
export const zPluginInstallationSource = z.enum(['github', 'marketplace', 'package', 'remote'])
|
||||
export const zPluginCategory = z.enum([
|
||||
'agent-strategy',
|
||||
'datasource',
|
||||
'extension',
|
||||
'model',
|
||||
'tool',
|
||||
'trigger',
|
||||
])
|
||||
|
||||
/**
|
||||
* I18nObject
|
||||
@@ -1826,6 +1813,116 @@ export const zCoreToolsEntitiesCommonEntitiesI18nObject = z.object({
|
||||
zh_Hans: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Meta
|
||||
*/
|
||||
export const zMeta = z.object({
|
||||
minimum_dify_version: z.string().nullish(),
|
||||
version: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Plugins
|
||||
*/
|
||||
export const zPlugins = z.object({
|
||||
datasources: z.array(z.string()).nullish(),
|
||||
endpoints: z.array(z.string()).nullish(),
|
||||
models: z.array(z.string()).nullish(),
|
||||
tools: z.array(z.string()).nullish(),
|
||||
triggers: z.array(z.string()).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginInstallTaskStatus
|
||||
*/
|
||||
export const zPluginInstallTaskStatus = z.enum(['failed', 'pending', 'running', 'success'])
|
||||
|
||||
/**
|
||||
* PluginInstallTaskPluginStatus
|
||||
*/
|
||||
export const zPluginInstallTaskPluginStatus = z.object({
|
||||
icon: z.string(),
|
||||
labels: zI18nObject,
|
||||
message: z.string(),
|
||||
plugin_id: z.string(),
|
||||
plugin_unique_identifier: z.string(),
|
||||
source: z.string().nullish(),
|
||||
status: zPluginInstallTaskStatus,
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginInstallTask
|
||||
*/
|
||||
export const zPluginInstallTask = z.object({
|
||||
completed_plugins: z.int(),
|
||||
created_at: z.iso.datetime(),
|
||||
id: z.string(),
|
||||
plugins: z.array(zPluginInstallTaskPluginStatus),
|
||||
status: zPluginInstallTaskStatus,
|
||||
total_plugins: z.int(),
|
||||
updated_at: z.iso.datetime(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginInstallTaskStartResponse
|
||||
*/
|
||||
export const zPluginInstallTaskStartResponse = z.object({
|
||||
all_installed: z.boolean(),
|
||||
task: zPluginInstallTask.nullish(),
|
||||
task_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginTasksResponse
|
||||
*/
|
||||
export const zPluginTasksResponse = z.object({
|
||||
tasks: z.array(zPluginInstallTask),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginTaskResponse
|
||||
*/
|
||||
export const zPluginTaskResponse = z.object({
|
||||
task: zPluginInstallTask,
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginInstallationSource
|
||||
*/
|
||||
export const zPluginInstallationSource = z.enum(['github', 'marketplace', 'package', 'remote'])
|
||||
|
||||
/**
|
||||
* PluginBundleDependencyType
|
||||
*/
|
||||
export const zPluginBundleDependencyType = z.enum(['github', 'marketplace', 'package'])
|
||||
|
||||
/**
|
||||
* PluginBundleDependency
|
||||
*/
|
||||
export const zPluginBundleDependency = z.object({
|
||||
type: zPluginBundleDependencyType,
|
||||
value: z.union([zGithub, zMarketplace, zPackage]),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginBundleUploadResponse
|
||||
*/
|
||||
export const zPluginBundleUploadResponse = z.array(zPluginBundleDependency)
|
||||
|
||||
/**
|
||||
* AuthorizedCategory
|
||||
*/
|
||||
export const zAuthorizedCategory = z.enum(['community', 'langgenius', 'partner'])
|
||||
|
||||
/**
|
||||
* PluginVerification
|
||||
*
|
||||
* Verification of the plugin.
|
||||
*/
|
||||
export const zPluginVerification = z.object({
|
||||
authorized_category: zAuthorizedCategory,
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginCategoryBuiltinToolResponse
|
||||
*/
|
||||
@@ -2158,24 +2255,51 @@ export const zFieldModelSchema = z.object({
|
||||
export const zProviderQuotaType = z.enum(['free', 'paid', 'trial'])
|
||||
|
||||
/**
|
||||
* PluginCategory
|
||||
* DatasourceProviderType
|
||||
*
|
||||
* Enum class for datasource provider
|
||||
*/
|
||||
export const zPluginCategory = z.enum([
|
||||
'agent-strategy',
|
||||
'datasource',
|
||||
'extension',
|
||||
'model',
|
||||
'tool',
|
||||
'trigger',
|
||||
export const zDatasourceProviderType = z.enum([
|
||||
'local_file',
|
||||
'online_document',
|
||||
'online_drive',
|
||||
'website_crawl',
|
||||
])
|
||||
|
||||
/**
|
||||
* PluginParameterOption
|
||||
* EndpointDeclaration
|
||||
*
|
||||
* declaration of an endpoint
|
||||
*/
|
||||
export const zPluginParameterOption = z.object({
|
||||
export const zEndpointDeclaration = z.object({
|
||||
hidden: z.boolean().optional().default(false),
|
||||
method: z.string(),
|
||||
path: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* EndpointProviderDeclaration
|
||||
*
|
||||
* declaration of an endpoint group
|
||||
*/
|
||||
export const zEndpointProviderDeclaration = z.object({
|
||||
endpoints: z.array(zEndpointDeclaration).nullish(),
|
||||
settings: z.array(zProviderConfig).optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* TriggerProviderIdentity
|
||||
*
|
||||
* The identity of the trigger provider
|
||||
*/
|
||||
export const zTriggerProviderIdentity = z.object({
|
||||
author: z.string(),
|
||||
description: zCoreToolsEntitiesCommonEntitiesI18nObject,
|
||||
icon: z.string().nullish(),
|
||||
label: zI18nObject,
|
||||
value: z.string(),
|
||||
icon_dark: z.string().nullish(),
|
||||
label: zCoreToolsEntitiesCommonEntitiesI18nObject,
|
||||
name: z.string(),
|
||||
tags: z.array(z.string()).optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -2312,9 +2436,9 @@ export const zModelWithProviderEntityResponse = z.object({
|
||||
})
|
||||
|
||||
/**
|
||||
* ModelWithProviderListResponse
|
||||
* ProviderModelListResponse
|
||||
*/
|
||||
export const zModelWithProviderListResponse = z.object({
|
||||
export const zProviderModelListResponse = z.object({
|
||||
data: z.array(zModelWithProviderEntityResponse),
|
||||
})
|
||||
|
||||
@@ -2645,6 +2769,218 @@ export const zModelProviderListResponse = z.object({
|
||||
data: z.array(zProviderResponse),
|
||||
})
|
||||
|
||||
/**
|
||||
* ToolLabelEnum
|
||||
*/
|
||||
export const zToolLabelEnum = z.enum([
|
||||
'business',
|
||||
'design',
|
||||
'education',
|
||||
'entertainment',
|
||||
'finance',
|
||||
'image',
|
||||
'medical',
|
||||
'news',
|
||||
'other',
|
||||
'productivity',
|
||||
'rag',
|
||||
'search',
|
||||
'social',
|
||||
'travel',
|
||||
'utilities',
|
||||
'videos',
|
||||
'weather',
|
||||
])
|
||||
|
||||
/**
|
||||
* AgentStrategyProviderIdentity
|
||||
*
|
||||
* Inherits from ToolProviderIdentity, without any additional fields.
|
||||
*/
|
||||
export const zAgentStrategyProviderIdentity = z.object({
|
||||
author: z.string(),
|
||||
description: zCoreToolsEntitiesCommonEntitiesI18nObject,
|
||||
icon: z.string(),
|
||||
icon_dark: z.string().nullish(),
|
||||
label: zCoreToolsEntitiesCommonEntitiesI18nObject,
|
||||
name: z.string(),
|
||||
tags: z.array(zToolLabelEnum).nullish().default([]),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentStrategyProviderEntity
|
||||
*/
|
||||
export const zAgentStrategyProviderEntity = z.object({
|
||||
identity: zAgentStrategyProviderIdentity,
|
||||
plugin_id: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasourceProviderIdentity
|
||||
*/
|
||||
export const zDatasourceProviderIdentity = z.object({
|
||||
author: z.string(),
|
||||
description: zCoreToolsEntitiesCommonEntitiesI18nObject,
|
||||
icon: z.string(),
|
||||
label: zCoreToolsEntitiesCommonEntitiesI18nObject,
|
||||
name: z.string(),
|
||||
tags: z.array(zToolLabelEnum).nullish().default([]),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasourceProviderEntity
|
||||
*
|
||||
* Datasource provider entity
|
||||
*/
|
||||
export const zDatasourceProviderEntity = z.object({
|
||||
credentials_schema: z.array(zProviderConfig).optional(),
|
||||
identity: zDatasourceProviderIdentity,
|
||||
oauth_schema: zOAuthSchema.nullish(),
|
||||
provider_type: zDatasourceProviderType,
|
||||
})
|
||||
|
||||
/**
|
||||
* ToolProviderIdentity
|
||||
*/
|
||||
export const zToolProviderIdentity = z.object({
|
||||
author: z.string(),
|
||||
description: zCoreToolsEntitiesCommonEntitiesI18nObject,
|
||||
icon: z.string(),
|
||||
icon_dark: z.string().nullish(),
|
||||
label: zCoreToolsEntitiesCommonEntitiesI18nObject,
|
||||
name: z.string(),
|
||||
tags: z.array(zToolLabelEnum).nullish().default([]),
|
||||
})
|
||||
|
||||
/**
|
||||
* ToolProviderEntity
|
||||
*/
|
||||
export const zToolProviderEntity = z.object({
|
||||
credentials_schema: z.array(zProviderConfig).optional(),
|
||||
identity: zToolProviderIdentity,
|
||||
oauth_schema: zOAuthSchema.nullish(),
|
||||
plugin_id: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PriceConfig
|
||||
*
|
||||
* Model class for pricing info.
|
||||
*/
|
||||
export const zPriceConfig = z.object({
|
||||
currency: z.string(),
|
||||
input: z.string().regex(/^(?![-+.]*$)[+-]?\d*(?:\.\d*)?$/),
|
||||
output: z
|
||||
.string()
|
||||
.regex(/^(?![-+.]*$)[+-]?\d*(?:\.\d*)?$/)
|
||||
.nullish(),
|
||||
unit: z.string().regex(/^(?![-+.]*$)[+-]?\d*(?:\.\d*)?$/),
|
||||
})
|
||||
|
||||
/**
|
||||
* AIModelEntity
|
||||
*
|
||||
* Model class for AI model.
|
||||
*/
|
||||
export const zAiModelEntity = z.object({
|
||||
deprecated: z.boolean().optional().default(false),
|
||||
features: z.array(zModelFeature).nullish(),
|
||||
fetch_from: zFetchFrom,
|
||||
label: zGraphonModelRuntimeEntitiesCommonEntitiesI18nObject,
|
||||
model: z.string(),
|
||||
model_properties: z.record(z.string(), z.unknown()),
|
||||
model_type: zModelType,
|
||||
parameter_rules: z.array(zParameterRule).optional().default([]),
|
||||
pricing: zPriceConfig.nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ProviderEntity
|
||||
*
|
||||
* Runtime-native provider schema.
|
||||
*
|
||||
* `provider` is the canonical runtime identifier. `provider_name` is a
|
||||
* compatibility alias for callers that still resolve providers by short name and
|
||||
* is empty when no alias exists.
|
||||
*/
|
||||
export const zProviderEntity = z.object({
|
||||
background: z.string().nullish(),
|
||||
configurate_methods: z.array(zConfigurateMethod),
|
||||
description: zGraphonModelRuntimeEntitiesCommonEntitiesI18nObject.nullish(),
|
||||
help: zProviderHelpEntity.nullish(),
|
||||
icon_small: zGraphonModelRuntimeEntitiesCommonEntitiesI18nObject.nullish(),
|
||||
icon_small_dark: zGraphonModelRuntimeEntitiesCommonEntitiesI18nObject.nullish(),
|
||||
label: zGraphonModelRuntimeEntitiesCommonEntitiesI18nObject,
|
||||
model_credential_schema: zModelCredentialSchema.nullish(),
|
||||
models: z.array(zAiModelEntity).optional(),
|
||||
position: z.record(z.string(), z.array(z.string())).nullish().default({}),
|
||||
provider: z.string(),
|
||||
provider_credential_schema: zProviderCredentialSchema.nullish(),
|
||||
provider_name: z.string().optional().default(''),
|
||||
supported_model_types: z.array(zModelType),
|
||||
})
|
||||
|
||||
/**
|
||||
* Endpoint
|
||||
*/
|
||||
export const zEndpoint = z.object({
|
||||
enabled: z.boolean().nullish().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
* Model
|
||||
*/
|
||||
export const zModel = z.object({
|
||||
enabled: z.boolean().nullish().default(false),
|
||||
llm: z.boolean().nullish().default(false),
|
||||
moderation: z.boolean().nullish().default(false),
|
||||
rerank: z.boolean().nullish().default(false),
|
||||
speech2text: z.boolean().nullish().default(false),
|
||||
text_embedding: z.boolean().nullish().default(false),
|
||||
tts: z.boolean().nullish().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
* Node
|
||||
*/
|
||||
export const zNode = z.object({
|
||||
enabled: z.boolean().nullish().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
* Storage
|
||||
*/
|
||||
export const zStorage = z.object({
|
||||
enabled: z.boolean().nullish().default(false),
|
||||
size: z.int().gte(1024).lte(1073741824).optional().default(1048576),
|
||||
})
|
||||
|
||||
/**
|
||||
* Tool
|
||||
*/
|
||||
export const zTool = z.object({
|
||||
enabled: z.boolean().nullish().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
* Permission
|
||||
*/
|
||||
export const zPermission = z.object({
|
||||
endpoint: zEndpoint.nullish(),
|
||||
model: zModel.nullish(),
|
||||
node: zNode.nullish(),
|
||||
storage: zStorage.nullish(),
|
||||
tool: zTool.nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginResourceRequirements
|
||||
*/
|
||||
export const zPluginResourceRequirements = z.object({
|
||||
memory: z.int(),
|
||||
permission: zPermission.nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginParameterAutoGenerateType
|
||||
*/
|
||||
@@ -2876,6 +3212,106 @@ export const zTriggerProviderApiEntity = z.object({
|
||||
*/
|
||||
export const zTriggerProviderListResponse = z.array(zTriggerProviderApiEntity)
|
||||
|
||||
/**
|
||||
* EventEntity
|
||||
*
|
||||
* The configuration of an event
|
||||
*/
|
||||
export const zEventEntity = z.object({
|
||||
description: zCoreToolsEntitiesCommonEntitiesI18nObject,
|
||||
identity: zEventIdentity,
|
||||
output_schema: z.record(z.string(), z.unknown()).nullish(),
|
||||
parameters: z.array(zEventParameter).optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* TriggerProviderEntity
|
||||
*
|
||||
* The configuration of a trigger provider
|
||||
*/
|
||||
export const zTriggerProviderEntity = z.object({
|
||||
events: z.array(zEventEntity).optional(),
|
||||
identity: zTriggerProviderIdentity,
|
||||
subscription_constructor: zSubscriptionConstructor.nullish(),
|
||||
subscription_schema: z.array(zProviderConfig).optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginDeclaration
|
||||
*/
|
||||
export const zPluginDeclaration = z.object({
|
||||
agent_strategy: zAgentStrategyProviderEntity.nullish(),
|
||||
author: z
|
||||
.string()
|
||||
.regex(/^[\w-]{1,64}$/)
|
||||
.nullable(),
|
||||
category: zPluginCategory,
|
||||
created_at: z.iso.datetime(),
|
||||
datasource: zDatasourceProviderEntity.nullish(),
|
||||
description: zCoreToolsEntitiesCommonEntitiesI18nObject,
|
||||
endpoint: zEndpointProviderDeclaration.nullish(),
|
||||
icon: z.string(),
|
||||
icon_dark: z.string().nullish(),
|
||||
label: zCoreToolsEntitiesCommonEntitiesI18nObject,
|
||||
meta: zMeta,
|
||||
model: zProviderEntity.nullish(),
|
||||
name: z.string().regex(/^[a-z0-9_-]{1,128}$/),
|
||||
plugins: zPlugins,
|
||||
repo: z.string().nullish(),
|
||||
resource: zPluginResourceRequirements,
|
||||
tags: z.array(z.string()).optional(),
|
||||
tool: zToolProviderEntity.nullish(),
|
||||
trigger: zTriggerProviderEntity.nullish(),
|
||||
verified: z.boolean().optional().default(false),
|
||||
version: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginManifestResponse
|
||||
*/
|
||||
export const zPluginManifestResponse = z.object({
|
||||
manifest: zPluginDeclaration,
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginDecodeResponse
|
||||
*/
|
||||
export const zPluginDecodeResponse = z.object({
|
||||
manifest: zPluginDeclaration,
|
||||
unique_identifier: z.string(),
|
||||
verification: zPluginVerification.nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginEntity
|
||||
*/
|
||||
export const zPluginEntity = z.object({
|
||||
checksum: z.string(),
|
||||
created_at: z.iso.datetime(),
|
||||
declaration: zPluginDeclaration,
|
||||
endpoints_active: z.int(),
|
||||
endpoints_setups: z.int(),
|
||||
id: z.string(),
|
||||
installation_id: z.string(),
|
||||
meta: z.record(z.string(), z.unknown()),
|
||||
name: z.string(),
|
||||
plugin_id: z.string(),
|
||||
plugin_unique_identifier: z.string(),
|
||||
runtime_type: z.string(),
|
||||
source: zPluginInstallationSource,
|
||||
tenant_id: z.string(),
|
||||
updated_at: z.iso.datetime(),
|
||||
version: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginListResponse
|
||||
*/
|
||||
export const zPluginListResponse = z.object({
|
||||
plugins: z.array(zPluginEntity),
|
||||
total: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AccountWithRoleResponse
|
||||
*/
|
||||
@@ -3033,7 +3469,7 @@ export const zGetWorkspacesCurrentDefaultModelQuery = z.object({
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Default model retrieved successfully
|
||||
*/
|
||||
export const zGetWorkspacesCurrentDefaultModelResponse = zDefaultModelDataResponse
|
||||
|
||||
@@ -3193,7 +3629,7 @@ export const zGetWorkspacesCurrentModelProvidersQuery = z.object({
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Model providers retrieved successfully
|
||||
*/
|
||||
export const zGetWorkspacesCurrentModelProvidersResponse = zModelProviderListResponse
|
||||
|
||||
@@ -3202,7 +3638,7 @@ export const zGetWorkspacesCurrentModelProvidersByProviderCheckoutUrlPath = z.ob
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Model provider checkout URL retrieved successfully
|
||||
*/
|
||||
export const zGetWorkspacesCurrentModelProvidersByProviderCheckoutUrlResponse
|
||||
= zModelProviderPaymentCheckoutUrlResponse
|
||||
@@ -3228,10 +3664,10 @@ export const zGetWorkspacesCurrentModelProvidersByProviderCredentialsQuery = z.o
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Provider credentials retrieved successfully
|
||||
*/
|
||||
export const zGetWorkspacesCurrentModelProvidersByProviderCredentialsResponse
|
||||
= zProviderCredentialResponse
|
||||
= zProviderCredentialsResponse
|
||||
|
||||
export const zPostWorkspacesCurrentModelProvidersByProviderCredentialsBody = zParserCredentialCreate
|
||||
|
||||
@@ -3278,10 +3714,10 @@ export const zPostWorkspacesCurrentModelProvidersByProviderCredentialsValidatePa
|
||||
})
|
||||
|
||||
/**
|
||||
* Credential validation result
|
||||
* Provider credentials validated successfully
|
||||
*/
|
||||
export const zPostWorkspacesCurrentModelProvidersByProviderCredentialsValidateResponse
|
||||
= zProviderCredentialValidateResponse
|
||||
= zValidationResultResponse
|
||||
|
||||
export const zDeleteWorkspacesCurrentModelProvidersByProviderModelsBody = zParserDeleteModels
|
||||
|
||||
@@ -3299,10 +3735,10 @@ export const zGetWorkspacesCurrentModelProvidersByProviderModelsPath = z.object(
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Provider models retrieved successfully
|
||||
*/
|
||||
export const zGetWorkspacesCurrentModelProvidersByProviderModelsResponse
|
||||
= zModelWithProviderListResponse
|
||||
= zProviderModelListResponse
|
||||
|
||||
export const zPostWorkspacesCurrentModelProvidersByProviderModelsBody = zParserPostModels
|
||||
|
||||
@@ -3311,7 +3747,7 @@ export const zPostWorkspacesCurrentModelProvidersByProviderModelsPath = z.object
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Model updated successfully
|
||||
*/
|
||||
export const zPostWorkspacesCurrentModelProvidersByProviderModelsResponse = zSimpleResultResponse
|
||||
|
||||
@@ -3339,7 +3775,7 @@ export const zGetWorkspacesCurrentModelProvidersByProviderModelsCredentialsQuery
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Model credentials retrieved successfully
|
||||
*/
|
||||
export const zGetWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse
|
||||
= zModelCredentialResponse
|
||||
@@ -3352,7 +3788,7 @@ export const zPostWorkspacesCurrentModelProvidersByProviderModelsCredentialsPath
|
||||
})
|
||||
|
||||
/**
|
||||
* Credential created successfully
|
||||
* Model credential created successfully
|
||||
*/
|
||||
export const zPostWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse
|
||||
= zSimpleResultResponse
|
||||
@@ -3365,7 +3801,7 @@ export const zPutWorkspacesCurrentModelProvidersByProviderModelsCredentialsPath
|
||||
})
|
||||
|
||||
/**
|
||||
* Credential updated successfully
|
||||
* Model credential updated successfully
|
||||
*/
|
||||
export const zPutWorkspacesCurrentModelProvidersByProviderModelsCredentialsResponse
|
||||
= zSimpleResultResponse
|
||||
@@ -3393,10 +3829,10 @@ export const zPostWorkspacesCurrentModelProvidersByProviderModelsCredentialsVali
|
||||
)
|
||||
|
||||
/**
|
||||
* Credential validation result
|
||||
* Model credentials validated successfully
|
||||
*/
|
||||
export const zPostWorkspacesCurrentModelProvidersByProviderModelsCredentialsValidateResponse
|
||||
= zModelCredentialValidateResponse
|
||||
= zValidationResultResponse
|
||||
|
||||
export const zPatchWorkspacesCurrentModelProvidersByProviderModelsDisableBody = zParserDeleteModels
|
||||
|
||||
@@ -3460,10 +3896,10 @@ export const zGetWorkspacesCurrentModelProvidersByProviderModelsParameterRulesQu
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Model parameter rules retrieved successfully
|
||||
*/
|
||||
export const zGetWorkspacesCurrentModelProvidersByProviderModelsParameterRulesResponse
|
||||
= zModelParameterRulesResponse
|
||||
= zModelParameterRuleListResponse
|
||||
|
||||
export const zPostWorkspacesCurrentModelProvidersByProviderPreferredProviderTypeBody
|
||||
= zParserPreferredProviderType
|
||||
@@ -3483,10 +3919,9 @@ export const zGetWorkspacesCurrentModelsModelTypesByModelTypePath = z.object({
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Available models retrieved successfully
|
||||
*/
|
||||
export const zGetWorkspacesCurrentModelsModelTypesByModelTypeResponse
|
||||
= zProviderWithModelsDataResponse
|
||||
export const zGetWorkspacesCurrentModelsModelTypesByModelTypeResponse = zAvailableModelListResponse
|
||||
|
||||
/**
|
||||
* Success
|
||||
@@ -3556,21 +3991,22 @@ export const zPostWorkspacesCurrentPluginInstallGithubBody = zParserGithubInstal
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostWorkspacesCurrentPluginInstallGithubResponse = zPluginDaemonOperationResponse
|
||||
export const zPostWorkspacesCurrentPluginInstallGithubResponse = zPluginInstallTaskStartResponse
|
||||
|
||||
export const zPostWorkspacesCurrentPluginInstallMarketplaceBody = zParserPluginIdentifiers
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostWorkspacesCurrentPluginInstallMarketplaceResponse = zPluginDaemonOperationResponse
|
||||
export const zPostWorkspacesCurrentPluginInstallMarketplaceResponse
|
||||
= zPluginInstallTaskStartResponse
|
||||
|
||||
export const zPostWorkspacesCurrentPluginInstallPkgBody = zParserPluginIdentifiers
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostWorkspacesCurrentPluginInstallPkgResponse = zPluginDaemonOperationResponse
|
||||
export const zPostWorkspacesCurrentPluginInstallPkgResponse = zPluginInstallTaskStartResponse
|
||||
|
||||
export const zGetWorkspacesCurrentPluginListQuery = z.object({
|
||||
page: z.int().gte(1).optional().default(1),
|
||||
@@ -3706,31 +4142,32 @@ export const zPostWorkspacesCurrentPluginUpgradeGithubBody = zParserGithubUpgrad
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostWorkspacesCurrentPluginUpgradeGithubResponse = zPluginDaemonOperationResponse
|
||||
export const zPostWorkspacesCurrentPluginUpgradeGithubResponse = zPluginInstallTaskStartResponse
|
||||
|
||||
export const zPostWorkspacesCurrentPluginUpgradeMarketplaceBody = zParserMarketplaceUpgrade
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostWorkspacesCurrentPluginUpgradeMarketplaceResponse = zPluginDaemonOperationResponse
|
||||
export const zPostWorkspacesCurrentPluginUpgradeMarketplaceResponse
|
||||
= zPluginInstallTaskStartResponse
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostWorkspacesCurrentPluginUploadBundleResponse = zPluginDaemonOperationResponse
|
||||
export const zPostWorkspacesCurrentPluginUploadBundleResponse = zPluginBundleUploadResponse
|
||||
|
||||
export const zPostWorkspacesCurrentPluginUploadGithubBody = zParserGithubUpload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostWorkspacesCurrentPluginUploadGithubResponse = zPluginDaemonOperationResponse
|
||||
export const zPostWorkspacesCurrentPluginUploadGithubResponse = zPluginDecodeResponse
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostWorkspacesCurrentPluginUploadPkgResponse = zPluginDaemonOperationResponse
|
||||
export const zPostWorkspacesCurrentPluginUploadPkgResponse = zPluginDecodeResponse
|
||||
|
||||
export const zGetWorkspacesCurrentPluginByCategoryListPath = z.object({
|
||||
category: z.string(),
|
||||
@@ -4782,7 +5219,9 @@ export const zGetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangPat
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Model provider icon
|
||||
*/
|
||||
export const zGetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangResponse
|
||||
= zBinaryFileResponse
|
||||
export const zGetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangResponse = z.record(
|
||||
z.string(),
|
||||
z.unknown(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user