Merge branch 'plugins/beta' into dev/plugin-deploy

This commit is contained in:
Yeuoly
2025-02-06 18:30:49 +08:00
368 changed files with 5095 additions and 3430 deletions

View File

@ -1,4 +1,4 @@
import type { LangFuseConfig, LangSmithConfig, TracingProvider } from '@/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/type'
import type { LangFuseConfig, LangSmithConfig, OpikConfig, TracingProvider } from '@/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/type'
import type { App, AppSSO, AppTemplate, SiteConfig } from '@/types/app'
import type { Dependency } from '@/app/components/plugins/types'
@ -167,5 +167,5 @@ export type TracingStatus = {
export type TracingConfig = {
tracing_provider: TracingProvider
tracing_config: LangSmithConfig | LangFuseConfig
tracing_config: LangSmithConfig | LangFuseConfig | OpikConfig
}

View File

@ -1,27 +1,28 @@
import type { I18nText } from '@/i18n/language'
export interface CommonResponse {
export type CommonResponse = {
result: 'success' | 'fail'
}
export interface OauthResponse {
export type OauthResponse = {
redirect_url: string
}
export interface SetupStatusResponse {
export type SetupStatusResponse = {
step: 'finished' | 'not_started'
setup_at?: Date
}
export interface InitValidateStatusResponse {
export type InitValidateStatusResponse = {
status: 'finished' | 'not_started'
}
export interface UserProfileResponse {
export type UserProfileResponse = {
id: string
name: string
email: string
avatar: string
avatar_url: string | null
is_password_set: boolean
interface_language?: string
interface_theme?: string
@ -32,13 +33,13 @@ export interface UserProfileResponse {
created_at?: string
}
export interface UserProfileOriginResponse {
export type UserProfileOriginResponse = {
json: () => Promise<UserProfileResponse>
bodyUsed: boolean
headers: any
}
export interface LangGeniusVersionResponse {
export type LangGeniusVersionResponse = {
current_version: string
latest_version: string
version: string
@ -48,7 +49,7 @@ export interface LangGeniusVersionResponse {
current_env: string
}
export interface TenantInfoResponse {
export type TenantInfoResponse = {
name: string
created_at: string
providers: Array<{
@ -62,7 +63,7 @@ export interface TenantInfoResponse {
trial_end_reason: null | 'trial_exceeded' | 'using_custom'
}
export type Member = Pick<UserProfileResponse, 'id' | 'name' | 'email' | 'last_login_at' | 'last_active_at' | 'created_at'> & {
export type Member = Pick<UserProfileResponse, 'id' | 'name' | 'email' | 'last_login_at' | 'last_active_at' | 'created_at' | 'avatar_url'> & {
avatar: string
status: 'pending' | 'active' | 'banned' | 'closed'
role: 'owner' | 'admin' | 'editor' | 'normal' | 'dataset_operator'
@ -79,14 +80,14 @@ export enum ProviderName {
Tongyi = 'tongyi',
ChatGLM = 'chatglm',
}
export interface ProviderAzureToken {
export type ProviderAzureToken = {
openai_api_base?: string
openai_api_key?: string
}
export interface ProviderAnthropicToken {
export type ProviderAnthropicToken = {
anthropic_api_key?: string
}
export interface ProviderTokenType {
export type ProviderTokenType = {
[ProviderName.OPENAI]: string
[ProviderName.AZURE_OPENAI]: ProviderAzureToken
[ProviderName.ANTHROPIC]: ProviderAnthropicToken
@ -109,14 +110,14 @@ export type ProviderHosted = Provider & {
quota_used: number
}
export interface AccountIntegrate {
export type AccountIntegrate = {
provider: 'google' | 'github'
created_at: number
is_bound: boolean
link: string
}
export interface IWorkspace {
export type IWorkspace = {
id: string
name: string
plan: string
@ -136,7 +137,7 @@ export type ICurrentWorkspace = Omit<IWorkspace, 'current'> & {
}
}
export interface DataSourceNotionPage {
export type DataSourceNotionPage = {
page_icon: null | {
type: string | null
url: string | null
@ -155,7 +156,7 @@ export type NotionPage = DataSourceNotionPage & {
export type DataSourceNotionPageMap = Record<string, DataSourceNotionPage & { workspace_id: string }>
export interface DataSourceNotionWorkspace {
export type DataSourceNotionWorkspace = {
workspace_name: string
workspace_id: string
workspace_icon: string | null
@ -165,7 +166,7 @@ export interface DataSourceNotionWorkspace {
export type DataSourceNotionWorkspaceMap = Record<string, DataSourceNotionWorkspace>
export interface DataSourceNotion {
export type DataSourceNotion = {
id: string
provider: string
is_bound: boolean
@ -180,12 +181,12 @@ export enum DataSourceProvider {
jinaReader = 'jinareader',
}
export interface FirecrawlConfig {
export type FirecrawlConfig = {
api_key: string
base_url: string
}
export interface DataSourceItem {
export type DataSourceItem = {
id: string
category: DataSourceCategory
provider: DataSourceProvider
@ -194,15 +195,15 @@ export interface DataSourceItem {
updated_at: number
}
export interface DataSources {
export type DataSources = {
sources: DataSourceItem[]
}
export interface GithubRepo {
export type GithubRepo = {
stargazers_count: number
}
export interface PluginProvider {
export type PluginProvider = {
tool_name: string
is_enabled: boolean
credentials: {
@ -210,7 +211,7 @@ export interface PluginProvider {
} | null
}
export interface FileUploadConfigResponse {
export type FileUploadConfigResponse = {
batch_count_limit: number
image_file_size_limit?: number | string // default is 10MB
file_size_limit: number // default is 15MB
@ -233,14 +234,14 @@ export type InvitationResponse = CommonResponse & {
invitation_results: InvitationResult[]
}
export interface ApiBasedExtension {
export type ApiBasedExtension = {
id?: string
name?: string
api_endpoint?: string
api_key?: string
}
export interface CodeBasedExtensionForm {
export type CodeBasedExtensionForm = {
type: string
label: I18nText
variable: string
@ -251,17 +252,17 @@ export interface CodeBasedExtensionForm {
max_length?: number
}
export interface CodeBasedExtensionItem {
export type CodeBasedExtensionItem = {
name: string
label: any
form_schema: CodeBasedExtensionForm[]
}
export interface CodeBasedExtension {
export type CodeBasedExtension = {
module: string
data: CodeBasedExtensionItem[]
}
export interface ExternalDataTool {
export type ExternalDataTool = {
type?: string
label?: string
icon?: string
@ -273,7 +274,7 @@ export interface ExternalDataTool {
} & Partial<Record<string, any>>
}
export interface ModerateResponse {
export type ModerateResponse = {
flagged: boolean
text: string
}

View File

@ -132,6 +132,17 @@ export type FileItem = {
progress: number
}
export type FetchDatasetsParams = {
url: string
params: {
page: number
tag_ids?: string[]
limit: number
include_all: boolean
keyword?: string
}
}
export type DataSetListResponse = {
data: DataSet[]
has_more: boolean