fix: re-requesting image when all agents are done
This means the agents are no longer parallel. Which will eventually be a bottleneck, but I need to spend a bit more time on allowing for it to be parallel, but now is not the time. TODO: add a ticket
This commit is contained in:
@ -139,25 +139,25 @@ func NewOrchestratorAgent(log *log.Logger, noteAgent NoteAgent, contactAgent cli
|
|||||||
})
|
})
|
||||||
|
|
||||||
agent.ToolHandler.AddTool("noteAgent", func(info client.ToolHandlerInfo, args string, call client.ToolCall) (any, error) {
|
agent.ToolHandler.AddTool("noteAgent", func(info client.ToolHandlerInfo, args string, call client.ToolCall) (any, error) {
|
||||||
go noteAgent.GetNotes(info.UserId, info.ImageId, imageName, imageData)
|
noteAgent.GetNotes(info.UserId, info.ImageId, imageName, imageData)
|
||||||
|
|
||||||
return "noteAgent called successfully", nil
|
return "noteAgent called successfully", nil
|
||||||
})
|
})
|
||||||
|
|
||||||
agent.ToolHandler.AddTool("contactAgent", func(info client.ToolHandlerInfo, args string, call client.ToolCall) (any, error) {
|
agent.ToolHandler.AddTool("contactAgent", func(info client.ToolHandlerInfo, args string, call client.ToolCall) (any, error) {
|
||||||
go contactAgent.RunAgent(info.UserId, info.ImageId, imageName, imageData)
|
contactAgent.RunAgent(info.UserId, info.ImageId, imageName, imageData)
|
||||||
|
|
||||||
return "contactAgent called successfully", nil
|
return "contactAgent called successfully", nil
|
||||||
})
|
})
|
||||||
|
|
||||||
agent.ToolHandler.AddTool("locationAgent", func(info client.ToolHandlerInfo, args string, call client.ToolCall) (any, error) {
|
agent.ToolHandler.AddTool("locationAgent", func(info client.ToolHandlerInfo, args string, call client.ToolCall) (any, error) {
|
||||||
go locationAgent.RunAgent(info.UserId, info.ImageId, imageName, imageData)
|
locationAgent.RunAgent(info.UserId, info.ImageId, imageName, imageData)
|
||||||
|
|
||||||
return "locationAgent called successfully", nil
|
return "locationAgent called successfully", nil
|
||||||
})
|
})
|
||||||
|
|
||||||
agent.ToolHandler.AddTool("eventAgent", func(info client.ToolHandlerInfo, args string, call client.ToolCall) (any, error) {
|
agent.ToolHandler.AddTool("eventAgent", func(info client.ToolHandlerInfo, args string, call client.ToolCall) (any, error) {
|
||||||
go eventAgent.RunAgent(info.UserId, info.ImageId, imageName, imageData)
|
eventAgent.RunAgent(info.UserId, info.ImageId, imageName, imageData)
|
||||||
|
|
||||||
return "eventAgent called successfully", nil
|
return "eventAgent called successfully", nil
|
||||||
})
|
})
|
||||||
|
@ -44,15 +44,6 @@ const getAllValues = (object: object): Array<string> => {
|
|||||||
return loop([], object);
|
return loop([], object);
|
||||||
};
|
};
|
||||||
|
|
||||||
// On fast connections (or locally), the DB will send the complete update before the image has been fully saved.
|
|
||||||
// This is because it shouldn't really be an update, and that is hacky but hey. It works.
|
|
||||||
// The tech debt will be collected eventually.
|
|
||||||
//
|
|
||||||
// AND MORE IMPORTANTLY. The fucking AI agents aren't done.
|
|
||||||
// hhhhhhhhhhhhhhhhhhhhmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
|
|
||||||
// wait groups.
|
|
||||||
const BIG_SHAME_TIMEOUT = 5000;
|
|
||||||
|
|
||||||
const SearchImageContext = createContext<SearchImageStore>();
|
const SearchImageContext = createContext<SearchImageStore>();
|
||||||
export const SearchImageContextProvider: Component<ParentProps> = (props) => {
|
export const SearchImageContextProvider: Component<ParentProps> = (props) => {
|
||||||
const [images, { refetch }] = createResource(() =>
|
const [images, { refetch }] = createResource(() =>
|
||||||
@ -68,7 +59,7 @@ export const SearchImageContextProvider: Component<ParentProps> = (props) => {
|
|||||||
<SearchImageContext.Provider
|
<SearchImageContext.Provider
|
||||||
value={{
|
value={{
|
||||||
images,
|
images,
|
||||||
onRefetchImages: () => setTimeout(refetch, BIG_SHAME_TIMEOUT),
|
onRefetchImages: refetch,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{props.children}
|
{props.children}
|
||||||
|
Reference in New Issue
Block a user