-
-
Notifications
You must be signed in to change notification settings - Fork 479
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: crmne/ruby_llm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.13.0
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: crmne/ruby_llm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.13.1
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 5 commits
- 10 files changed
- 3 contributors
Commits on Mar 4, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 526c9a0 - Browse repository at this point
Copy the full SHA 526c9a0View commit details -
Fix binary attachment reads on Windows
Use File.binread for path attachments to avoid text-mode truncation on Windows and add a regression spec ensuring path attachments are read in binary mode.
Configuration menu - View commit details
-
Copy full SHA for b8df073 - Browse repository at this point
Copy the full SHA b8df073View commit details -
Fix schema JSON parsing for intermediate tool-call responses (#650)
## Summary Fixes #649 When both `with_schema` and `with_tool` are used together, the `complete` method unconditionally parses any string `response.content` as JSON whenever a schema is set — including intermediate responses that also contain tool calls. On the next API call, the parsed Hash gets serialized as `{ type: "text", text: <Hash> }`, which providers like Anthropic reject with: ``` text.text: Input should be a valid string ``` ### Root cause In `lib/ruby_llm/chat.rb`, the JSON parsing condition: ```ruby if @Schema && response.content.is_a?(String) ``` does not check whether the response is an intermediate tool-call response, so it eagerly parses content that should remain as a plain string. ### Fix Add a `!response.tool_call?` guard so JSON parsing is only applied to the final (non-tool-call) response: ```ruby if @Schema && response.content.is_a?(String) && !response.tool_call? ``` ### Test Added a regression test that mocks the provider to return an intermediate tool-call response with JSON-like text content, verifying that: - The intermediate tool-call message keeps its content as a `String` - The final non-tool-call response has its content parsed into a `Hash` --------- Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Carmine Paolino <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for beec837 - Browse repository at this point
Copy the full SHA beec837View commit details -
Populate Gemini cached token usage
Map usageMetadata.cachedContentTokenCount to cached_tokens for Gemini chat responses and streaming chunks, and add provider specs covering both paths.
Configuration menu - View commit details
-
Copy full SHA for 1094945 - Browse repository at this point
Copy the full SHA 1094945View commit details -
Configuration menu - View commit details
-
Copy full SHA for 97c0546 - Browse repository at this point
Copy the full SHA 97c0546View commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 1.13.0...1.13.1