-
Notifications
You must be signed in to change notification settings - Fork 488
fix: message delta visibility for anthropic fixed #2212
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?
Changes from all commits
9ff2bb1
1f16e08
ddbbfaa
92d840a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@llamaindex/workflow": patch | ||
| "@llamaindex/anthropic": patch | ||
| --- | ||
|
|
||
| fix: message delta visibility for anthropic | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -197,6 +197,7 @@ export class FunctionAgent implements BaseWorkflowAgent { | |
| let lastChunk: ChatResponseChunk | undefined; | ||
| const toolCalls: Map<string, AgentToolCall> = new Map(); | ||
| for await (const chunk of responseStream) { | ||
| lastChunk = chunk; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because in the following code snippet the raw chunk that is being returned takes the value from lastChunk.raw, in the earlier code, lastChunk was beind defined, but never assigned a value, thus lastChunk always had the value as |
||
| response += chunk.delta; | ||
| ctx.sendEvent( | ||
| agentStreamEvent.with({ | ||
|
|
||
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.
We need a change set what we are fixing for workflow in this PR
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.
Oh I see, I was going through CONTRIBUTING.md and since this wasn't a feature, I thought that this wouldn't need a changeset, I'm sorry about it
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.
yes. sure, that would be great!