Compare commits

..

3 Commits

Author SHA1 Message Date
mudler
672463b860 collect errors
Signed-off-by: mudler <mudler@localai.io>
2025-04-22 15:53:00 +02:00
Ettore Di Giacinto
0698e16768 Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-04-22 12:09:24 +02:00
mudler
7fcd5b86b9 feat: allow the agent to perform things concurrently
Signed-off-by: mudler <mudler@localai.io>
2025-04-22 12:08:54 +02:00
3 changed files with 2 additions and 8 deletions

View File

@@ -990,6 +990,7 @@ func (a *Agent) periodicallyRun(timer *time.Timer) {
}
func (a *Agent) Run() error {
a.startNewConversationsConsumer()
xlog.Debug("Agent is now running", "agent", a.Character.Name)
// The agent run does two things:
@@ -1012,12 +1013,7 @@ func (a *Agent) Run() error {
var muErr sync.Mutex
var wg sync.WaitGroup
parallelJobs := a.options.parallelJobs
if a.options.parallelJobs == 0 {
parallelJobs = 1
}
for i := 0; i < parallelJobs; i++ {
for i := 0; i <= a.options.parallelJobs; i++ {
xlog.Debug("Starting agent worker", "worker", i)
wg.Add(1)
go func() {

View File

@@ -64,7 +64,6 @@ func (o *options) SeparatedMultimodalModel() bool {
func defaultOptions() *options {
return &options{
parallelJobs: 1,
periodicRuns: 15 * time.Minute,
LLMAPI: llmOptions{
APIURL: "http://localhost:8080",

View File

@@ -25,7 +25,6 @@ var _ = Describe("Agent test", func() {
agent, err = New(
WithLLMAPIURL(apiURL),
WithModel(testModel),
WithTimeout("10m"),
WithRandomIdentity(),
)
Expect(err).ToNot(HaveOccurred())