Module: AgentClientProtocol::Schema::ToolCallContent

Defined in:
lib/agent_client_protocol/schema/types.rb

Constant Summary collapse

CONTENT =
"content".freeze
DIFF =
"diff".freeze
TERMINAL =
"terminal".freeze

Class Method Summary collapse

Class Method Details

.parse(hash) ⇒ Object



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/agent_client_protocol/schema/types.rb', line 181

def self.parse(hash)
  return nil if hash.nil?
  disc = hash["type"]
  case disc
  when "content"
    obj = Content.from_hash(hash)
    obj
  when "diff"
    obj = Diff.from_hash(hash)
    obj
  when "terminal"
    obj = Terminal.from_hash(hash)
    obj
  else
    hash
  end
end