MCPcopy Create free account
hub / github.com/53AI/53AIHub / newGraphTemplateAutogenExecutor

Function newGraphTemplateAutogenExecutor

api/service/rag/graph_template_autogen.go:60–78  ·  view source on GitHub ↗
(db *gorm.DB, eid int64)

Source from the content-addressed store, hash-verified

58}
59
60func newGraphTemplateAutogenExecutor(db *gorm.DB, eid int64) (graphTemplateAutogenExecutor, error) {
61 chunkCfgService := NewChunkConfigService(db)
62 config, err := chunkCfgService.GetConfig(eid, nil, "default")
63 if err != nil {
64 logger.SysError(fmt.Sprintf("Failed to get graph template autogen LLM config: %v", err))
65 return nil, fmt.Errorf("获取模型配置失败: %v", err)
66 }
67
68 selectedChannel, selectedModelName, selectErr := config.SelectPipelineLLM()
69 if selectErr != nil {
70 return nil, fmt.Errorf("未配置推理模型: %v", selectErr)
71 }
72
73 return &graphTemplateAutogenLLMExecutor{
74 contentService: NewContentGeneratorService(db),
75 channel: selectedChannel,
76 modelName: selectedModelName,
77 }, nil
78}
79
80func buildGraphTemplateAutogenSystemPrompt() string {
81 return `你是一个知识图谱模板设计专家,不是信息抽取器。

Callers 1

Calls 5

GetConfigMethod · 0.95
NewChunkConfigServiceFunction · 0.85
ErrorfMethod · 0.80
SelectPipelineLLMMethod · 0.80

Tested by

no test coverage detected