Class: Telnyx::Models::Calls::AssistantMessage

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/telnyx/models/calls/assistant_message.rb

Defined Under Namespace

Modules: Role Classes: ToolCall

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(role:, content: nil, metadata: nil, tool_calls: nil) ⇒ Object

Messages sent by the model in response to user messages.

Parameters:

  • role (Symbol, Telnyx::Models::Calls::AssistantMessage::Role)

    The role of the messages author, in this case ‘assistant`.

  • content (String) (defaults to: nil)

    The contents of the assistant message. Required unless ‘tool_calls`

  • metadata (Hash{Symbol=>Object}) (defaults to: nil)

    Metadata to add to the message

  • tool_calls (Array<Telnyx::Models::Calls::AssistantMessage::ToolCall>) (defaults to: nil)

    The tool calls generated by the model, such as function calls.



# File 'lib/telnyx/models/calls/assistant_message.rb', line 31

Instance Attribute Details

#contentString?

The contents of the assistant message. Required unless ‘tool_calls`

Returns:

  • (String, nil)


17
# File 'lib/telnyx/models/calls/assistant_message.rb', line 17

optional :content, String

#metadataHash{Symbol=>Object}?

Metadata to add to the message

Returns:

  • (Hash{Symbol=>Object}, nil)


23
# File 'lib/telnyx/models/calls/assistant_message.rb', line 23

optional :metadata, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

#roleSymbol, Telnyx::Models::Calls::AssistantMessage::Role

The role of the messages author, in this case ‘assistant`.



11
# File 'lib/telnyx/models/calls/assistant_message.rb', line 11

required :role, enum: -> { Telnyx::Calls::AssistantMessage::Role }

#tool_callsArray<Telnyx::Models::Calls::AssistantMessage::ToolCall>?

The tool calls generated by the model, such as function calls.



29
# File 'lib/telnyx/models/calls/assistant_message.rb', line 29

optional :tool_calls, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::Calls::AssistantMessage::ToolCall] }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/telnyx/models/calls/assistant_message.rb', line 50