Deprecate loop attribute to fix conflict with Kernel.loop (fixes #11) #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
loopparameter inChatCompletionto avoid conflicts with Ruby'sKernel.loopmax_tool_callsparameter to prevent infinite tool invocation loopsDetails
This PR addresses issue #11 by implementing a better solution than simply renaming the attribute. Instead of requiring users to specify
loop: true, the system now automatically continues conversations after tool calls until the AI provides a text response.Key Changes:
Automatic Continuation: Chat completions now automatically continue after tool calls, making the API more intuitive.
Deprecation Warning: The
loopparameter still works but shows a deprecation warning to ease migration.Tool Call Limiting: Added
max_tool_callsparameter (default: 25) to prevent infinite loops.Simplified API: Tool functions now just return their results - no need to manually handle continuation.
Breaking Changes:
loopparameter is deprecated (functional with warning)stop_looping\!renamed tostop_tool_calls_and_respond\!Migration Guide:
Test plan
max_tool_callsparameterloopparameter🤖 Generated with Claude Code