-
Notifications
You must be signed in to change notification settings - Fork 263
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
add new class UpdateCondition to load context variables in OnCondition.condition #349
add new class UpdateCondition to load context variables in OnCondition.condition #349
Conversation
Thanks @linmou, looks good, I'll give it a test :) |
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:
Thanks for using the swarm to conversable agent branch to make the change and for following the UpdateSystemMessage convention. |
@linmou, could you add to the documentation in 'swarm.ipynb' under: |
@marklysze Thanks for your review and test, also thanks for your implementation of UpdateSystemMessage which inspires me a lot. I have add the document, please check and add your review. |
Signed-off-by: Mark Sze <[email protected]>
Signed-off-by: Mark Sze <[email protected]>
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.
Thanks @linmou, looks good!
Why are these changes needed?
This PR solved the feature request in Issue #348 . About a more flexible way to customize the OnCondition.condition string.
The branch is built upon PR #316 I build a new UpdateCondition class, very similar to UpdateSystemMessage. So that OnCondition.condition can be a callable or string format which can load context variables.
And the logic for _update_conditional_functions is changed a little bit to ensure the registered functions are updated.
Related issue number
issue #348
Checks
I've included any doc changes needed for https://docs.ag2.ai/. See https://docs.ag2.ai/docs/contributor-guide/documentation to build and test documentation locally.
I've added tests (if relevant) corresponding to the changes introduced in this PR.
I've made sure all auto checks have passed.