autogen
autogen copied to clipboard
Fix Exception in a_generate_reply when function_call is None
Why are these changes needed?
After executing generate_reply or a_generate_reply for an agent with a tool, the generated response (using the GPT-4o-mini model) contains "function_call"=None. If we call that function again, it causes an exception in the case of a_generate_reply (but not in generate_reply).
Related issue number
None
Checks
- [x] I've included any doc changes needed for https://microsoft.github.io/autogen/. See https://microsoft.github.io/autogen/docs/Contribute#documentation to build and test documentation locally.
- [x] I've added tests (if relevant) corresponding to the changes introduced in this PR.
- [x] I've made sure all auto checks have passed.
lgtm