Class: Telnyx::Models::AI::Conversations::MessageListResponse::Data

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/telnyx/models/ai/conversations/message_list_response.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:, text:, created_at: nil, sent_at: nil, tool_calls: nil) ⇒ Object

Some parameter documentations has been truncated, see Telnyx::Models::AI::Conversations::MessageListResponse::Data for more details.

Parameters:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/telnyx/models/ai/conversations/message_list_response.rb', line 24

class Data < Telnyx::Internal::Type::BaseModel
  # @!attribute role
  #   The role of the message sender.
  #
  #   @return [Symbol, Telnyx::Models::AI::Conversations::MessageListResponse::Data::Role]
  required :role, enum: -> { Telnyx::Models::AI::Conversations::MessageListResponse::Data::Role }

  # @!attribute text
  #   The message content. Can be null for tool calls.
  #
  #   @return [String]
  required :text, String

  # @!attribute created_at
  #   The datetime the message was created on the conversation. This does not
  #   necesarily correspond to the time the message was sent. The best field to use to
  #   determine the time the end user experienced the message is `sent_at`.
  #
  #   @return [Time, nil]
  optional :created_at, Time

  # @!attribute sent_at
  #   The datetime the message was sent to the end user.
  #
  #   @return [Time, nil]
  optional :sent_at, Time

  # @!attribute tool_calls
  #   Optional tool calls made by the assistant.
  #
  #   @return [Array<Telnyx::Models::AI::Conversations::MessageListResponse::Data::ToolCall>, nil]
  optional :tool_calls,
           -> { Telnyx::Internal::Type::ArrayOf[Telnyx::Models::AI::Conversations::MessageListResponse::Data::ToolCall] }

  # @!method initialize(role:, text:, created_at: nil, sent_at: nil, tool_calls: nil)
  #   Some parameter documentations has been truncated, see
  #   {Telnyx::Models::AI::Conversations::MessageListResponse::Data} for more details.
  #
  #   @param role [Symbol, Telnyx::Models::AI::Conversations::MessageListResponse::Data::Role] The role of the message sender.
  #
  #   @param text [String] The message content. Can be null for tool calls.
  #
  #   @param created_at [Time] The datetime the message was created on the conversation. This does not necesari
  #
  #   @param sent_at [Time] The datetime the message was sent to the end user.
  #
  #   @param tool_calls [Array<Telnyx::Models::AI::Conversations::MessageListResponse::Data::ToolCall>] Optional tool calls made by the assistant.

  # The role of the message sender.
  #
  # @see Telnyx::Models::AI::Conversations::MessageListResponse::Data#role
  module Role
    extend Telnyx::Internal::Type::Enum

    USER = :user
    ASSISTANT = :assistant
    TOOL = :tool

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  class ToolCall < Telnyx::Internal::Type::BaseModel
    # @!attribute id
    #   Unique identifier for the tool call.
    #
    #   @return [String]
    required :id, String

    # @!attribute function
    #
    #   @return [Telnyx::Models::AI::Conversations::MessageListResponse::Data::ToolCall::Function]
    required :function,
             -> { Telnyx::Models::AI::Conversations::MessageListResponse::Data::ToolCall::Function }

    # @!attribute type
    #   Type of the tool call.
    #
    #   @return [Symbol, Telnyx::Models::AI::Conversations::MessageListResponse::Data::ToolCall::Type]
    required :type, enum: -> { Telnyx::Models::AI::Conversations::MessageListResponse::Data::ToolCall::Type }

    # @!method initialize(id:, function:, type:)
    #   @param id [String] Unique identifier for the tool call.
    #
    #   @param function [Telnyx::Models::AI::Conversations::MessageListResponse::Data::ToolCall::Function]
    #
    #   @param type [Symbol, Telnyx::Models::AI::Conversations::MessageListResponse::Data::ToolCall::Type] Type of the tool call.

    # @see Telnyx::Models::AI::Conversations::MessageListResponse::Data::ToolCall#function
    class Function < Telnyx::Internal::Type::BaseModel
      # @!attribute arguments
      #   JSON-formatted arguments to pass to the function.
      #
      #   @return [String]
      required :arguments, String

      # @!attribute name
      #   Name of the function to call.
      #
      #   @return [String]
      required :name, String

      # @!method initialize(arguments:, name:)
      #   @param arguments [String] JSON-formatted arguments to pass to the function.
      #
      #   @param name [String] Name of the function to call.
    end

    # Type of the tool call.
    #
    # @see Telnyx::Models::AI::Conversations::MessageListResponse::Data::ToolCall#type
    module Type
      extend Telnyx::Internal::Type::Enum

      FUNCTION = :function

      # @!method self.values
      #   @return [Array<Symbol>]
    end
  end
end

Instance Attribute Details

#created_atTime?

The datetime the message was created on the conversation. This does not necesarily correspond to the time the message was sent. The best field to use to determine the time the end user experienced the message is ‘sent_at`.

Returns:

  • (Time, nil)


43
# File 'lib/telnyx/models/ai/conversations/message_list_response.rb', line 43

optional :created_at, Time

#roleSymbol, Telnyx::Models::AI::Conversations::MessageListResponse::Data::Role

The role of the message sender.



29
# File 'lib/telnyx/models/ai/conversations/message_list_response.rb', line 29

required :role, enum: -> { Telnyx::Models::AI::Conversations::MessageListResponse::Data::Role }

#sent_atTime?

The datetime the message was sent to the end user.

Returns:

  • (Time, nil)


49
# File 'lib/telnyx/models/ai/conversations/message_list_response.rb', line 49

optional :sent_at, Time

#textString

The message content. Can be null for tool calls.

Returns:

  • (String)


35
# File 'lib/telnyx/models/ai/conversations/message_list_response.rb', line 35

required :text, String

#tool_callsArray<Telnyx::Models::AI::Conversations::MessageListResponse::Data::ToolCall>?

Optional tool calls made by the assistant.



55
56
# File 'lib/telnyx/models/ai/conversations/message_list_response.rb', line 55

optional :tool_calls,
-> { Telnyx::Internal::Type::ArrayOf[Telnyx::Models::AI::Conversations::MessageListResponse::Data::ToolCall] }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/telnyx/models/ai/conversations/message_list_response.rb', line 82