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:
4
src/interfaces/request/agent.ts
Normal file
4
src/interfaces/request/agent.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export interface IDebugSingleRequestBody {
|
||||
component_id: string;
|
||||
params: Record<string, any>;
|
||||
}
|
||||
7
src/interfaces/request/base.ts
Normal file
7
src/interfaces/request/base.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export interface IPaginationRequestBody {
|
||||
keywords?: string;
|
||||
page?: number;
|
||||
page_size?: number; // name|create|doc_num|create_time|update_time, default:create_time
|
||||
orderby?: string;
|
||||
desc?: string;
|
||||
}
|
||||
11
src/interfaces/request/chat.ts
Normal file
11
src/interfaces/request/chat.ts
Normal 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;
|
||||
}
|
||||
18
src/interfaces/request/document.ts
Normal file
18
src/interfaces/request/document.ts
Normal 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
|
||||
}
|
||||
14
src/interfaces/request/file-manager.ts
Normal file
14
src/interfaces/request/file-manager.ts
Normal 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[];
|
||||
}
|
||||
4
src/interfaces/request/flow.ts
Normal file
4
src/interfaces/request/flow.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export interface IDebugSingleRequestBody {
|
||||
component_id: string;
|
||||
params: any[];
|
||||
}
|
||||
26
src/interfaces/request/knowledge.ts
Normal file
26
src/interfaces/request/knowledge.ts
Normal 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[];
|
||||
}
|
||||
13
src/interfaces/request/llm.ts
Normal file
13
src/interfaces/request/llm.ts
Normal 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;
|
||||
}
|
||||
16
src/interfaces/request/mcp.ts
Normal file
16
src/interfaces/request/mcp.ts
Normal 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'>
|
||||
>;
|
||||
}
|
||||
5
src/interfaces/request/system.ts
Normal file
5
src/interfaces/request/system.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export interface ISetLangfuseConfigRequestBody {
|
||||
secret_key: string;
|
||||
public_key: string;
|
||||
host: string;
|
||||
}
|
||||
Reference in New Issue
Block a user