Class: Events::AuthenticationRequired

Inherits:
Base
  • Object
show all
Defined in:
lib/events/authentication_required.rb

Overview

Emitted when the Anthropic provider rejects the configured token with an authentication error. Surfaces to the TUI via Subscribers::AuthenticationBroadcaster so the user is prompted for a new token — and to the conversation as a system message so the failure is visible in history.

Not persisted — not included in Message::TYPES.

Constant Summary collapse

TYPE =
"authentication_required"

Instance Attribute Summary

Attributes inherited from Base

#content, #session_id, #timestamp

Instance Method Summary collapse

Methods inherited from Base

#event_name, #to_h

Constructor Details

#initialize(session_id:, content:) ⇒ AuthenticationRequired

Returns a new instance of AuthenticationRequired.

Parameters:

  • session_id (Integer)

    session the failure is scoped to

  • content (String)

    human-readable error text from the provider



16
17
18
# File 'lib/events/authentication_required.rb', line 16

def initialize(session_id:, content:)
  super(content: content, session_id: session_id)
end

Instance Method Details

#typeObject



20
21
22
# File 'lib/events/authentication_required.rb', line 20

def type
  TYPE
end