Class: A2A::Types::TaskArtifactUpdateEvent
- Defined in:
- lib/a2a/types/events.rb
Overview
Represents a task artifact update event
These events are sent when artifacts are added or updated for a task, supporting streaming artifact delivery.
Instance Attribute Summary collapse
-
#append ⇒ Object
readonly
Returns the value of attribute append.
-
#artifact ⇒ Object
readonly
Returns the value of attribute artifact.
-
#context_id ⇒ Object
readonly
Returns the value of attribute context_id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#task_id ⇒ Object
readonly
Returns the value of attribute task_id.
Instance Method Summary collapse
-
#append? ⇒ Boolean
Check if this is an append operation.
-
#event_type ⇒ String
Get the event type.
-
#initialize(task_id:, context_id:, artifact:, append: false, metadata: nil) ⇒ TaskArtifactUpdateEvent
constructor
Initialize a new task artifact update event.
-
#replace? ⇒ Boolean
Check if this is a replace operation.
- #validate! ⇒ Object private
Methods inherited from BaseModel
#==, #camelize, from_h, from_json, #hash, #to_h, #to_json, underscore, #valid?, #validate_array_type, #validate_inclusion, #validate_required, #validate_type
Constructor Details
#initialize(task_id:, context_id:, artifact:, append: false, metadata: nil) ⇒ TaskArtifactUpdateEvent
Initialize a new task artifact update event
73 74 75 76 77 78 79 80 81 |
# File 'lib/a2a/types/events.rb', line 73 def initialize(task_id:, context_id:, artifact:, append: false, metadata: nil) @task_id = task_id @context_id = context_id @artifact = artifact.is_a?(Artifact) ? artifact : Artifact.from_h(artifact) @append = append = validate! end |
Instance Attribute Details
#append ⇒ Object (readonly)
Returns the value of attribute append.
63 64 65 |
# File 'lib/a2a/types/events.rb', line 63 def append @append end |
#artifact ⇒ Object (readonly)
Returns the value of attribute artifact.
63 64 65 |
# File 'lib/a2a/types/events.rb', line 63 def artifact @artifact end |
#context_id ⇒ Object (readonly)
Returns the value of attribute context_id.
63 64 65 |
# File 'lib/a2a/types/events.rb', line 63 def context_id @context_id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
63 64 65 |
# File 'lib/a2a/types/events.rb', line 63 def end |
#task_id ⇒ Object (readonly)
Returns the value of attribute task_id.
63 64 65 |
# File 'lib/a2a/types/events.rb', line 63 def task_id @task_id end |
Instance Method Details
#append? ⇒ Boolean
Check if this is an append operation
95 96 97 |
# File 'lib/a2a/types/events.rb', line 95 def append? @append end |
#event_type ⇒ String
Get the event type
87 88 89 |
# File 'lib/a2a/types/events.rb', line 87 def event_type "task_artifact_update" end |
#replace? ⇒ Boolean
Check if this is a replace operation
103 104 105 |
# File 'lib/a2a/types/events.rb', line 103 def replace? !@append end |
#validate! ⇒ Object (private)
109 110 111 112 113 114 |
# File 'lib/a2a/types/events.rb', line 109 def validate! validate_required(:task_id, :context_id, :artifact) validate_type(:task_id, String) validate_type(:context_id, String) validate_type(:artifact, Artifact) end |