Skip to content

Commit

Permalink
Fix streaming_callback serialization in AmazonBedrockChatGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
FloRul committed Apr 24, 2024
1 parent 00354a6 commit 499d2dc
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def to_dict(self) -> Dict[str, Any]:
:returns:
Dictionary with serialized data.
"""
callback_name = serialize_callable(self.streaming_callback) if self.streaming_callback else None
return default_to_dict(
self,
aws_access_key_id=self.aws_access_key_id.to_dict() if self.aws_access_key_id else None,
Expand All @@ -220,7 +221,7 @@ def to_dict(self) -> Dict[str, Any]:
model=self.model,
stop_words=self.stop_words,
generation_kwargs=self.model_adapter.generation_kwargs,
streaming_callback=serialize_callable(self.streaming_callback),
streaming_callback=callback_name,
)

@classmethod
Expand Down

0 comments on commit 499d2dc

Please sign in to comment.