Module: Anthropic::Helpers::Tracing::Recorders::APICall Private

Defined in:
lib/anthropic/helpers/tracing/recorders.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

A request to a Session thread without a conversation ID takes the thread's ID, so that the span groups with the API's spans for that thread.

Class Method Summary collapse

Class Method Details

.record(_span, _result) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • _span (OpenTelemetry::Trace::Span)
  • _result (Hash{Symbol=>Object})


44
# File 'lib/anthropic/helpers/tracing/recorders.rb', line 44

def record(_span, _result) = nil

.start_attributes(_client, req) ⇒ Hash{String=>Object}

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

Returns:

  • (Hash{String=>Object})


37
38
39
40
# File 'lib/anthropic/helpers/tracing/recorders.rb', line 37

def start_attributes(_client, req)
  thread_id = req[:span_attributes].to_h[ANTHROPIC_SESSION_THREAD_ID]
  {GEN_AI_CONVERSATION_ID => Tracing.conversation_id(req[:options]) || thread_id}
end