♻️Refactor: 优化代码结构和调整提示词

This commit is contained in:
2026-03-27 19:48:22 +08:00
parent 18040d00c4
commit afc7fee56b
6 changed files with 10 additions and 154 deletions
-43
View File
@@ -4,9 +4,6 @@ import (
"agent/agent"
"agent/response_struct"
"context"
"fmt"
"sync"
"github.com/tmc/langchaingo/llms"
)
@@ -48,43 +45,3 @@ func GetScenario(llm llms.Model, ctx context.Context, topic string) (response re
response = agent.CallWithAgentDefined(llm, ctx, topic, file, response_struct.Scenario{})
return
}
func GetAll(llm llms.Model, ctx context.Context, topic string) (response *response_struct.AllStruct) {
var wg sync.WaitGroup
wg.Add(len(files))
go func() {
defer wg.Done()
response.CardStruct = GetCard(llm, ctx, topic)
}()
go func() {
defer wg.Done()
response.GuodegangStruct = GetGuodegang(llm, ctx, topic)
}()
go func() {
defer wg.Done()
response.MermaidStruct = GetMermaid(llm, ctx, topic)
}()
go func() {
defer wg.Done()
response.QuizStruct = GetQuiz(llm, ctx, topic)
}()
go func() {
defer wg.Done()
response.ScenarioStruct = GetScenario(llm, ctx, topic)
}()
wg.Wait()
fmt.Println("======== All responses received ========")
return response
}