-
Notifications
You must be signed in to change notification settings - Fork 6.5k
add thinking_delta field to AgentStream events to expose Ollama's reasoning (feat: [19270]) #19785
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
Conversation
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.
Looks good, just two minor comments :)
| current_agent_name: str | ||
| tool_calls: list[ToolSelection] = Field(default_factory=list) | ||
| raw: Optional[Any] = Field(default=None, exclude=True) | ||
| thinking_delta: str = Field(default="") |
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.
I would use default_factorty = str. Non-blocking, tho
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.
Can we add some more comprehensive test that mocks the execution of an agent and streams the thinking delta? Just to make sure that everything is captured correctly
|
on a side note: @AstraBert do you think we could possibly modularise the CI tests, i.e. focusing on smaller sub-packages for any particular change? just curious :) |
|
For sub-packages like integrations, tests happen directly for those packages that have been changed, but for changes occurring in llama-index-core we want to make sure no unintended breaks are introduced, and the only way to do it is to always test for all core modules, even when the change is contained... Hope this explanation helps! |
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.
Looks good!
|
Of course, makes sense. Thank you! :D |
|
Perhaps using |
|
Valid question. In Ollama's ChatResponse implementation, the message param contains the FULL thinking text. When I fetch the thinking_delta however (which is not in |
…soning (feat: [19270]) (run-llama#19785) * add thinking_delta field to AgentStream events to expose Ollama's reasoning * adds more tests and updates default handling * fixes :(
Description
Fixes [Feature Request]: Expose Ollama "thinking" in FunctionAgent's AgentStream #19270
Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Your pull-request will likely not be merged unless it is covered by some form of impactful unit testing.
Suggested Checklist:
uv run make format; uv run make lintto appease the lint gods