Merge pull request #3014 from jlowin/claude/issue-3011-20260128-0658

This commit is contained in:
Bill Easton 2026-01-31 15:00:53 -06:00 committed by GitHub
commit 70f0fd3a0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -634,7 +634,8 @@ async def sample_impl(
# Continue with the updated history
current_messages = step.history
# After first iteration, reset tool_choice to auto
tool_choice = None
# After first iteration, reset tool_choice to auto (unless structured output is required)
if result_type is None or result_type is str:
tool_choice = None
raise RuntimeError(f"Sampling exceeded maximum iterations ({max_iterations})")