Skip to content

Commit

Permalink
serialize the callback
Browse files Browse the repository at this point in the history
  • Loading branch information
ZanSara committed Feb 20, 2024
1 parent 3a6cf81 commit 818e7bf
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import boto3
from botocore.exceptions import BotoCoreError, ClientError
from haystack import component, default_from_dict, default_to_dict
from haystack.components.generators.utils import deserialize_callback_handler
from haystack.components.generators.utils import deserialize_callback_handler, serialize_callback_handler
from haystack.dataclasses import ChatMessage, StreamingChunk
from haystack.utils.auth import Secret, deserialize_secrets_inplace

Expand Down Expand Up @@ -248,7 +248,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=self.streaming_callback,
streaming_callback=serialize_callback_handler(self.streaming_callback),
)

@classmethod
Expand Down

0 comments on commit 818e7bf

Please sign in to comment.