Class: Vapi::ClientMessageToolCalls
- Inherits:
-
Object
- Object
- Vapi::ClientMessageToolCalls
- Defined in:
- lib/vapi_server_sdk/types/client_message_tool_calls.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#tool_call_list ⇒ Array<Vapi::ToolCall>
readonly
This is the list of tool calls that the model is requesting.
-
#tool_with_tool_call_list ⇒ Array<Vapi::ClientMessageToolCallsToolWithToolCallListItem>
readonly
This is the list of tools calls that the model is requesting along with the original tool configuration.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::ClientMessageToolCalls
Deserialize a JSON object to an instance of ClientMessageToolCalls.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(tool_with_tool_call_list:, tool_call_list:, additional_properties: nil) ⇒ Vapi::ClientMessageToolCalls constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ClientMessageToolCalls to a JSON object.
Constructor Details
#initialize(tool_with_tool_call_list:, tool_call_list:, additional_properties: nil) ⇒ Vapi::ClientMessageToolCalls
28 29 30 31 32 33 |
# File 'lib/vapi_server_sdk/types/client_message_tool_calls.rb', line 28 def initialize(tool_with_tool_call_list:, tool_call_list:, additional_properties: nil) @tool_with_tool_call_list = tool_with_tool_call_list @tool_call_list = tool_call_list @additional_properties = additional_properties @_field_set = { "toolWithToolCallList": tool_with_tool_call_list, "toolCallList": tool_call_list } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/vapi_server_sdk/types/client_message_tool_calls.rb', line 16 def additional_properties @additional_properties end |
#tool_call_list ⇒ Array<Vapi::ToolCall> (readonly)
Returns This is the list of tool calls that the model is requesting.
14 15 16 |
# File 'lib/vapi_server_sdk/types/client_message_tool_calls.rb', line 14 def tool_call_list @tool_call_list end |
#tool_with_tool_call_list ⇒ Array<Vapi::ClientMessageToolCallsToolWithToolCallListItem> (readonly)
Returns This is the list of tools calls that the model is requesting along with the original tool configuration.
12 13 14 |
# File 'lib/vapi_server_sdk/types/client_message_tool_calls.rb', line 12 def tool_with_tool_call_list @tool_with_tool_call_list end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::ClientMessageToolCalls
Deserialize a JSON object to an instance of ClientMessageToolCalls
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/vapi_server_sdk/types/client_message_tool_calls.rb', line 39 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) tool_with_tool_call_list = parsed_json["toolWithToolCallList"]&.map do |item| item = item.to_json Vapi::ClientMessageToolCallsToolWithToolCallListItem.from_json(json_object: item) end tool_call_list = parsed_json["toolCallList"]&.map do |item| item = item.to_json Vapi::ToolCall.from_json(json_object: item) end new( tool_with_tool_call_list: tool_with_tool_call_list, tool_call_list: tool_call_list, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
70 71 72 73 |
# File 'lib/vapi_server_sdk/types/client_message_tool_calls.rb', line 70 def self.validate_raw(obj:) obj.tool_with_tool_call_list.is_a?(Array) != false || raise("Passed value for field obj.tool_with_tool_call_list is not the expected type, validation failed.") obj.tool_call_list.is_a?(Array) != false || raise("Passed value for field obj.tool_call_list is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ClientMessageToolCalls to a JSON object
60 61 62 |
# File 'lib/vapi_server_sdk/types/client_message_tool_calls.rb', line 60 def to_json(*_args) @_field_set&.to_json end |