Module: Braintrust::Trace::OpenAI
- Defined in:
- lib/braintrust/contrib/openai/deprecated.rb
Class Method Summary collapse
-
.wrap(client, tracer_provider: nil) ⇒ OpenAI::Client
Wrap an OpenAI::Client to automatically create spans for chat completions and responses.
Class Method Details
.wrap(client, tracer_provider: nil) ⇒ OpenAI::Client
Wrap an OpenAI::Client to automatically create spans for chat completions and responses. This is the legacy API - delegates to the new contrib framework.
15 16 17 18 19 |
# File 'lib/braintrust/contrib/openai/deprecated.rb', line 15 def self.wrap(client, tracer_provider: nil) Log.warn("Braintrust::Trace::OpenAI.wrap() is deprecated and will be removed in a future version: use Braintrust.instrument!() instead.") Braintrust.instrument!(:openai, target: client, tracer_provider: tracer_provider) client end |