-
-
Notifications
You must be signed in to change notification settings - Fork 137
[Agent][Platform][OpenAI] Add stream usage support #754
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
base: main
Are you sure you want to change the base?
Conversation
12669c7 to
e0ad357
Compare
| // Chunk also contain metadata | ||
| // $textChunk->getMetadata()->get('id'); // Stream id |
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.
remove?
| /** @var TextChunk $textChunk */ | ||
| foreach ($result->getContent() as $textChunk) { | ||
|
|
||
| // $textChunk implement \Stringable |
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.
remove
bcbc538 to
1535511
Compare
| ], | ||
| ]); | ||
|
|
||
| // Output text chunks |
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.
| // Output text chunks |
…ing results integration
…ring content type
… replace `StreamChunk` with `TextChunk`
- Remove irrelevant comments. - Enhance readability. - Eliminate unused instantiations.
chr-hertel
left a comment
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.
Thanks for tackling this - one thing that get's me thinking here is that different behavior from dev point of view with extra set of option and metadata key.
usually i'd activate the TokenOutputProcessor and expect to have the key token_usage on the result metadata. that expectation is not working with your current approach leading to an inconsistent API for developers in my opinion.
Is it possible from your point of view to get rid of the extra option and still use the token_usage key on the result metadata?
i get the issue with multiple calls - so maybe #1051 might help?
let me know what you think - thanks already!
|
@chr-hertel , thanks for the feedback. Your approach with On the other side, the |
|
Yeah, makes sense - that looks tricky - you needed to do the metadata handling at various places. |
Uh oh!
There was an error while loading. Please reload this page.