Skip to content

AttributeError: 'ChatMessage' object has no attribute 'to_openai_format' #269

Closed
@JunK4i

Description

@JunK4i

haystack_integrations\tracing\langfuse\tracer.py", line 54, in set_content_tag
messages = [m.to_openai_format() for m in value["messages"]]
^^^^^^^^^^^^^^^^^^
AttributeError: 'ChatMessage' object has no attribute 'to_openai_format'

Deprecated to_openai_format() is causing issues with tracer.py.
Need to update tracer.py from deprecated function to the new function

Deprecated function:
m.to_openai_format()

Update to:
from haystack.components.generators.openai_utils import _convert_message_to_openai_format
_convert_message_to_openai_format(m)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions