Class: Agent::SessionContext::Prompt

Inherits:
Data
  • Object
show all
Defined in:
lib/agent/session_context/prompt.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index:, at:, text:, source_refs:) ⇒ Prompt

Returns a new instance of Prompt.



6
7
8
9
10
11
12
13
# File 'lib/agent/session_context/prompt.rb', line 6

def initialize(index:, at:, text:, source_refs:)
  super(
    index: normalize_positive_index(index),
    at: at,
    text: normalize_string(text, :text),
    source_refs: ImmutableValue.copy(Array(source_refs))
  )
end

Instance Attribute Details

#at ⇒ Object (readonly)

Returns the value of attribute at

Returns:

  • (Object) —

    the current value of at



5
6
7
# File 'lib/agent/session_context/prompt.rb', line 5

def at
  @at
end

#index ⇒ Object (readonly)

Returns the value of attribute index

Returns:

  • (Object) —

    the current value of index



5
6
7
# File 'lib/agent/session_context/prompt.rb', line 5

def index
  @index
end

#source_refs ⇒ Object (readonly)

Returns the value of attribute source_refs

Returns:

  • (Object) —

    the current value of source_refs



5
6
7
# File 'lib/agent/session_context/prompt.rb', line 5

def source_refs
  @source_refs
end

#text ⇒ Object (readonly)

Returns the value of attribute text

Returns:

  • (Object) —

    the current value of text



5
6
7
# File 'lib/agent/session_context/prompt.rb', line 5

def text
  @text
end