Skip to content

Commit b4ed05e

Browse files
Python: Throw exception on image error (#12410)
### Motivation and Context ### Description This small PR throws the forgotten exception on image error. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Signed-off-by: Emmanuel Ferdman <[email protected]>
1 parent 2f84e5d commit b4ed05e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,9 @@ def _prepare_chat_history_for_request(
699699
image_url = str(content.uri)
700700

701701
if not image_url:
702-
ValueError("ImageContent must have either a data_uri or uri set to be used in the request.")
702+
raise ValueError(
703+
"ImageContent must have either a data_uri or uri set to be used in the request."
704+
)
703705

704706
contents.append({"type": "input_image", "image_url": image_url})
705707
response_inputs.append({"role": original_role, "content": contents})

0 commit comments

Comments
 (0)