From 8a16ad5407bfe04710fbf9a3e230b8099cf254d5 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Thu, 19 Feb 2026 21:25:05 +0000 Subject: [PATCH] feat: bump cogito, use LocalAILLM Signed-off-by: Ettore Di Giacinto --- core/agent/agent.go | 6 ++++-- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/agent/agent.go b/core/agent/agent.go index 3e50727..523a41c 100644 --- a/core/agent/agent.go +++ b/core/agent/agent.go @@ -15,6 +15,8 @@ import ( "github.com/modelcontextprotocol/go-sdk/mcp" "github.com/mudler/cogito" + "github.com/mudler/cogito/clients" + "github.com/mudler/xlog" "github.com/mudler/LocalAGI/core/action" @@ -89,7 +91,7 @@ func New(opts ...Option) (*Agent, error) { } client := llm.NewClient(options.LLMAPI.APIKey, options.LLMAPI.APIURL, options.timeout) - llmClient := cogito.NewOpenAILLM(options.LLMAPI.Model, options.LLMAPI.APIKey, options.LLMAPI.APIURL) + llmClient := clients.NewLocalAILLM(options.LLMAPI.Model, options.LLMAPI.APIKey, options.LLMAPI.APIURL) c := context.Background() if options.context != nil { c = options.context @@ -1123,7 +1125,7 @@ func (a *Agent) consumeJob(job *types.Job, role string) { cogitoOpts = append(cogitoOpts, cogito.EnableAutoPlanReEvaluator) } if a.options.LLMAPI.ReviewerModel != "" { - llmClient := cogito.NewOpenAILLM(a.options.LLMAPI.ReviewerModel, a.options.LLMAPI.APIKey, a.options.LLMAPI.APIURL) + llmClient := clients.NewLocalAILLM(a.options.LLMAPI.ReviewerModel, a.options.LLMAPI.APIKey, a.options.LLMAPI.APIURL) cogitoOpts = append(cogitoOpts, cogito.WithReviewerLLM(llmClient)) } } diff --git a/go.mod b/go.mod index a1c169b..0d96eb9 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/google/uuid v1.6.0 github.com/jung-kurt/gofpdf v1.16.2 github.com/modelcontextprotocol/go-sdk v1.1.0 - github.com/mudler/cogito v0.9.1-0.20260217143801-bb7f986ed2c7 + github.com/mudler/cogito v0.9.2-0.20260219212236-5c89648cf8cc github.com/mudler/xlog v0.0.1 github.com/onsi/ginkgo/v2 v2.25.3 github.com/onsi/gomega v1.38.2 diff --git a/go.sum b/go.sum index d12a6f4..1b79676 100644 --- a/go.sum +++ b/go.sum @@ -238,6 +238,8 @@ github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM= github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw= github.com/mudler/cogito v0.9.1-0.20260217143801-bb7f986ed2c7 h1:z3AcM7LbaQb+C955JdSXksHB9B0uWGQpdgl05gJM+9Y= github.com/mudler/cogito v0.9.1-0.20260217143801-bb7f986ed2c7/go.mod h1:6sfja3lcu2nWRzEc0wwqGNu/eCG3EWgij+8s7xyUeQ4= +github.com/mudler/cogito v0.9.2-0.20260219212236-5c89648cf8cc h1:AJm0Xy+UtKQXrI2+QIowl+0MDTdZn2qAmXWTeTTwWFw= +github.com/mudler/cogito v0.9.2-0.20260219212236-5c89648cf8cc/go.mod h1:6sfja3lcu2nWRzEc0wwqGNu/eCG3EWgij+8s7xyUeQ4= github.com/mudler/xlog v0.0.1 h1:yR3/wszd3ZM6u1n96YITJZ4yUcDgqHSwvQmzUJa+8vg= github.com/mudler/xlog v0.0.1/go.mod h1:39f5vcd05Qd6GWKM8IjyHNQ7AmOx3ZM0YfhfIGhC18U= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=