Skip to content

Add support for RubyLLM::Message Content #17

@aniamisiorek

Description

@aniamisiorek

Currently, when using RubyLLM as the LLM client, openllmetry throws an error (undefined method 'has_key?' for an instance of RubyLLM::Message) when attempting to log the response. RubyLLM uses the message object, which can be seen here:

Response object: #<RubyLLM::Message:0x00000001350b08c0 @role=:assistant, 
@content=#<RubyLLM::Content:0x00000001321134c8 @text="{\"action\":\"NONE\"}", @attachments=[]>, 
@tool_calls=nil, @input_tokens=958, @output_tokens=9, @model_id="claude-3-5-sonnet-20240620", @tool_call_id=nil>

The source code also appears here:
https://github.com/crmne/ruby_llm/blob/e7521c98a5c39ca8ad79b9d0f2a9d74efc67535c/lib/ruby_llm/message.rb#L7

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