refactor: update LLM configuration to model ID in API and frontend

- Replaced LLMConfig with model_id in TextRelationExtractionRequest and FabriTextRequest interfaces.
- Updated related API handlers to retrieve chat models based on model_id.
- Adjusted frontend components to pass model_id instead of LLMConfig, enhancing clarity and simplifying the configuration process.

These changes streamline the model configuration process across the application, improving maintainability and usability.
This commit is contained in:
wizardchen
2026-03-13 19:33:08 +08:00
parent 5f6f223204
commit 5996d07aa6
4 changed files with 36 additions and 101 deletions
+2 -10
View File
@@ -412,7 +412,7 @@ export function testMultimodalFunction(testData: {
export interface TextRelationExtractionRequest {
text: string;
tags: string[];
llm_config: LLMConfig;
model_id: string;
}
export interface Node {
@@ -426,13 +426,6 @@ export interface Relation {
type: string;
}
export interface LLMConfig {
source: 'local' | 'remote';
model_name: string;
base_url: string;
api_key: string;
}
export interface TextRelationExtractionResponse {
nodes: Node[];
relations: Relation[];
@@ -454,7 +447,7 @@ export function extractTextRelations(request: TextRelationExtractionRequest): Pr
export interface FabriTextRequest {
tags: string[];
llm_config: LLMConfig;
model_id: string;
}
export interface FabriTextResponse {
@@ -476,7 +469,6 @@ export function fabriText(request: FabriTextRequest): Promise<FabriTextResponse>
}
export interface FabriTagRequest {
llm_config: LLMConfig;
}
export interface FabriTagResponse {