Skip to content

Conversation

@miri-bar
Copy link
Contributor

No description provided.

@github-actions github-actions bot added documentation Documentation Update aws size:xl labels Jul 28, 2024
@github-actions github-actions bot added size:xl and removed size:xl labels Jul 29, 2024
@github-actions github-actions bot added size:xl and removed size:xl labels Jul 29, 2024
@github-actions github-actions bot added size:xl and removed size:xl labels Jul 29, 2024
@github-actions github-actions bot added size:xl and removed size:xl labels Jul 29, 2024
@github-actions github-actions bot added size:xl and removed size:xl labels Jul 29, 2024
@github-actions github-actions bot added size:xl and removed size:xl labels Jul 29, 2024
@miri-bar miri-bar requested a review from a team July 29, 2024 15:30
@miri-bar miri-bar requested a review from Josephasafg August 4, 2024 14:04
chunk_dict = {**chunk_dict, **bedrock_metrics_dict}
return json.dumps(chunk_dict)

def _process_chunks(self, event_stream_buffer, chunk):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing types

ai21/errors.py Outdated
class StreamingDecodeError(AI21Error):
def __init__(self, chunk: str, error_message: Optional[str] = None):
message = f"Failed to decode chunk: {chunk} in stream. Please check the stream format"
message = f"Failed to decode chunk: {chunk} in stream. Please check the stream format. "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its weird to add a space at the end of the string "just in case"
You can do something like -

if error_message:
    message = f"{message} Error: {error_message}"

pass


class _SSEDecoder(SSEDecoderBase):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this class is protected then I assume the rest should be too no?

@github-actions github-actions bot added the lgtm Looks Good to Me label Aug 5, 2024
@miri-bar miri-bar merged commit 5392b52 into main Aug 6, 2024
@miri-bar miri-bar deleted the bedrock_streaming branch August 6, 2024 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws documentation Documentation Update lgtm Looks Good to Me size:xl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants