Skip to content

Add support for RubyLLM::Message Content #17

Open

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

Activity

  1. nirga commented on Sep 19, 2025

    @nirga
    Member

    Thanks for reporting @aniamisiorek and sorry we missed this!
    We'll work on a fix if it's still relevant :)

  2. aniamisiorek commented on Oct 16, 2025

    @aniamisiorek
    Author

    Hey! We've started exploring this as an option again and we would love RubyLLM support :)

  3. sdhull commented on Oct 31, 2025

    @sdhull

    FWIW it seems like RubyLLM will emerge (or possibly is emerging) as the "official" ruby solution for interacting with LLMs. So supporting auto-instrumentation with RubyLLM would be a big win.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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