Add streaming tool result events#20613
Open
ai-fanatic wants to merge 3 commits intorun-llama:mainfrom
Open
Conversation
| default="force", | ||
| description="Method to handle max iterations. 'force' raises an error (default). 'generate' makes one final LLM call to generate a response.", | ||
| ) | ||
| use_native_structured_output: bool = Field( |
Collaborator
There was a problem hiding this comment.
I think some of these changes weren't intended to be in this PR?
| @@ -342,42 +347,69 @@ def call(self, *args: Any, **kwargs: Any) -> ToolOutput: | |||
|
|
|||
| async def acall(self, *args: Any, **kwargs: Any) -> ToolOutput: | |||
Collaborator
There was a problem hiding this comment.
Why only acall? Why not the sync version as well? Had a similar comment on another user that attempted this PR
#20552
92474d2 to
fca65af
Compare
Author
|
Thanks for the review.
Checks run:
|
Collaborator
|
Author
|
Fixed the mypy errors in FunctionTool.acall_stream by explicitly typing raw_output as Any before checking awaitable/iterable branches. Pushed commit 4a3a178 to feature/native-structured-output-18412. |
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.
Summary
acall_stream) with async generator handling inFunctionToolToolCallResultevents and ignore them during aggregation to avoid early completionTesting
uv run pre-commit run --show-diff-on-failure --files <changed files>(Windows; equivalent tomake lint)uv run -- pytest llama-index-core/tests/agent/workflow/test_tool_streaming.pyAI Assistance
I used ChatGPT/Codex to help draft the changes. I reviewed the code and verified behavior via the lint and test commands above.
Issue
Relates to #20409