Module: Braintrust::Contrib::OpenAI::Instrumentation::Moderations::InstanceMethods
- Defined in:
- lib/braintrust/contrib/openai/instrumentation/moderations.rb
Instance Method Summary collapse
-
#create(**params) ⇒ Object
Wrap non-streaming create method.
Instance Method Details
#create(**params) ⇒ Object
Wrap non-streaming create method
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/braintrust/contrib/openai/instrumentation/moderations.rb', line 30 def create(**params) client = instance_variable_get(:@client) tracer = Braintrust::Contrib.tracer_for(client) tracer.in_span("openai.moderations.create") do |span| = (params) set_input(span, params) response = nil time_to_first_token = Braintrust::Internal::Time.measure do response = super end set_output(span, response) set_metrics(span, time_to_first_token) (span, , response) response end end |