-
-
Notifications
You must be signed in to change notification settings - Fork 101
[AI Bundle][Agent] Add MultiAgent
#517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AI Bundle][Agent] Add MultiAgent
#517
Conversation
170c10b
to
4952511
Compare
e6ec748
to
c6014d8
Compare
8f8a195
to
9b52de4
Compare
@chr-hertel WDYT about: $multiAgent = new MultiAgent(
orchestrator: $orchestrator,
handoffs: [
new Handoff(to: $technical, when: ['bug', 'problem', 'technical', 'error']),
],
fallback/default: $general
logger: logger(),
); This way we can always fallback in any case, and when/triggers can be required. also not the |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this really looks promising, some thoughts tho:
- why using that json part in system prompt instead of structured output?
- we should slice down the multi agent class
- also great use case for prompt templates
- docs should explain the difference between using an agent as tool and this approach
434301b
to
1daadce
Compare
return $targetAgent->call($originalMessages, $options); | ||
} | ||
|
||
private function buildAgentSelectionPrompt(string $userQuestion): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in a follow up we could make this configurable for the multiagent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chr-hertel are you fine adding these methods here?
return null; | ||
} | ||
|
||
public function getUserMessageText(): ?string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or shall we add a asText
or toString
to UserMessage
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that work with the different kind of contents like Image or audio?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should ignore Image and Audio as those are not texts
73055cd
to
511f31f
Compare
Alright, this is great, no doubt about it - i like that with handoffs we can share the context between agents - different to agents as tools where we basically isolate them. but one thing that still made me wonder - why do we differentiate between multi-agent and agent - a bit confusing even when we think of an agent that has other agents as tools, but is not called multi agent. this is why i ended up with one idea, why not combine? agents:
orchestrator:
model: 'gpt-4o-mini'
prompt: '...'
tools: [...]
handoffs: [...] don't know how tho. just thinking it would be cool :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to merge with green pipeline
521b687
to
2017b73
Compare
Its green, but lets keep it open for know, I will try to get into your idea @chr-hertel |
f250d33
to
6e217e3
Compare
This is a first draft, lacking tests and feedback and everything 😄 I didn't even tried the example yet, but this is how it could look like. Ofc technical agent in this example could also be a MultiAgent and so on...
While the example and the
HandoffRule
class looks ok, I am not happy with theMultiAgent
class.