mirror of
https://github.com/microsoft/autogen.git
synced 2025-08-24 00:22:05 +00:00

The current implementation of consecutive `SystemMessage` merging applies only to models where `model_info.family` starts with `"gemini-"`. Since PR #6327 introduced the `multiple_system_messages` field in `model_info`, we can now generalize this logic by checking whether the field is explicitly set to `False`. This change replaces the hardcoded family check with a conditional that merges consecutive `SystemMessage` blocks whenever `multiple_system_messages` is set to `False`. Test cases that previously depended on the `"gemini"` model family have been updated to reflect this configuration flag, and renamed accordingly for clarity. In addition, for consistency across conditional logic, a follow-up PR is planned to refactor the Claude-specific transformation condition (currently implemented via `create_args.get("model", "unknown").startswith("claude-")`) to instead use the existing `is_claude()`. Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>