Commit 345c2e8
fix: prevent AttributeError in parse_vision_messages when llm is None
parse_vision_messages() defaults llm=None (vision disabled), but
unconditionally calls get_image_description() → llm.generate_response()
for list-typed and image_url-dict content. This crashes with
AttributeError: 'NoneType' object has no attribute 'generate_response'
when any message uses the standard multimodal content format.
Fix:
- Fast-path return when llm is None (no vision processing needed)
- For list-typed content, check if items actually contain image_url
before calling vision processing; pass through text-only lists
Fixes #47991 parent 6d3486c commit 345c2e8
1 file changed
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
173 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
174 | 181 | | |
175 | 182 | | |
176 | 183 | | |
| |||
179 | 186 | | |
180 | 187 | | |
181 | 188 | | |
182 | | - | |
183 | | - | |
184 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
185 | 199 | | |
186 | 200 | | |
187 | 201 | | |
| |||
0 commit comments