-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Adding ThinkingBlock to Ollama and Bedrock Converse #19936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
585b355
feat: thinking block in Ollama
AstraBert 0f9c6be
feat: add support for thinking + thinking block to Bedrock Converse
AstraBert 659d5dc
Merge branch 'main' into clelia/ollama-and-bedrock-thinking
AstraBert 1f66fb7
chore: vbump and lock
AstraBert 17cca1d
chore: typedict from typing_extensions
AstraBert 07ec9d7
chore: make python 3.9 happy
AstraBert 2541823
chore: bedrock tests
AstraBert 18f3cf5
chore: implement PR review suggestions
AstraBert 38b940e
Merge branch 'main' into clelia/ollama-and-bedrock-thinking
AstraBert 6b8d786
chore: clean up merge mess
AstraBert 7532d20
chore: adjust tests for bedrock converse
AstraBert 22dc500
Merge branch 'main' into clelia/ollama-and-bedrock-thinking
logan-markewich f39062c
some thinking nits with ollama
logan-markewich bbf087e
thinking corrections in bedrock converse
logan-markewich caa0e4e
make bedrock thinking work
logan-markewich cfb716e
add back ollama thinking delta properly
logan-markewich 6b6c2b0
make lint
logan-markewich fa0d8b0
Merge branch 'main' into clelia/ollama-and-bedrock-thinking
logan-markewich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ dev = [ | |
|
||
[project] | ||
name = "llama-index-llms-bedrock-converse" | ||
version = "0.9.5" | ||
version = "0.10.0" | ||
description = "llama-index llms bedrock converse integration" | ||
authors = [{name = "Your Name", email = "[email protected]"}] | ||
requires-python = ">=3.9,<4.0" | ||
|
@@ -38,7 +38,7 @@ license = "MIT" | |
dependencies = [ | ||
"boto3>=1.38.27,<2", | ||
"aioboto3>=15.0.0,<16", | ||
"llama-index-core>=0.13.0,<0.15", | ||
"llama-index-core>=0.14.3,<0.15", | ||
] | ||
|
||
[tool.codespell] | ||
|
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it only returning the full thinking/reasoning text? Or is it streaming?
If its streaming, setting
thinking = ""
means we are removing the complete thinking string right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to update the tests to check if the thinking is over, like, 50 chars?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I tested the streaming behavior, this basically means that we have separate thinking chunks for each streamed response, instead of an incrementally growing response. So, rather than this:
We would have this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the test for the streaming of thinking blocks does not check for the character length, it checks for the number of thinking blocks produced (which should be non-zero). I will add a test for character length, tho, to test the streaming