Sha256: 042679e31b8786dc13dbbc772002583c9e666d9adfcc5f9ab019fe83723d3703

Contents?: true

Size: 755 Bytes

Versions: 13

Compression:

Stored size: 755 Bytes

Contents

# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

module NewRelic::Agent::Instrumentation
  module OpenAI::Prepend
    include NewRelic::Agent::Instrumentation::OpenAI

    # In versions 4.0.0+ json_post is an instance method defined in the
    # OpenAI::HTTP module, included by the OpenAI::Client class.
    #
    # In versions below 4.0.0 json_post is a class method on OpenAI::Client.
    #
    # Dependency detection will apply the instrumentation to the correct scope,
    # so we don't need to change the code here.
    def json_post(**kwargs)
      json_post_with_new_relic(**kwargs) { super }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
newrelic_rpm-9.17.0 lib/new_relic/agent/instrumentation/ruby_openai/prepend.rb
newrelic_rpm-9.16.1 lib/new_relic/agent/instrumentation/ruby_openai/prepend.rb
newrelic_rpm-9.16.0 lib/new_relic/agent/instrumentation/ruby_openai/prepend.rb
newrelic_rpm-9.15.0 lib/new_relic/agent/instrumentation/ruby_openai/prepend.rb
newrelic_rpm-9.14.0 lib/new_relic/agent/instrumentation/ruby_openai/prepend.rb
newrelic_rpm-9.13.0 lib/new_relic/agent/instrumentation/ruby_openai/prepend.rb
newrelic_rpm-9.12.0 lib/new_relic/agent/instrumentation/ruby_openai/prepend.rb
newrelic_rpm-9.11.0 lib/new_relic/agent/instrumentation/ruby_openai/prepend.rb
newrelic_rpm-9.10.2 lib/new_relic/agent/instrumentation/ruby_openai/prepend.rb
newrelic_rpm-9.10.1 lib/new_relic/agent/instrumentation/ruby_openai/prepend.rb
newrelic_rpm-9.10.0 lib/new_relic/agent/instrumentation/ruby_openai/prepend.rb
newrelic_rpm-9.9.0 lib/new_relic/agent/instrumentation/ruby_openai/prepend.rb
newrelic_rpm-9.8.0 lib/new_relic/agent/instrumentation/ruby_openai/prepend.rb