Class: Anthropic::Internal::TracedStream Private

Inherits:
Object
  • Object
show all
Includes:
Anthropic::Internal::Type::BaseStream
Defined in:
lib/anthropic/internal/tracing.rb,
sig/anthropic/internal/tracing.rbs

Overview

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

What a streaming method returns when its API call has a recording span. Reading or closing it reads or closes the SDK's own stream, and ends the span.

Generic:

  • Elem

Instance Attribute Summary collapse

Attributes included from Anthropic::Internal::Type::BaseStream

#headers, #status

Instance Method Summary collapse

Methods included from Anthropic::Internal::Type::BaseStream

#close, #each, #inspect, #request_id, #to_enum, #workspace_id

Constructor Details

#initialize(stream, iterator, streamed_message) ⇒ TracedStream

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.

Returns a new instance of TracedStream.

Parameters:



25
26
27
28
29
30
31
# File 'lib/anthropic/internal/tracing.rb', line 25

def initialize(stream, iterator, streamed_message)
  @model = stream.instance_variable_get(:@model)
  @status = stream.status
  @headers = stream.headers
  @iterator = iterator
  @streamed_message = streamed_message
end

Instance Attribute Details

#streamed_message ⇒ Object? (readonly)

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.

What a recorder that follows this stream has read of it.

Returns:

  • (Object, nil)


16
17
18
# File 'lib/anthropic/internal/tracing.rb', line 16

def streamed_message
  @streamed_message
end