runChatKnowledge executes one knowledge call through the same plugin the agent uses (global adapter). Errors come back as a tool-result string so the model can correct the call instead of the turn failing.
(ctx context.Context, argsJSON string)
| 106 | // agent uses (global adapter). Errors come back as a tool-result string so |
| 107 | // the model can correct the call instead of the turn failing. |
| 108 | func (cli *ChatCLI) runChatKnowledge(ctx context.Context, argsJSON string) string { |
| 109 | out, err := plugins.NewBuiltinKnowledgePlugin().Execute(ctx, []string{argsJSON}) |
| 110 | if err != nil { |
| 111 | return "knowledge error: " + err.Error() |
| 112 | } |
| 113 | return out |
| 114 | } |
| 115 | |
| 116 | // appendKnowledgeRound folds one pull into the conversation being built for |
| 117 | // the next decision call: the pending prompt becomes a user turn, the model's |
no test coverage detected