Skip to content

Commit 96ef663

Browse files
chore: removing ChatMessage warning message (#9176)
* removing warning message * removing unused imports
1 parent c81d684 commit 96ef663

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

haystack/dataclasses/chat_message.py

-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
import inspect
65
import json
76
from dataclasses import asdict, dataclass, field
87
from enum import Enum
@@ -333,17 +332,6 @@ def to_dict(self) -> Dict[str, Any]:
333332
Serialized version of the object.
334333
"""
335334

336-
# We don't want to show the warning if ChatMessage.to_dict is used in pipeline serialization
337-
used_in_pipeline_serialization = any(
338-
frame.function == "component_to_dict" and "serialization.py" in frame.filename for frame in inspect.stack()
339-
)
340-
if not used_in_pipeline_serialization:
341-
logger.warning(
342-
"Starting from Haystack 2.12.0, ChatMessage.to_dict returns a dictionary with keys 'role', "
343-
"'meta', 'name', and 'content' instead of '_role', '_meta', '_name', and '_content'. "
344-
"If your code consumes this dictionary, please update it to use the new format."
345-
)
346-
347335
serialized: Dict[str, Any] = {}
348336
serialized["role"] = self._role.value
349337
serialized["meta"] = self._meta

0 commit comments

Comments
 (0)