2025-04-26 16:58:30 +05:30
|
|
|
import type { LangFuseConfig, LangSmithConfig, OpikConfig, TracingProvider, WeaveConfig } from '@/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/type'
|
2025-05-07 18:09:38 +08:00
|
|
|
import type { App, AppMode, AppSSO, AppTemplate, SiteConfig } from '@/types/app'
|
2025-02-17 17:05:13 +08:00
|
|
|
import type { Dependency } from '@/app/components/plugins/types'
|
2023-05-15 08:51:32 +08:00
|
|
|
|
2024-11-22 15:05:04 +08:00
|
|
|
export enum DSLImportMode {
|
|
|
|
YAML_CONTENT = 'yaml-content',
|
|
|
|
YAML_URL = 'yaml-url',
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum DSLImportStatus {
|
|
|
|
COMPLETED = 'completed',
|
|
|
|
COMPLETED_WITH_WARNINGS = 'completed-with-warnings',
|
|
|
|
PENDING = 'pending',
|
|
|
|
FAILED = 'failed',
|
|
|
|
}
|
|
|
|
|
2023-05-15 08:51:32 +08:00
|
|
|
export type AppListResponse = {
|
|
|
|
data: App[]
|
2023-05-20 21:55:47 +08:00
|
|
|
has_more: boolean
|
|
|
|
limit: number
|
|
|
|
page: number
|
|
|
|
total: number
|
2023-05-15 08:51:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export type AppDetailResponse = App
|
2024-11-22 15:05:04 +08:00
|
|
|
|
|
|
|
export type DSLImportResponse = {
|
|
|
|
id: string
|
|
|
|
status: DSLImportStatus
|
2025-03-18 11:12:25 +08:00
|
|
|
app_mode: AppMode
|
2024-11-22 15:05:04 +08:00
|
|
|
app_id?: string
|
|
|
|
current_dsl_version?: string
|
|
|
|
imported_dsl_version?: string
|
|
|
|
error: string
|
2025-02-17 17:05:13 +08:00
|
|
|
leaked_dependencies: Dependency[]
|
2024-11-22 15:05:04 +08:00
|
|
|
}
|
|
|
|
|
2024-08-25 18:47:16 +08:00
|
|
|
export type AppSSOResponse = { enabled: AppSSO['enable_sso'] }
|
2023-05-15 08:51:32 +08:00
|
|
|
|
|
|
|
export type AppTemplatesResponse = {
|
|
|
|
data: AppTemplate[]
|
|
|
|
}
|
|
|
|
|
|
|
|
export type CreateAppResponse = App
|
|
|
|
|
|
|
|
export type UpdateAppSiteCodeResponse = { app_id: string } & SiteConfig
|
|
|
|
|
2024-08-27 12:53:27 +08:00
|
|
|
export type AppDailyMessagesResponse = {
|
|
|
|
data: Array<{ date: string; message_count: number }>
|
|
|
|
}
|
|
|
|
|
2023-05-15 08:51:32 +08:00
|
|
|
export type AppDailyConversationsResponse = {
|
|
|
|
data: Array<{ date: string; conversation_count: number }>
|
|
|
|
}
|
|
|
|
|
2024-04-08 18:51:46 +08:00
|
|
|
export type WorkflowDailyConversationsResponse = {
|
|
|
|
data: Array<{ date: string; runs: number }>
|
|
|
|
}
|
|
|
|
|
2023-05-31 11:21:30 +08:00
|
|
|
export type AppStatisticsResponse = {
|
|
|
|
data: Array<{ date: string }>
|
|
|
|
}
|
|
|
|
|
2023-05-15 08:51:32 +08:00
|
|
|
export type AppDailyEndUsersResponse = {
|
|
|
|
data: Array<{ date: string; terminal_count: number }>
|
|
|
|
}
|
|
|
|
|
|
|
|
export type AppTokenCostsResponse = {
|
|
|
|
data: Array<{ date: string; token_count: number; total_price: number; currency: number }>
|
|
|
|
}
|
|
|
|
|
|
|
|
export type UpdateAppModelConfigResponse = { result: string }
|
|
|
|
|
2024-09-08 12:14:11 +07:00
|
|
|
export type ApiKeyItemResponse = {
|
2023-05-15 08:51:32 +08:00
|
|
|
id: string
|
|
|
|
token: string
|
|
|
|
last_used_at: string
|
|
|
|
created_at: string
|
|
|
|
}
|
|
|
|
|
2024-09-08 12:14:11 +07:00
|
|
|
export type ApiKeysListResponse = {
|
|
|
|
data: ApiKeyItemResponse[]
|
2023-05-15 08:51:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export type CreateApiKeyResponse = {
|
|
|
|
id: string
|
|
|
|
token: string
|
|
|
|
created_at: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export type ValidateOpenAIKeyResponse = {
|
|
|
|
result: string
|
|
|
|
error?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export type UpdateOpenAIKeyResponse = ValidateOpenAIKeyResponse
|
|
|
|
|
|
|
|
export type GenerationIntroductionResponse = {
|
|
|
|
introduction: string
|
|
|
|
}
|
2024-02-15 22:41:18 +08:00
|
|
|
|
|
|
|
export type AppVoicesListResponse = [{
|
|
|
|
name: string
|
|
|
|
value: string
|
|
|
|
}]
|
2024-06-26 17:33:57 +08:00
|
|
|
|
|
|
|
export type TracingStatus = {
|
|
|
|
enabled: boolean
|
|
|
|
tracing_provider: TracingProvider | null
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TracingConfig = {
|
|
|
|
tracing_provider: TracingProvider
|
2025-04-26 16:58:30 +05:30
|
|
|
tracing_config: LangSmithConfig | LangFuseConfig | OpikConfig | WeaveConfig
|
2024-06-26 17:33:57 +08:00
|
|
|
}
|