Update go-llm module version and modify system prompt handling in knowledge integration

This commit is contained in:
2025-04-12 03:42:16 -04:00
parent 1447b73dfb
commit ab1434d671
4 changed files with 7 additions and 6 deletions

View File

@@ -2,6 +2,7 @@ package agents
import (
"context"
gollm "gitea.stevedudenhoeffer.com/steve/go-llm"
)
@@ -76,10 +77,10 @@ func (a Agent) KnowledgeIntegrate(ctx context.Context, base Knowledge, in ...Kno
}),
)
_, err := a.WithSystemPrompt(`You are combining knowledge that has been observed in two states, the original knowledge is what was known before an action was taken, and the new knowledge is what was learned after an action was taken. If the new knowledge answers or opens any new questions, notes, or objectives you should add, edit, or remove them now. The original knowledge is as follows: ` + baseMsg.Text + ` The new knowledge is as follows: ` + incomingMsg.Text).
_, err := a.WithSystemPrompt(`You are combining knowledge that has been observed in two states, the original knowledge is what was known before an action was taken, and the new knowledge is what was learned after an action was taken. If the new knowledge answers or opens any new questions, notes, or objectives you should add, edit, or remove them now.`).
WithSystemPromptSuffix(``).
WithToolbox(tools).
CallAndExecute(ctx)
CallAndExecute(ctx, `The original knowledge is as follows: `+baseMsg.Text+` The new knowledge is as follows: `+incomingMsg.Text)
return result, err

View File

@@ -51,11 +51,9 @@ Here is the knowledge I have gathered from ` + fmt.Sprint(len(sources)) + ` sour
systemPrompt += "\n\nI still have some questions that I could not find an answer to:\n" + strings.Join(knowledge.RemainingQuestions, "\n")
}
systemPrompt += "\n\nUsing the sources, write an answer to the original question. Note any information that wasn't able to be answered."
res, err := a.WithSystemPrompt(systemPrompt).
WithSystemPromptSuffix(``).
CallAndExecute(ctx)
CallAndExecute(ctx, "Using the sources, write an answer to the original question. Note any information that wasn't able to be answered.")
if err != nil {
return "", err
}