mirror of
https://github.com/langgenius/dify.git
synced 2026-09-24 23:22:26 +08:00
chore: knip fix (#34481)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
autofix-ci[bot]
parent
985b41c40b
commit
36e840cd87
+1
-11
@@ -12,7 +12,7 @@ import type {
|
||||
WeaveConfig,
|
||||
} from '@/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/type'
|
||||
import type { Dependency } from '@/app/components/plugins/types'
|
||||
import type { App, AppModeEnum, AppTemplate, SiteConfig } from '@/types/app'
|
||||
import type { App, AppModeEnum, SiteConfig } from '@/types/app'
|
||||
|
||||
export enum DSLImportMode {
|
||||
YAML_CONTENT = 'yaml-content',
|
||||
@@ -47,12 +47,6 @@ export type DSLImportResponse = {
|
||||
leaked_dependencies: Dependency[]
|
||||
}
|
||||
|
||||
export type AppTemplatesResponse = {
|
||||
data: AppTemplate[]
|
||||
}
|
||||
|
||||
export type CreateAppResponse = App
|
||||
|
||||
export type UpdateAppSiteCodeResponse = { app_id: string } & SiteConfig
|
||||
|
||||
export type AppDailyMessagesResponse = {
|
||||
@@ -105,10 +99,6 @@ export type ValidateOpenAIKeyResponse = {
|
||||
|
||||
export type UpdateOpenAIKeyResponse = ValidateOpenAIKeyResponse
|
||||
|
||||
export type GenerationIntroductionResponse = {
|
||||
introduction: string
|
||||
}
|
||||
|
||||
export type AppVoicesListResponse = [{
|
||||
name: string
|
||||
value: string
|
||||
|
||||
@@ -5,18 +5,6 @@ export type CommonResponse = {
|
||||
result: 'success' | 'fail'
|
||||
}
|
||||
|
||||
export type FileDownloadResponse = {
|
||||
id: string
|
||||
name: string
|
||||
size: number
|
||||
extension: string
|
||||
url: string
|
||||
download_url: string
|
||||
mime_type: string
|
||||
created_by: string
|
||||
created_at: number
|
||||
}
|
||||
|
||||
export type OauthResponse = {
|
||||
redirect_url: string
|
||||
}
|
||||
@@ -62,20 +50,6 @@ export type LangGeniusVersionResponse = {
|
||||
current_env: string
|
||||
}
|
||||
|
||||
export type TenantInfoResponse = {
|
||||
name: string
|
||||
created_at: string
|
||||
providers: Array<{
|
||||
provider: string
|
||||
provider_name: string
|
||||
token_is_set: boolean
|
||||
is_valid: boolean
|
||||
token_is_valid: boolean
|
||||
}>
|
||||
in_trail: boolean
|
||||
trial_end_reason: null | 'trial_exceeded' | 'using_custom'
|
||||
}
|
||||
|
||||
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'
|
||||
@@ -100,11 +74,6 @@ export type ProviderAzureToken = {
|
||||
export type ProviderAnthropicToken = {
|
||||
anthropic_api_key?: string
|
||||
}
|
||||
export type ProviderTokenType = {
|
||||
[ProviderName.OPENAI]: string
|
||||
[ProviderName.AZURE_OPENAI]: ProviderAzureToken
|
||||
[ProviderName.ANTHROPIC]: ProviderAnthropicToken
|
||||
}
|
||||
export type Provider = {
|
||||
[Name in ProviderName]: {
|
||||
provider_name: Name
|
||||
@@ -117,12 +86,6 @@ export type Provider = {
|
||||
}
|
||||
}[ProviderName]
|
||||
|
||||
export type ProviderHosted = Provider & {
|
||||
quota_type: string
|
||||
quota_limit: number
|
||||
quota_used: number
|
||||
}
|
||||
|
||||
export type AccountIntegrate = {
|
||||
provider: 'google' | 'github'
|
||||
created_at: number
|
||||
@@ -179,8 +142,6 @@ export type DataSourceNotionWorkspace = {
|
||||
pages: DataSourceNotionPage[]
|
||||
}
|
||||
|
||||
export type DataSourceNotionWorkspaceMap = Record<string, DataSourceNotionWorkspace>
|
||||
|
||||
export type DataSourceNotion = {
|
||||
id: string
|
||||
provider: string
|
||||
@@ -188,38 +149,12 @@ export type DataSourceNotion = {
|
||||
source_info: DataSourceNotionWorkspace
|
||||
}
|
||||
|
||||
export enum DataSourceCategory {
|
||||
website = 'website',
|
||||
}
|
||||
export enum DataSourceProvider {
|
||||
fireCrawl = 'firecrawl',
|
||||
jinaReader = 'jinareader',
|
||||
waterCrawl = 'watercrawl',
|
||||
}
|
||||
|
||||
export type FirecrawlConfig = {
|
||||
api_key: string
|
||||
base_url: string
|
||||
}
|
||||
|
||||
export type WatercrawlConfig = {
|
||||
api_key: string
|
||||
base_url: string
|
||||
}
|
||||
|
||||
export type DataSourceItem = {
|
||||
id: string
|
||||
category: DataSourceCategory
|
||||
provider: DataSourceProvider
|
||||
disabled: boolean
|
||||
created_at: number
|
||||
updated_at: number
|
||||
}
|
||||
|
||||
export type DataSources = {
|
||||
sources: DataSourceItem[]
|
||||
}
|
||||
|
||||
export type PluginProvider = {
|
||||
tool_name: string
|
||||
is_enabled: boolean
|
||||
@@ -300,14 +235,6 @@ export type ModerateResponse = {
|
||||
text: string
|
||||
}
|
||||
|
||||
export type ModerationService = (
|
||||
url: string,
|
||||
body: {
|
||||
app_id: string
|
||||
text: string
|
||||
},
|
||||
) => Promise<ModerateResponse>
|
||||
|
||||
export type StructuredOutputRulesRequestBody = {
|
||||
instruction: string
|
||||
model_config: Model
|
||||
|
||||
@@ -7,7 +7,6 @@ import type { MetadataFilteringVariableType } from '@/app/components/workflow/no
|
||||
import type { AppIconType, AppModeEnum, RetrievalConfig, TransferMethod } from '@/types/app'
|
||||
import type { I18nKeysByPrefix } from '@/types/i18n'
|
||||
import { ExternalKnowledgeBase, General, ParentChild, Qa } from '@/app/components/base/icons/src/public/knowledge/dataset-card'
|
||||
import { GeneralChunk, ParentChildChunk, QuestionAndAnswer } from '@/app/components/base/icons/src/vender/knowledge'
|
||||
|
||||
export enum DataSourceType {
|
||||
FILE = 'upload_file',
|
||||
@@ -474,10 +473,6 @@ export type NotionInfo = {
|
||||
pages: DataSourceNotionPage[]
|
||||
credential_id: string
|
||||
}
|
||||
export type NotionPage = {
|
||||
page_id: string
|
||||
type: string
|
||||
}
|
||||
|
||||
export type ProcessRule = {
|
||||
mode: ProcessMode
|
||||
@@ -550,15 +545,6 @@ export type DocumentDetailResponse = FullDocumentDetail
|
||||
export const SEGMENT_STATUS_LIST = ['waiting', 'completed', 'error', 'indexing']
|
||||
export type SegmentStatus = typeof SEGMENT_STATUS_LIST[number]
|
||||
|
||||
export type SegmentsQuery = {
|
||||
page?: string
|
||||
limit: number
|
||||
// status?: SegmentStatus
|
||||
hit_count_gte?: number
|
||||
keyword?: string
|
||||
enabled?: boolean | 'all'
|
||||
}
|
||||
|
||||
export type Attachment = {
|
||||
id: string
|
||||
name: string
|
||||
@@ -785,11 +771,6 @@ export type ChildSegmentsResponse = {
|
||||
limit: number
|
||||
}
|
||||
|
||||
export type UpdateDocumentParams = {
|
||||
datasetId: string
|
||||
documentId: string
|
||||
}
|
||||
|
||||
// Used in api url
|
||||
export enum DocumentActionType {
|
||||
enable = 'enable',
|
||||
@@ -819,12 +800,6 @@ export const DOC_FORM_ICON_WITH_BG: Record<ChunkingMode | 'external', React.Comp
|
||||
external: ExternalKnowledgeBase,
|
||||
}
|
||||
|
||||
export const DOC_FORM_ICON: Record<ChunkingMode.text | ChunkingMode.qa | ChunkingMode.parentChild, React.ComponentType<{ className: string }>> = {
|
||||
[ChunkingMode.text]: GeneralChunk,
|
||||
[ChunkingMode.qa]: QuestionAndAnswer,
|
||||
[ChunkingMode.parentChild]: ParentChildChunk,
|
||||
}
|
||||
|
||||
type ChunkingModeText = I18nKeysByPrefix<'dataset', 'chunkingMode.'>
|
||||
|
||||
export const DOC_FORM_TEXT: Record<ChunkingMode, ChunkingModeText> = {
|
||||
@@ -857,12 +832,6 @@ export type IndexingStatusBatchRequest = {
|
||||
batchId: string
|
||||
}
|
||||
|
||||
export type HitTestingRecordsRequest = {
|
||||
datasetId: string
|
||||
page: number
|
||||
limit: number
|
||||
}
|
||||
|
||||
export type HitTestingRequest = {
|
||||
query: string
|
||||
attachment_ids: string[]
|
||||
|
||||
@@ -65,17 +65,6 @@ export type PromptVariable = {
|
||||
json_schema?: string | Record<string, any>
|
||||
}
|
||||
|
||||
export type CompletionParams = {
|
||||
max_tokens: number
|
||||
temperature: number
|
||||
top_p: number
|
||||
presence_penalty: number
|
||||
frequency_penalty: number
|
||||
stop?: string[]
|
||||
}
|
||||
|
||||
export type ModelId = 'gpt-3.5-turbo' | 'text-davinci-003'
|
||||
|
||||
export type PromptConfig = {
|
||||
prompt_template: string
|
||||
prompt_variables: PromptVariable[]
|
||||
@@ -159,11 +148,6 @@ export type ModelConfig = {
|
||||
dataSets: any[]
|
||||
agentConfig: AgentConfig
|
||||
}
|
||||
export type DatasetConfigItem = {
|
||||
enable: boolean
|
||||
value: number
|
||||
}
|
||||
|
||||
export type DatasetConfigs = {
|
||||
retrieval_model: RETRIEVE_TYPE
|
||||
reranking_model: {
|
||||
@@ -197,74 +181,6 @@ export type DatasetConfigs = {
|
||||
metadata_model_config?: NodeModelConfig
|
||||
}
|
||||
|
||||
export type DebugRequestBody = {
|
||||
inputs: Inputs
|
||||
query: string
|
||||
completion_params: CompletionParams
|
||||
model_config: ModelConfig
|
||||
}
|
||||
|
||||
export type DebugResponse = {
|
||||
id: string
|
||||
answer: string
|
||||
created_at: string
|
||||
}
|
||||
|
||||
export type DebugResponseStream = {
|
||||
id: string
|
||||
data: string
|
||||
created_at: string
|
||||
}
|
||||
|
||||
export type FeedBackRequestBody = {
|
||||
message_id: string
|
||||
rating: 'like' | 'dislike'
|
||||
content?: string
|
||||
from_source: 'api' | 'log'
|
||||
}
|
||||
|
||||
export type FeedBackResponse = {
|
||||
message_id: string
|
||||
rating: 'like' | 'dislike'
|
||||
}
|
||||
|
||||
// Log session list
|
||||
export type LogSessionListQuery = {
|
||||
keyword?: string
|
||||
start?: string // format datetime(YYYY-mm-dd HH:ii)
|
||||
end?: string // format datetime(YYYY-mm-dd HH:ii)
|
||||
page: number
|
||||
limit: number // default 20. 1-100
|
||||
}
|
||||
|
||||
export type LogSessionListResponse = {
|
||||
data: {
|
||||
id: string
|
||||
conversation_id: string
|
||||
query: string // user's query question
|
||||
message: string // prompt send to LLM
|
||||
answer: string
|
||||
created_at: string
|
||||
}[]
|
||||
total: number
|
||||
page: number
|
||||
}
|
||||
|
||||
// log session detail and debug
|
||||
export type LogSessionDetailResponse = {
|
||||
id: string
|
||||
conversation_id: string
|
||||
model_provider: string
|
||||
query: string
|
||||
inputs: Record<string, string | number | object>[]
|
||||
message: string
|
||||
message_tokens: number // number of tokens in message
|
||||
answer: string
|
||||
answer_tokens: number // number of tokens in answer
|
||||
provider_response_latency: number // used time in ms
|
||||
from_source: 'api' | 'log'
|
||||
}
|
||||
|
||||
export type SavedMessage = {
|
||||
id: string
|
||||
answer: string
|
||||
|
||||
@@ -6,10 +6,6 @@ import type {
|
||||
} from '@/app/components/workflow/types'
|
||||
import type { VisionFile } from '@/types/app'
|
||||
|
||||
export const CompletionParams = ['temperature', 'top_p', 'presence_penalty', 'max_token', 'stop', 'frequency_penalty'] as const
|
||||
|
||||
export type CompletionParamType = typeof CompletionParams[number]
|
||||
|
||||
export type CompletionParamsType = {
|
||||
max_tokens: number
|
||||
temperature: number
|
||||
@@ -279,13 +275,6 @@ export type WorkflowLogsResponse = {
|
||||
total: number
|
||||
page: number
|
||||
}
|
||||
export type WorkflowLogsRequest = {
|
||||
keyword: string
|
||||
status: string
|
||||
page: number
|
||||
limit: number // The default value is 20 and the range is 1-100
|
||||
}
|
||||
|
||||
export type WorkflowRunDetailResponse = {
|
||||
id: string
|
||||
version: string
|
||||
|
||||
+1
-10
@@ -1,7 +1,6 @@
|
||||
import type { Viewport } from 'reactflow'
|
||||
import type { DSLImportMode, DSLImportStatus } from './app'
|
||||
import type { ChunkingMode, DatasetPermission, DocumentIndexingStatus, FileIndexingEstimateResponse, IconInfo } from './datasets'
|
||||
import type { AppIconSelection } from '@/app/components/base/app-icon-picker'
|
||||
import type { ChunkingMode, DocumentIndexingStatus, FileIndexingEstimateResponse, IconInfo } from './datasets'
|
||||
import type { Dependency } from '@/app/components/plugins/types'
|
||||
import type { Edge, EnvironmentVariable, Node, SupportUploadFileTypes } from '@/app/components/workflow/types'
|
||||
import type { TransferMethod } from '@/types/app'
|
||||
@@ -53,14 +52,6 @@ export type PipelineTemplateByIdResponse = {
|
||||
created_by: string
|
||||
}
|
||||
|
||||
export type CreateFormData = {
|
||||
name: string
|
||||
appIcon: AppIconSelection
|
||||
description: string
|
||||
permission: DatasetPermission
|
||||
selectedMemberIDs: string[]
|
||||
}
|
||||
|
||||
export type UpdateTemplateInfoRequest = {
|
||||
template_id: string
|
||||
name: string
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import type { Locale } from '@/i18n-config'
|
||||
import type { AppIconType } from '@/types/app'
|
||||
|
||||
export type ResponseHolder = {}
|
||||
|
||||
export type ConversationItem = {
|
||||
id: string
|
||||
name: string
|
||||
|
||||
Reference in New Issue
Block a user