diff --git a/backend/agents/orchestrator.go b/backend/agents/orchestrator.go index a7577a7..430699c 100644 --- a/backend/agents/orchestrator.go +++ b/backend/agents/orchestrator.go @@ -103,6 +103,8 @@ func (agent OrchestratorAgent) Orchestrate(userId uuid.UUID, imageId uuid.UUID, ToolChoice: &toolChoice, Tools: &tools, + EndToolCall: "defaultAgent", + Chat: &client.Chat{ Messages: make([]client.ChatMessage, 0), }, @@ -123,7 +125,7 @@ func (agent OrchestratorAgent) Orchestrate(userId uuid.UUID, imageId uuid.UUID, UserId: userId, } - return agent.client.Process(toolHandlerInfo, &request) + return agent.client.ToolLoop(toolHandlerInfo, &request) } func NewOrchestratorAgent(eventLocationAgent EventLocationAgent, noteAgent NoteAgent, imageName string, imageData []byte) (OrchestratorAgent, error) { @@ -136,7 +138,7 @@ func NewOrchestratorAgent(eventLocationAgent EventLocationAgent, noteAgent NoteA // We need a way to keep track of this async? // Probably just a DB, because we don't want to wait. The orchistrator shouldnt wait for this stuff to finish. - eventLocationAgent.GetLocations(info.UserId, info.ImageId, imageName, imageData) + go eventLocationAgent.GetLocations(info.UserId, info.ImageId, imageName, imageData) return Status{ Ok: true, @@ -144,7 +146,7 @@ func NewOrchestratorAgent(eventLocationAgent EventLocationAgent, noteAgent NoteA }) agent.ToolHandler.AddTool("noteAgent", func(info client.ToolHandlerInfo, args string, call client.ToolCall) (any, error) { - noteAgent.GetNotes(info.UserId, info.ImageId, imageName, imageData) + go noteAgent.GetNotes(info.UserId, info.ImageId, imageName, imageData) return Status{ Ok: true,