Refactor Knowledge struct into shared package

Moved the Knowledge struct and related types to the shared package, updating all references across the codebase. This improves modularity and enables better reuse of the Knowledge type across different components.
This commit is contained in:
2025-05-03 22:09:02 -04:00
parent d2b9eb350e
commit 1c3ea7d1f1
11 changed files with 63 additions and 51 deletions

View File

@@ -23,12 +23,12 @@ type Agent struct {
// Model is the chat completion model to use
Model gollm.ChatCompletion
OnLoopComplete func(ctx context.Context, knowledge agents.Knowledge) error
OnLoopComplete func(ctx context.Context, knowledge shared.Knowledge) error
OnCommandStart func(ctx context.Context, command string) error
OnCommandDone func(ctx context.Context, command string, output string, err error) error
OnDone func(ctx context.Context, knowledge agents.Knowledge) error
OnDone func(ctx context.Context, knowledge shared.Knowledge) error
ContextualInformation []string
@@ -36,7 +36,7 @@ type Agent struct {
}
type Response struct {
Knowledge agents.Knowledge
Knowledge shared.Knowledge
DataDir string
OutputDir string
}
@@ -52,7 +52,7 @@ func (a Agent) Answer(ctx context.Context, questions []string) (Response, error)
a.MaxCommands = 20 // Default to 20 commands as per requirements
}
res.Knowledge = agents.Knowledge{
res.Knowledge = shared.Knowledge{
OriginalQuestions: questions,
RemainingQuestions: questions,
}