Merge remote-tracking branch 'prc/master'

This commit is contained in:
wizardchen
2025-12-01 17:25:35 +08:00
4 changed files with 21 additions and 21 deletions
+7 -7
View File
@@ -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<TextRelationExtractionResponse> {
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<FabriTextResponse>
}
export interface FabriTagRequest {
llmConfig: LLMConfig;
llm_config: LLMConfig;
}
export interface FabriTagResponse {
+2 -2
View File
@@ -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 = {}) {
@@ -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) {
+6 -6
View File
@@ -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