You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Current OnCondition string is just a plain text describing the condition when the handoff function to be chose.
However, such an implementation can not solve some complex logic like " transfer to Agent B when context_variables['situation'] == 'B' "
So, I would like to build a new interface for OnCondition string which can load context_variables.
Describe the solution you'd like
So, I would like to build a new interface for OnCondition string which can load context_variables.
current class UPDATE_SYSTEM_MESSAGE has implemented context_variable loading in a string. We can build a similar class (like UPDATE_ONCONDITION) or a more general class.
The final interface for OnCondition may look like:
agentA.register_hand_off(ON_CONDITION( agentB, UPDATE_ONCONDITION('Transfer to Agent B when {key} is B '), available))
Additional context
Compare with ON_CONDITION.available:
ON_CONDITION.available can also load a callable function to check the value of context variables, but it is the prerequisite for condition string, which means it is an 'and' logic between available and OnCondition string.
While an OnCondition string can enable more versatile logic between context variables and text-described situation, e.g.
ON_CONDITION(agentC,
UPDATE_ONCONDITION("transfer to AgentC when user is frustrated or {situation} == 'B' or {situation} == 'C' "),
'user_login')
The text was updated successfully, but these errors were encountered:
Thanks @linmou, I've tested it and it works as expected, injecting the context variable into the condition. The LLM avoided calling the hand off function when the condition in the string was false.
My sample hand-off for testing:
register_hand_off(
order_triage_agent,
[
OnCondition(
target=authentication_agent,
condition="The customer is not logged in, authenticate the customer.",
available="requires_login",
),
OnCondition(
target=order_mgmt_agent,
condition=UpdateCondition("The customer is logged in, continue with the order triage if {customer_tier} == 2."),
available="logged_in",
),
AfterWork(AfterWorkOption.REVERT_TO_USER),
],
)
Thanks for using the swarm to conversable agent branch to make the change and for following the UpdateSystemMessage convention.
@sonichi, are you able to provide your feedback on this change in PR #349
Is your feature request related to a problem? Please describe.
Current OnCondition string is just a plain text describing the condition when the handoff function to be chose.
However, such an implementation can not solve some complex logic like " transfer to Agent B when context_variables['situation'] == 'B' "
So, I would like to build a new interface for OnCondition string which can load context_variables.
Describe the solution you'd like
So, I would like to build a new interface for OnCondition string which can load context_variables.
current class UPDATE_SYSTEM_MESSAGE has implemented context_variable loading in a string. We can build a similar class (like UPDATE_ONCONDITION) or a more general class.
The final interface for OnCondition may look like:
Additional context
Compare with ON_CONDITION.available:
ON_CONDITION.available can also load a callable function to check the value of context variables, but it is the prerequisite for condition string, which means it is an 'and' logic between available and OnCondition string.
While an OnCondition string can enable more versatile logic between context variables and text-described situation, e.g.
The text was updated successfully, but these errors were encountered: