-
-
Notifications
You must be signed in to change notification settings - Fork 11
DRAFT: Streaming support #23
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
|
||
protected function handleMessageStart(array $chunk): null | ||
{ | ||
// { |
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.
Not sure how to best store this information.
); | ||
} | ||
|
||
protected function handleReasoningContentBlockDelta(array $reasoningContent): Chunk |
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.
This is not tested yet.
); | ||
} | ||
|
||
protected function handleMetadata(array $chunk): void |
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.
Not sure what to do with this information.
'version' => config('prism.providers.bedrock.version', 'latest'), | ||
'credentials' => [ | ||
'key' => config('prism.providers.bedrock.api_key', ''), | ||
'secret' => config('prism.providers.bedrock.api_secret', ''), |
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.
you'll need to add 'token' => config('prism.providers.bedrock.session_token', ''),
to work with sts.
* 'main' of github.com:prism-php/bedrock: fix(converse): parameterless tools (prism-php#28) fix: prism >=v0.77.1 incompatibilities (prism-php#27) # Conflicts: # src/Bedrock.php
I have minimal viable stream working, but only tested with
anthropic.claude-3-5-sonnet-20240620-v1:0
.It is far from complete, and it was a bit harder than I expected...
I'm still finding my way around the different schema's and message formats.
I tried to keep things as 'Prism' as possible, but to get the stream even decoding working I had to use the aws sdk client in order to retrieve readable events from
converseStream
.Added this WIP PR for first feedback and to 'publish' the work to prevent doing double work if others are also working on this.