Class: Phronomy::Agent::LLMInputManifest::Segment

Inherits:
Data
  • Object
show all
Defined in:
lib/phronomy/agent/llm_input_manifest.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**values) ⇒ Segment

Returns a new instance of Segment.



13
14
15
16
# File 'lib/phronomy/agent/llm_input_manifest.rb', line 13

def initialize(**values)
  super(**values.merge(metadata: Immutable.copy(values[:metadata] || {})))
  freeze
end

Instance Attribute Details

#categoryObject (readonly)

Returns the value of attribute category

Returns:

  • (Object)

    the current value of category



9
10
11
# File 'lib/phronomy/agent/llm_input_manifest.rb', line 9

def category
  @category
end

#content_refObject (readonly)

Returns the value of attribute content_ref

Returns:

  • (Object)

    the current value of content_ref



9
10
11
# File 'lib/phronomy/agent/llm_input_manifest.rb', line 9

def content_ref
  @content_ref
end

#deliveryObject (readonly)

Returns the value of attribute delivery

Returns:

  • (Object)

    the current value of delivery



9
10
11
# File 'lib/phronomy/agent/llm_input_manifest.rb', line 9

def delivery
  @delivery
end

#metadataObject (readonly)

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



9
10
11
# File 'lib/phronomy/agent/llm_input_manifest.rb', line 9

def 
  @metadata
end

#positionObject (readonly)

Returns the value of attribute position

Returns:

  • (Object)

    the current value of position



9
10
11
# File 'lib/phronomy/agent/llm_input_manifest.rb', line 9

def position
  @position
end

#roleObject (readonly)

Returns the value of attribute role

Returns:

  • (Object)

    the current value of role



9
10
11
# File 'lib/phronomy/agent/llm_input_manifest.rb', line 9

def role
  @role
end

#tool_call_idObject (readonly)

Returns the value of attribute tool_call_id

Returns:

  • (Object)

    the current value of tool_call_id



9
10
11
# File 'lib/phronomy/agent/llm_input_manifest.rb', line 9

def tool_call_id
  @tool_call_id
end

Instance Method Details

#to_hObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/phronomy/agent/llm_input_manifest.rb', line 18

def to_h
  {
    "position" => position,
    "category" => category.to_s,
    "role" => role&.to_s,
    "content_ref" => content_ref,
    "delivery" => delivery.to_s,
    "tool_call_id" => tool_call_id,
    "metadata" => 
  }.compact
end