Class: Cadenya::Types::SetToolCallContentRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(workspace_id: nil, objective_id: nil, tool_call_id: nil, content: nil) ⇒ SetToolCallContentRequest

Returns a new instance of SetToolCallContentRequest.



5087
5088
5089
5090
5091
5092
# File 'lib/cadenya/types.rb', line 5087

def initialize(workspace_id: nil, objective_id: nil, tool_call_id: nil, content: nil)
  @workspace_id = workspace_id
  @objective_id = objective_id
  @tool_call_id = tool_call_id
  @content = content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



5085
5086
5087
# File 'lib/cadenya/types.rb', line 5085

def content
  @content
end

#objective_idObject (readonly)

Returns the value of attribute objective_id.



5085
5086
5087
# File 'lib/cadenya/types.rb', line 5085

def objective_id
  @objective_id
end

#tool_call_idObject (readonly)

Returns the value of attribute tool_call_id.



5085
5086
5087
# File 'lib/cadenya/types.rb', line 5085

def tool_call_id
  @tool_call_id
end

#workspace_idObject (readonly)

Returns the value of attribute workspace_id.



5085
5086
5087
# File 'lib/cadenya/types.rb', line 5085

def workspace_id
  @workspace_id
end

Class Method Details

.from_json(data) ⇒ Object



5094
5095
5096
5097
5098
5099
5100
5101
# File 'lib/cadenya/types.rb', line 5094

def self.from_json(data)
  new(
    workspace_id: data["workspaceId"],
    objective_id: data["objectiveId"],
    tool_call_id: data["toolCallId"],
    content: data["content"].nil? ? nil : (data["content"]).map { |item| Types.decode_SetToolCallContentRequest_ContentBlock(item) },
  )
end

Instance Method Details

#to_hObject



5103
5104
5105
5106
5107
5108
5109
5110
# File 'lib/cadenya/types.rb', line 5103

def to_h
  {
    workspace_id: Util.plain(@workspace_id),
    objective_id: Util.plain(@objective_id),
    tool_call_id: Util.plain(@tool_call_id),
    content: Util.plain(@content),
  }.reject { |_k, v| v.nil? }
end