Commit 1de07ab
Generalize Continuous SystemMessage merging via model_info[“multiple_system_messages”] instead of
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>startswith("gemini-") (#6345)1 parent 99aac24 commit 1de07ab
2 files changed
Lines changed: 11 additions & 6 deletions
File tree
- python/packages/autogen-ext
- src/autogen_ext/models/openai
- tests/models
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
528 | | - | |
529 | | - | |
530 | | - | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
| |||
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
543 | | - | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
544 | 546 | | |
545 | 547 | | |
546 | 548 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2096 | 2096 | | |
2097 | 2097 | | |
2098 | 2098 | | |
2099 | | - | |
| 2099 | + | |
2100 | 2100 | | |
2101 | 2101 | | |
2102 | 2102 | | |
| |||
2109 | 2109 | | |
2110 | 2110 | | |
2111 | 2111 | | |
| 2112 | + | |
2112 | 2113 | | |
2113 | 2114 | | |
2114 | 2115 | | |
| |||
2157 | 2158 | | |
2158 | 2159 | | |
2159 | 2160 | | |
| 2161 | + | |
2160 | 2162 | | |
2161 | 2163 | | |
2162 | 2164 | | |
| |||
2180 | 2182 | | |
2181 | 2183 | | |
2182 | 2184 | | |
2183 | | - | |
| 2185 | + | |
2184 | 2186 | | |
2185 | 2187 | | |
2186 | 2188 | | |
| |||
2193 | 2195 | | |
2194 | 2196 | | |
2195 | 2197 | | |
| 2198 | + | |
2196 | 2199 | | |
2197 | 2200 | | |
2198 | 2201 | | |
| |||
0 commit comments