Class: A2A::Streaming::ArtifactUpdateEvent
- Inherits:
-
Object
- Object
- A2A::Streaming::ArtifactUpdateEvent
- Defined in:
- lib/a2a/streaming/artifact_update_event.rb
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.
-
#last_chunk ⇒ Object
readonly
Returns the value of attribute last_chunk.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#task_id ⇒ Object
readonly
Returns the value of attribute task_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(task_id:, context_id:, artifact:, **kwargs) ⇒ ArtifactUpdateEvent
constructor
A new instance of ArtifactUpdateEvent.
- #to_h ⇒ Object
Constructor Details
#initialize(task_id:, context_id:, artifact:, **kwargs) ⇒ ArtifactUpdateEvent
Returns a new instance of ArtifactUpdateEvent.
8 9 10 11 12 13 14 15 |
# File 'lib/a2a/streaming/artifact_update_event.rb', line 8 def initialize(task_id:, context_id:, artifact:, **kwargs) @task_id = task_id @context_id = context_id @artifact = artifact @append = kwargs[:append] || false @last_chunk = kwargs[:last_chunk] || false @metadata = kwargs[:metadata] end |
Instance Attribute Details
#append ⇒ Object (readonly)
Returns the value of attribute append.
6 7 8 |
# File 'lib/a2a/streaming/artifact_update_event.rb', line 6 def append @append end |
#artifact ⇒ Object (readonly)
Returns the value of attribute artifact.
6 7 8 |
# File 'lib/a2a/streaming/artifact_update_event.rb', line 6 def artifact @artifact end |
#context_id ⇒ Object (readonly)
Returns the value of attribute context_id.
6 7 8 |
# File 'lib/a2a/streaming/artifact_update_event.rb', line 6 def context_id @context_id end |
#last_chunk ⇒ Object (readonly)
Returns the value of attribute last_chunk.
6 7 8 |
# File 'lib/a2a/streaming/artifact_update_event.rb', line 6 def last_chunk @last_chunk end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
6 7 8 |
# File 'lib/a2a/streaming/artifact_update_event.rb', line 6 def @metadata end |
#task_id ⇒ Object (readonly)
Returns the value of attribute task_id.
6 7 8 |
# File 'lib/a2a/streaming/artifact_update_event.rb', line 6 def task_id @task_id end |
Class Method Details
.from_h(hash) ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/a2a/streaming/artifact_update_event.rb', line 28 def self.from_h(hash) new( task_id: hash.fetch("taskId"), context_id: hash.fetch("contextId"), artifact: Artifact.from_h(hash.fetch("artifact")), append: hash["append"], last_chunk: hash["lastChunk"], metadata: hash["metadata"] ) end |
Instance Method Details
#to_h ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/a2a/streaming/artifact_update_event.rb', line 17 def to_h { "taskId" => task_id, "contextId" => context_id, "artifact" => artifact.to_h, "append" => append, "lastChunk" => last_chunk, "metadata" => }.compact end |