feat: add new interfaces, services, and utilities for API integration

refactor: reorganize type definitions and improve type safety

build: add lodash and @types/lodash as dependencies

chore: update tsconfig and vite config for path aliases

style: improve code organization and add documentation comments

fix: correct type usage in LanguageSwitcher component

perf: implement snackbar provider for global notifications

test: add new test interfaces and utility functions

ci: update pnpm-lock.yaml with new dependencies
This commit is contained in:
2025-10-10 15:09:04 +08:00
parent 8cf7a4e5d5
commit a1282de74f
45 changed files with 5088 additions and 274 deletions

View File

@@ -0,0 +1,4 @@
export interface IDebugSingleRequestBody {
component_id: string;
params: Record<string, any>;
}

View File

@@ -0,0 +1,7 @@
export interface IPaginationRequestBody {
keywords?: string;
page?: number;
page_size?: number; // name|create|doc_num|create_time|update_time, defaultcreate_time
orderby?: string;
desc?: string;
}

View File

@@ -0,0 +1,11 @@
export interface IFeedbackRequestBody {
messageId?: string;
thumbup?: boolean;
feedback?: string;
}
export interface IAskRequestBody {
question: string;
kb_ids: string[];
search_id?: string;
}

View File

@@ -0,0 +1,18 @@
export interface IChangeParserConfigRequestBody {
pages: number[][];
chunk_token_num: number;
layout_recognize: boolean;
task_page_size: number;
}
export interface IChangeParserRequestBody {
parser_id: string;
pipeline_id: string;
doc_id: string;
parser_config: IChangeParserConfigRequestBody;
}
export interface IDocumentMetaRequestBody {
documentId: string;
meta: string; // json format string
}

View File

@@ -0,0 +1,14 @@
import { IPaginationRequestBody } from './base';
export interface IFileListRequestBody extends IPaginationRequestBody {
parent_id?: string; // folder id
}
interface BaseRequestBody {
parentId: string;
}
export interface IConnectRequestBody {
fileIds: string[];
kbIds: string[];
}

View File

@@ -0,0 +1,4 @@
export interface IDebugSingleRequestBody {
component_id: string;
params: any[];
}

View File

@@ -0,0 +1,26 @@
export interface ITestRetrievalRequestBody {
question: string;
similarity_threshold: number;
vector_similarity_weight: number;
rerank_id?: string;
top_k?: number;
use_kg?: boolean;
highlight?: boolean;
kb_id?: string[];
}
export interface IFetchKnowledgeListRequestBody {
owner_ids?: string[];
}
export interface IFetchKnowledgeListRequestParams {
kb_id?: string;
keywords?: string;
page?: number;
page_size?: number;
}
export interface IFetchDocumentListRequestBody {
suffix?: string[];
run_status?: string[];
}

View File

@@ -0,0 +1,13 @@
export interface IAddLlmRequestBody {
llm_factory: string; // Ollama
llm_name: string;
model_type: string;
api_base?: string; // chat|embedding|speech2text|image2text
api_key: string;
max_tokens: number;
}
export interface IDeleteLlmRequestBody {
llm_factory: string; // Ollama
llm_name?: string;
}

View File

@@ -0,0 +1,16 @@
import { IExportedMcpServer } from '@/interfaces/database/mcp';
export interface ITestMcpRequestBody {
server_type: string;
url: string;
headers?: Record<string, any>;
variables?: Record<string, any>;
timeout?: number;
}
export interface IImportMcpServersRequestBody {
mcpServers: Record<
string,
Pick<IExportedMcpServer, 'type' | 'url' | 'authorization_token'>
>;
}

View File

@@ -0,0 +1,5 @@
export interface ISetLangfuseConfigRequestBody {
secret_key: string;
public_key: string;
host: string;
}