Skip to content

Commit 499d2dc

Browse files
committed
Fix streaming_callback serialization in AmazonBedrockChatGenerator
1 parent 00354a6 commit 499d2dc

File tree

1 file changed

+2
-1
lines changed
  • integrations/amazon_bedrock/src/haystack_integrations/components/generators/amazon_bedrock/chat

1 file changed

+2
-1
lines changed

integrations/amazon_bedrock/src/haystack_integrations/components/generators/amazon_bedrock/chat/chat_generator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ def to_dict(self) -> Dict[str, Any]:
210210
:returns:
211211
Dictionary with serialized data.
212212
"""
213+
callback_name = serialize_callable(self.streaming_callback) if self.streaming_callback else None
213214
return default_to_dict(
214215
self,
215216
aws_access_key_id=self.aws_access_key_id.to_dict() if self.aws_access_key_id else None,
@@ -220,7 +221,7 @@ def to_dict(self) -> Dict[str, Any]:
220221
model=self.model,
221222
stop_words=self.stop_words,
222223
generation_kwargs=self.model_adapter.generation_kwargs,
223-
streaming_callback=serialize_callable(self.streaming_callback),
224+
streaming_callback=callback_name,
224225
)
225226

226227
@classmethod

0 commit comments

Comments
 (0)