mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
## Summary
Fixed an issue where the `text` parameter was missing in requests to the
OpenAI Responses API.
## Changes Made
Modified the `ResponsesAgentThreadActions._generate_options()` method to
correctly handle the `text` parameter:
- Added to the options dictionary **only** if `text` is not `None`.
- Not added if it is an empty dict (the default value).
- This ensures that **only explicitly set `text` parameters** are sent
to the API.
## Fix Location
**File:**
`semantic_kernel/agents/open_ai/responses_agent_thread_actions.py`
**Before:**
```python
options = {
"model": merged.get("model"),
"top_p": merged.get("top_p"),
"temperature": merged.get("temperature"),
"truncation": truncation,
"metadata": merged.get("metadata"),
"max_output_tokens": max_output_tokens,
"parallel_tool_calls": parallel_tool_calls,
}
```
**After:**
```python
options = {
"model": merged.get("model"),
"top_p": merged.get("top_p"),
"temperature": merged.get("temperature"),
"truncation": truncation,
"metadata": merged.get("metadata"),
"max_output_tokens": max_output_tokens,
"parallel_tool_calls": parallel_tool_calls,
}
# Add text option if it exists
if merged.get("text") is not None:
options["text"] = merged.get("text")
```
- Closes #13281
### 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 😄
---------
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Evan Mattson <[email protected]>