Fix Ollama API compatibility for newer versions#443
Open
Samay10 wants to merge 1 commit intogoogle:mainfrom
Open
Fix Ollama API compatibility for newer versions#443Samay10 wants to merge 1 commit intogoogle:mainfrom
Samay10 wants to merge 1 commit intogoogle:mainfrom
Conversation
Ollama API changed response structure in newer versions, moving
generated content from 'response' key to 'thinking' key. This fix
adds backward compatibility by checking both keys.
- Handle both old ('response') and new ('thinking') API formats
- Added comprehensive test for new response structure
- Updated documentation to reflect API changes
Fixes compatibility with Ollama versions that use 'thinking' key.
|
No linked issues found. Please link an issue in your pull request description or title. Per our Contributing Guidelines, all PRs must:
You can also use cross-repo references like |
|
Your branch is 1 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #413
Description
Ollama API changed response structure in newer versions, moving generated content from
responsetothinking. This update adds backward compatibility by readingresponsefirst and falling back tothinkingwhenresponseis empty.response) and new (thinking) Ollama API response formatsthinkingresponse caseHow Has This Been Tested?
thinkingpytest tests/inference_test.py::TestOllamaLanguageModel./autoformat.shand pre-commit formatting checksChecklist