diff --git a/frontend/src/api/initialization/index.ts b/frontend/src/api/initialization/index.ts index a3d0ac33..7ec62baf 100644 --- a/frontend/src/api/initialization/index.ts +++ b/frontend/src/api/initialization/index.ts @@ -397,7 +397,7 @@ export function testMultimodalFunction(testData: { export interface TextRelationExtractionRequest { text: string; tags: string[]; - llmConfig: LLMConfig; + llm_config: LLMConfig; } export interface Node { @@ -413,9 +413,9 @@ export interface Relation { export interface LLMConfig { source: 'local' | 'remote'; - modelName: string; - baseUrl: string; - apiKey: string; + model_name: string; + base_url: string; + api_key: string; } export interface TextRelationExtractionResponse { @@ -426,7 +426,7 @@ export interface TextRelationExtractionResponse { // 文本内容关系提取 export function extractTextRelations(request: TextRelationExtractionRequest): Promise { return new Promise((resolve, reject) => { - post('/api/v1/initialization/extract/text-relation', request) + post('/api/v1/initialization/extract/text-relation', request, { timeout: 60000 }) .then((response: any) => { resolve(response.data || { nodes: [], relations: [] }); }) @@ -439,7 +439,7 @@ export function extractTextRelations(request: TextRelationExtractionRequest): Pr export interface FabriTextRequest { tags: string[]; - llmConfig: LLMConfig; + llm_config: LLMConfig; } export interface FabriTextResponse { @@ -461,7 +461,7 @@ export function fabriText(request: FabriTextRequest): Promise } export interface FabriTagRequest { - llmConfig: LLMConfig; + llm_config: LLMConfig; } export interface FabriTagResponse { diff --git a/frontend/src/utils/request.ts b/frontend/src/utils/request.ts index 3aacba79..cdac619c 100644 --- a/frontend/src/utils/request.ts +++ b/frontend/src/utils/request.ts @@ -186,8 +186,8 @@ export function postChat(url: string, data = {}) { }); } -export function post(url: string, data = {}) { - return instance.post(url, data); +export function post(url: string, data = {}, config?: any) { + return instance.post(url, data, config); } export function put(url: string, data = {}) { diff --git a/frontend/src/views/knowledge/settings/GraphSettings.vue b/frontend/src/views/knowledge/settings/GraphSettings.vue index 8386b7be..02fd8882 100644 --- a/frontend/src/views/knowledge/settings/GraphSettings.vue +++ b/frontend/src/views/knowledge/settings/GraphSettings.vue @@ -446,7 +446,7 @@ const handleFabriTag = async () => { tagFabring.value = true try { const response = await fabriTag({ - llmConfig: modelStatus.value.llm.config + llm_config: modelStatus.value.llm.config }) localGraphExtract.value.tags = response.tags || [] handleTagsChange() @@ -470,7 +470,7 @@ const handleFabriText = async () => { try { const response = await fabriText({ tags: localGraphExtract.value.tags, - llmConfig: modelStatus.value.llm.config + llm_config: modelStatus.value.llm.config }) localGraphExtract.value.text = response.text || '' handleTextChange() @@ -500,7 +500,7 @@ const handleExtract = async () => { const response = await extractTextRelations({ text: localGraphExtract.value.text, tags: localGraphExtract.value.tags, - llmConfig: modelStatus.value.llm.config + llm_config: modelStatus.value.llm.config }) localGraphExtract.value.nodes = response.nodes || [] localGraphExtract.value.relations = response.relations || [] @@ -555,9 +555,9 @@ const loadModelStatus = async () => { modelStatus.value.llm.available = true modelStatus.value.llm.config = { source: llmModel.source, - modelName: llmModel.name, - baseUrl: llmModel.parameters?.base_url || '', - apiKey: llmModel.parameters?.api_key || '' + model_name: llmModel.name, + base_url: llmModel.parameters?.base_url || '', + api_key: llmModel.parameters?.api_key || '' } } } catch (error: any) { diff --git a/internal/handler/initialization.go b/internal/handler/initialization.go index d953b031..42f62e10 100644 --- a/internal/handler/initialization.go +++ b/internal/handler/initialization.go @@ -1813,14 +1813,14 @@ func (h *InitializationHandler) testMultimodalWithDocReader( type TextRelationExtractionRequest struct { Text string `json:"text" binding:"required"` Tags []string `json:"tags" binding:"required"` - LLMConfig LLMConfig `json:"llmConfig"` + LLMConfig LLMConfig `json:"llm_config"` } type LLMConfig struct { Source string `json:"source"` - ModelName string `json:"modelName"` - BaseUrl string `json:"baseUrl"` - ApiKey string `json:"apiKey"` + ModelName string `json:"model_name"` + BaseUrl string `json:"base_url"` + ApiKey string `json:"api_key"` } // TextRelationExtractionResponse 文本关系提取响应结构 @@ -1915,7 +1915,7 @@ func (h *InitializationHandler) extractRelationsFromText( // FabriTextRequest is a request for generating example text type FabriTextRequest struct { Tags []string `json:"tags"` - LLMConfig LLMConfig `json:"llmConfig"` + LLMConfig LLMConfig `json:"llm_config"` } // FabriTextResponse is a response for generating example text @@ -1984,7 +1984,7 @@ func (h *InitializationHandler) fabriText(ctx context.Context, tags []string, ll // FabriTagRequest is a request for generating tags type FabriTagRequest struct { - LLMConfig LLMConfig `json:"llmConfig"` + LLMConfig LLMConfig `json:"llm_config"` } // FabriTagResponse is a response for generating tags