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 { export interface TextRelationExtractionRequest {
text: string; text: string;
tags: string[]; tags: string[];
llmConfig: LLMConfig; llm_config: LLMConfig;
} }
export interface Node { export interface Node {
@@ -413,9 +413,9 @@ export interface Relation {
export interface LLMConfig { export interface LLMConfig {
source: 'local' | 'remote'; source: 'local' | 'remote';
modelName: string; model_name: string;
baseUrl: string; base_url: string;
apiKey: string; api_key: string;
} }
export interface TextRelationExtractionResponse { export interface TextRelationExtractionResponse {
@@ -426,7 +426,7 @@ export interface TextRelationExtractionResponse {
// 文本内容关系提取 // 文本内容关系提取
export function extractTextRelations(request: TextRelationExtractionRequest): Promise<TextRelationExtractionResponse> { export function extractTextRelations(request: TextRelationExtractionRequest): Promise<TextRelationExtractionResponse> {
return new Promise((resolve, reject) => { 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) => { .then((response: any) => {
resolve(response.data || { nodes: [], relations: [] }); resolve(response.data || { nodes: [], relations: [] });
}) })
@@ -439,7 +439,7 @@ export function extractTextRelations(request: TextRelationExtractionRequest): Pr
export interface FabriTextRequest { export interface FabriTextRequest {
tags: string[]; tags: string[];
llmConfig: LLMConfig; llm_config: LLMConfig;
} }
export interface FabriTextResponse { export interface FabriTextResponse {
@@ -461,7 +461,7 @@ export function fabriText(request: FabriTextRequest): Promise<FabriTextResponse>
} }
export interface FabriTagRequest { export interface FabriTagRequest {
llmConfig: LLMConfig; llm_config: LLMConfig;
} }
export interface FabriTagResponse { export interface FabriTagResponse {
+2 -2
View File
@@ -186,8 +186,8 @@ export function postChat(url: string, data = {}) {
}); });
} }
export function post(url: string, data = {}) { export function post(url: string, data = {}, config?: any) {
return instance.post(url, data); return instance.post(url, data, config);
} }
export function put(url: string, data = {}) { export function put(url: string, data = {}) {
@@ -446,7 +446,7 @@ const handleFabriTag = async () => {
tagFabring.value = true tagFabring.value = true
try { try {
const response = await fabriTag({ const response = await fabriTag({
llmConfig: modelStatus.value.llm.config llm_config: modelStatus.value.llm.config
}) })
localGraphExtract.value.tags = response.tags || [] localGraphExtract.value.tags = response.tags || []
handleTagsChange() handleTagsChange()
@@ -470,7 +470,7 @@ const handleFabriText = async () => {
try { try {
const response = await fabriText({ const response = await fabriText({
tags: localGraphExtract.value.tags, tags: localGraphExtract.value.tags,
llmConfig: modelStatus.value.llm.config llm_config: modelStatus.value.llm.config
}) })
localGraphExtract.value.text = response.text || '' localGraphExtract.value.text = response.text || ''
handleTextChange() handleTextChange()
@@ -500,7 +500,7 @@ const handleExtract = async () => {
const response = await extractTextRelations({ const response = await extractTextRelations({
text: localGraphExtract.value.text, text: localGraphExtract.value.text,
tags: localGraphExtract.value.tags, tags: localGraphExtract.value.tags,
llmConfig: modelStatus.value.llm.config llm_config: modelStatus.value.llm.config
}) })
localGraphExtract.value.nodes = response.nodes || [] localGraphExtract.value.nodes = response.nodes || []
localGraphExtract.value.relations = response.relations || [] localGraphExtract.value.relations = response.relations || []
@@ -555,9 +555,9 @@ const loadModelStatus = async () => {
modelStatus.value.llm.available = true modelStatus.value.llm.available = true
modelStatus.value.llm.config = { modelStatus.value.llm.config = {
source: llmModel.source, source: llmModel.source,
modelName: llmModel.name, model_name: llmModel.name,
baseUrl: llmModel.parameters?.base_url || '', base_url: llmModel.parameters?.base_url || '',
apiKey: llmModel.parameters?.api_key || '' api_key: llmModel.parameters?.api_key || ''
} }
} }
} catch (error: any) { } catch (error: any) {
+6 -6
View File
@@ -1813,14 +1813,14 @@ func (h *InitializationHandler) testMultimodalWithDocReader(
type TextRelationExtractionRequest struct { type TextRelationExtractionRequest struct {
Text string `json:"text" binding:"required"` Text string `json:"text" binding:"required"`
Tags []string `json:"tags" binding:"required"` Tags []string `json:"tags" binding:"required"`
LLMConfig LLMConfig `json:"llmConfig"` LLMConfig LLMConfig `json:"llm_config"`
} }
type LLMConfig struct { type LLMConfig struct {
Source string `json:"source"` Source string `json:"source"`
ModelName string `json:"modelName"` ModelName string `json:"model_name"`
BaseUrl string `json:"baseUrl"` BaseUrl string `json:"base_url"`
ApiKey string `json:"apiKey"` ApiKey string `json:"api_key"`
} }
// TextRelationExtractionResponse 文本关系提取响应结构 // TextRelationExtractionResponse 文本关系提取响应结构
@@ -1915,7 +1915,7 @@ func (h *InitializationHandler) extractRelationsFromText(
// FabriTextRequest is a request for generating example text // FabriTextRequest is a request for generating example text
type FabriTextRequest struct { type FabriTextRequest struct {
Tags []string `json:"tags"` Tags []string `json:"tags"`
LLMConfig LLMConfig `json:"llmConfig"` LLMConfig LLMConfig `json:"llm_config"`
} }
// FabriTextResponse is a response for generating example text // 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 // FabriTagRequest is a request for generating tags
type FabriTagRequest struct { type FabriTagRequest struct {
LLMConfig LLMConfig `json:"llmConfig"` LLMConfig LLMConfig `json:"llm_config"`
} }
// FabriTagResponse is a response for generating tags // FabriTagResponse is a response for generating tags