telnyx 5.16.0 → 5.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/models/ai/assistants/scheduled_event_create_params.rb +10 -1
  5. data/lib/telnyx/models/ai/assistants/scheduled_phone_call_event_response.rb +26 -1
  6. data/lib/telnyx/models/ai/assistants/scheduled_sms_event_response.rb +25 -1
  7. data/lib/telnyx/models/ai/openai/embedding_create_params.rb +92 -0
  8. data/lib/telnyx/models/ai/openai/embedding_create_response.rb +92 -0
  9. data/lib/telnyx/models/ai/openai/embedding_list_models_params.rb +18 -0
  10. data/lib/telnyx/models/ai/openai/embedding_list_models_response.rb +65 -0
  11. data/lib/telnyx/resources/ai/assistants/scheduled_events.rb +3 -1
  12. data/lib/telnyx/resources/ai/openai/embeddings.rb +74 -0
  13. data/lib/telnyx/resources/ai/openai.rb +20 -0
  14. data/lib/telnyx/resources/ai.rb +4 -0
  15. data/lib/telnyx/version.rb +1 -1
  16. data/lib/telnyx.rb +6 -0
  17. data/rbi/telnyx/models/ai/assistants/scheduled_event_create_params.rbi +13 -0
  18. data/rbi/telnyx/models/ai/assistants/scheduled_phone_call_event_response.rbi +13 -0
  19. data/rbi/telnyx/models/ai/assistants/scheduled_sms_event_response.rbi +13 -0
  20. data/rbi/telnyx/models/ai/openai/embedding_create_params.rbi +171 -0
  21. data/rbi/telnyx/models/ai/openai/embedding_create_response.rbi +176 -0
  22. data/rbi/telnyx/models/ai/openai/embedding_list_models_params.rbi +34 -0
  23. data/rbi/telnyx/models/ai/openai/embedding_list_models_response.rbi +123 -0
  24. data/rbi/telnyx/resources/ai/assistants/scheduled_events.rbi +4 -0
  25. data/rbi/telnyx/resources/ai/openai/embeddings.rbi +60 -0
  26. data/rbi/telnyx/resources/ai/openai.rbi +17 -0
  27. data/rbi/telnyx/resources/ai.rbi +3 -0
  28. data/sig/telnyx/models/ai/assistants/scheduled_event_create_params.rbs +9 -0
  29. data/sig/telnyx/models/ai/assistants/scheduled_phone_call_event_response.rbs +9 -0
  30. data/sig/telnyx/models/ai/assistants/scheduled_sms_event_response.rbs +9 -0
  31. data/sig/telnyx/models/ai/openai/embedding_create_params.rbs +79 -0
  32. data/sig/telnyx/models/ai/openai/embedding_create_response.rbs +77 -0
  33. data/sig/telnyx/models/ai/openai/embedding_list_models_params.rbs +19 -0
  34. data/sig/telnyx/models/ai/openai/embedding_list_models_response.rbs +56 -0
  35. data/sig/telnyx/resources/ai/assistants/scheduled_events.rbs +1 -0
  36. data/sig/telnyx/resources/ai/openai/embeddings.rbs +24 -0
  37. data/sig/telnyx/resources/ai/openai.rbs +11 -0
  38. data/sig/telnyx/resources/ai.rbs +2 -0
  39. metadata +19 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8412aa99450666a312d25f6d932562a9491c1ede8556d6dd5d6698f8e017aa2a
4
- data.tar.gz: befb7431cf9378b301e94d9523819faae642fc5b9a2bc59a254d4955ad4697b9
3
+ metadata.gz: 6f64a193fae0f68851a1b545044ea384297a3e6852731a084bf503c8897b48d8
4
+ data.tar.gz: 7026c1707b3da887862b4856f4e051277d93baa7744f4ed876d83a01de1e9667
5
5
  SHA512:
6
- metadata.gz: 8655480f2a4b1ce817537b81846617f6dc0e90606972979a6b76089019b1dfea1613c86c50e20010e11b168a4721385bae1754400cd739b0138856fe824d4bac
7
- data.tar.gz: 288990a231ddeaf6dd4b9c2cbb0ac98541985d6edb8f30a041f63470fc536e733c74db9c4e178d66833c2ace08d7739230c359716ec1041517e6a4ac4587f9c0
6
+ metadata.gz: bffe7cb7ede65f87722e7df8fb1b9981db665d9134fec32b2790d4163072c499c02340abb3541707d54b8c151776302b1c677ac072d2356bf0705a49779f678a
7
+ data.tar.gz: 70a983984587aa67731ea5a505703f16332d06c1b25c9814c5fe18b821d5836584d6b19d32238efab8e22e12286d1bd86707b658f88e9ff5634f33dabca0319f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.18.0 (2026-02-11)
4
+
5
+ Full Changelog: [v5.17.0...v5.18.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.17.0...v5.18.0)
6
+
7
+ ### Features
8
+
9
+ * Add OpenAI-compatible embeddings API spec ([e7aea5f](https://github.com/team-telnyx/telnyx-ruby/commit/e7aea5feb3c2277889875352e58e1e59ee9be532))
10
+
11
+ ## 5.17.0 (2026-02-11)
12
+
13
+ Full Changelog: [v5.16.0...v5.17.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.16.0...v5.17.0)
14
+
15
+ ### Features
16
+
17
+ * Add dynamic_variables field to scheduled event schemas ([63ec440](https://github.com/team-telnyx/telnyx-ruby/commit/63ec440947f4fc9d884fa09c43573eaf4b4ed6e1))
18
+
3
19
  ## 5.16.0 (2026-02-11)
4
20
 
5
21
  Full Changelog: [v5.15.0...v5.16.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.15.0...v5.16.0)
data/README.md CHANGED
@@ -24,7 +24,7 @@ To use this gem, install via Bundler by adding the following to your application
24
24
  <!-- x-release-please-start-version -->
25
25
 
26
26
  ```ruby
27
- gem "telnyx", "~> 5.16.0"
27
+ gem "telnyx", "~> 5.18.0"
28
28
  ```
29
29
 
30
30
  <!-- x-release-please-end -->
@@ -40,13 +40,20 @@ module Telnyx
40
40
  optional :conversation_metadata,
41
41
  -> { Telnyx::Internal::Type::HashOf[union: Telnyx::AI::Assistants::ScheduledEventCreateParams::ConversationMetadata] }
42
42
 
43
+ # @!attribute dynamic_variables
44
+ # A map of dynamic variable names to values. These variables can be referenced in
45
+ # the assistant's instructions and messages using {{variable_name}} syntax.
46
+ #
47
+ # @return [Hash{Symbol=>String}, nil]
48
+ optional :dynamic_variables, Telnyx::Internal::Type::HashOf[String]
49
+
43
50
  # @!attribute text
44
51
  # Required for sms scheduled events. The text to be sent to the end user.
45
52
  #
46
53
  # @return [String, nil]
47
54
  optional :text, String
48
55
 
49
- # @!method initialize(scheduled_at_fixed_datetime:, telnyx_agent_target:, telnyx_conversation_channel:, telnyx_end_user_target:, conversation_metadata: nil, text: nil, request_options: {})
56
+ # @!method initialize(scheduled_at_fixed_datetime:, telnyx_agent_target:, telnyx_conversation_channel:, telnyx_end_user_target:, conversation_metadata: nil, dynamic_variables: nil, text: nil, request_options: {})
50
57
  # Some parameter documentations has been truncated, see
51
58
  # {Telnyx::Models::AI::Assistants::ScheduledEventCreateParams} for more details.
52
59
  #
@@ -60,6 +67,8 @@ module Telnyx
60
67
  #
61
68
  # @param conversation_metadata [Hash{Symbol=>String, Integer, Boolean}] Metadata associated with the conversation. Telnyx provides several pieces of met
62
69
  #
70
+ # @param dynamic_variables [Hash{Symbol=>String}] A map of dynamic variable names to values. These variables can be referenced in
71
+ #
63
72
  # @param text [String] Required for sms scheduled events. The text to be sent to the end user.
64
73
  #
65
74
  # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
@@ -46,6 +46,13 @@ module Telnyx
46
46
  # @return [Time, nil]
47
47
  optional :created_at, Time
48
48
 
49
+ # @!attribute dynamic_variables
50
+ # A map of dynamic variable names to values. These variables can be referenced in
51
+ # the assistant's instructions and messages using {{variable_name}} syntax.
52
+ #
53
+ # @return [Hash{Symbol=>String}, nil]
54
+ optional :dynamic_variables, Telnyx::Internal::Type::HashOf[String]
55
+
49
56
  # @!attribute errors
50
57
  #
51
58
  # @return [Array<String>, nil]
@@ -71,19 +78,37 @@ module Telnyx
71
78
  # @return [Symbol, Telnyx::Models::AI::Assistants::EventStatus, nil]
72
79
  optional :status, enum: -> { Telnyx::AI::Assistants::EventStatus }
73
80
 
74
- # @!method initialize(assistant_id:, scheduled_at_fixed_datetime:, telnyx_agent_target:, telnyx_conversation_channel:, telnyx_end_user_target:, conversation_id: nil, conversation_metadata: nil, created_at: nil, errors: nil, retry_attempts: nil, retry_count: nil, scheduled_event_id: nil, status: nil)
81
+ # @!method initialize(assistant_id:, scheduled_at_fixed_datetime:, telnyx_agent_target:, telnyx_conversation_channel:, telnyx_end_user_target:, conversation_id: nil, conversation_metadata: nil, created_at: nil, dynamic_variables: nil, errors: nil, retry_attempts: nil, retry_count: nil, scheduled_event_id: nil, status: nil)
82
+ # Some parameter documentations has been truncated, see
83
+ # {Telnyx::Models::AI::Assistants::ScheduledPhoneCallEventResponse} for more
84
+ # details.
85
+ #
75
86
  # @param assistant_id [String]
87
+ #
76
88
  # @param scheduled_at_fixed_datetime [Time]
89
+ #
77
90
  # @param telnyx_agent_target [String]
91
+ #
78
92
  # @param telnyx_conversation_channel [Symbol, Telnyx::Models::AI::Assistants::ConversationChannelType]
93
+ #
79
94
  # @param telnyx_end_user_target [String]
95
+ #
80
96
  # @param conversation_id [String]
97
+ #
81
98
  # @param conversation_metadata [Hash{Symbol=>String, Integer, Boolean}]
99
+ #
82
100
  # @param created_at [Time]
101
+ #
102
+ # @param dynamic_variables [Hash{Symbol=>String}] A map of dynamic variable names to values. These variables can be referenced in
103
+ #
83
104
  # @param errors [Array<String>]
105
+ #
84
106
  # @param retry_attempts [Integer]
107
+ #
85
108
  # @param retry_count [Integer]
109
+ #
86
110
  # @param scheduled_event_id [String]
111
+ #
87
112
  # @param status [Symbol, Telnyx::Models::AI::Assistants::EventStatus]
88
113
 
89
114
  module ConversationMetadata
@@ -51,6 +51,13 @@ module Telnyx
51
51
  # @return [Time, nil]
52
52
  optional :created_at, Time
53
53
 
54
+ # @!attribute dynamic_variables
55
+ # A map of dynamic variable names to values. These variables can be referenced in
56
+ # the assistant's instructions and messages using {{variable_name}} syntax.
57
+ #
58
+ # @return [Hash{Symbol=>String}, nil]
59
+ optional :dynamic_variables, Telnyx::Internal::Type::HashOf[String]
60
+
54
61
  # @!attribute errors
55
62
  #
56
63
  # @return [Array<String>, nil]
@@ -71,19 +78,36 @@ module Telnyx
71
78
  # @return [Symbol, Telnyx::Models::AI::Assistants::EventStatus, nil]
72
79
  optional :status, enum: -> { Telnyx::AI::Assistants::EventStatus }
73
80
 
74
- # @!method initialize(assistant_id:, scheduled_at_fixed_datetime:, telnyx_agent_target:, telnyx_conversation_channel:, telnyx_end_user_target:, text:, conversation_id: nil, conversation_metadata: nil, created_at: nil, errors: nil, retry_count: nil, scheduled_event_id: nil, status: nil)
81
+ # @!method initialize(assistant_id:, scheduled_at_fixed_datetime:, telnyx_agent_target:, telnyx_conversation_channel:, telnyx_end_user_target:, text:, conversation_id: nil, conversation_metadata: nil, created_at: nil, dynamic_variables: nil, errors: nil, retry_count: nil, scheduled_event_id: nil, status: nil)
82
+ # Some parameter documentations has been truncated, see
83
+ # {Telnyx::Models::AI::Assistants::ScheduledSMSEventResponse} for more details.
84
+ #
75
85
  # @param assistant_id [String]
86
+ #
76
87
  # @param scheduled_at_fixed_datetime [Time]
88
+ #
77
89
  # @param telnyx_agent_target [String]
90
+ #
78
91
  # @param telnyx_conversation_channel [Symbol, Telnyx::Models::AI::Assistants::ConversationChannelType]
92
+ #
79
93
  # @param telnyx_end_user_target [String]
94
+ #
80
95
  # @param text [String]
96
+ #
81
97
  # @param conversation_id [String]
98
+ #
82
99
  # @param conversation_metadata [Hash{Symbol=>String, Integer, Boolean}]
100
+ #
83
101
  # @param created_at [Time]
102
+ #
103
+ # @param dynamic_variables [Hash{Symbol=>String}] A map of dynamic variable names to values. These variables can be referenced in
104
+ #
84
105
  # @param errors [Array<String>]
106
+ #
85
107
  # @param retry_count [Integer]
108
+ #
86
109
  # @param scheduled_event_id [String]
110
+ #
87
111
  # @param status [Symbol, Telnyx::Models::AI::Assistants::EventStatus]
88
112
 
89
113
  module ConversationMetadata
@@ -0,0 +1,92 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module AI
6
+ module OpenAI
7
+ # @see Telnyx::Resources::AI::OpenAI::Embeddings#create
8
+ class EmbeddingCreateParams < Telnyx::Internal::Type::BaseModel
9
+ extend Telnyx::Internal::Type::RequestParameters::Converter
10
+ include Telnyx::Internal::Type::RequestParameters
11
+
12
+ # @!attribute input
13
+ # Input text to embed. Can be a string or array of strings.
14
+ #
15
+ # @return [String, Array<String>]
16
+ required :input, union: -> { Telnyx::AI::OpenAI::EmbeddingCreateParams::Input }
17
+
18
+ # @!attribute model
19
+ # ID of the model to use. Use the List embedding models endpoint to see available
20
+ # models.
21
+ #
22
+ # @return [String]
23
+ required :model, String
24
+
25
+ # @!attribute dimensions
26
+ # The number of dimensions the resulting output embeddings should have. Only
27
+ # supported in some models.
28
+ #
29
+ # @return [Integer, nil]
30
+ optional :dimensions, Integer
31
+
32
+ # @!attribute encoding_format
33
+ # The format to return the embeddings in.
34
+ #
35
+ # @return [Symbol, Telnyx::Models::AI::OpenAI::EmbeddingCreateParams::EncodingFormat, nil]
36
+ optional :encoding_format, enum: -> { Telnyx::AI::OpenAI::EmbeddingCreateParams::EncodingFormat }
37
+
38
+ # @!attribute user
39
+ # A unique identifier representing your end-user for monitoring and abuse
40
+ # detection.
41
+ #
42
+ # @return [String, nil]
43
+ optional :user, String
44
+
45
+ # @!method initialize(input:, model:, dimensions: nil, encoding_format: nil, user: nil, request_options: {})
46
+ # Some parameter documentations has been truncated, see
47
+ # {Telnyx::Models::AI::OpenAI::EmbeddingCreateParams} for more details.
48
+ #
49
+ # @param input [String, Array<String>] Input text to embed. Can be a string or array of strings.
50
+ #
51
+ # @param model [String] ID of the model to use. Use the List embedding models endpoint to see available
52
+ #
53
+ # @param dimensions [Integer] The number of dimensions the resulting output embeddings should have. Only suppo
54
+ #
55
+ # @param encoding_format [Symbol, Telnyx::Models::AI::OpenAI::EmbeddingCreateParams::EncodingFormat] The format to return the embeddings in.
56
+ #
57
+ # @param user [String] A unique identifier representing your end-user for monitoring and abuse detectio
58
+ #
59
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
60
+
61
+ # Input text to embed. Can be a string or array of strings.
62
+ module Input
63
+ extend Telnyx::Internal::Type::Union
64
+
65
+ # A single text string to embed
66
+ variant String
67
+
68
+ # An array of text strings to embed
69
+ variant -> { Telnyx::Models::AI::OpenAI::EmbeddingCreateParams::Input::StringArray }
70
+
71
+ # @!method self.variants
72
+ # @return [Array(String, Array<String>)]
73
+
74
+ # @type [Telnyx::Internal::Type::Converter]
75
+ StringArray = Telnyx::Internal::Type::ArrayOf[String]
76
+ end
77
+
78
+ # The format to return the embeddings in.
79
+ module EncodingFormat
80
+ extend Telnyx::Internal::Type::Enum
81
+
82
+ FLOAT = :float
83
+ BASE64 = :base64
84
+
85
+ # @!method self.values
86
+ # @return [Array<Symbol>]
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,92 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module AI
6
+ module OpenAI
7
+ # @see Telnyx::Resources::AI::OpenAI::Embeddings#create
8
+ class EmbeddingCreateResponse < Telnyx::Internal::Type::BaseModel
9
+ # @!attribute data
10
+ # List of embedding objects
11
+ #
12
+ # @return [Array<Telnyx::Models::AI::OpenAI::EmbeddingCreateResponse::Data>]
13
+ required :data,
14
+ -> { Telnyx::Internal::Type::ArrayOf[Telnyx::Models::AI::OpenAI::EmbeddingCreateResponse::Data] }
15
+
16
+ # @!attribute model
17
+ # The model used for embedding
18
+ #
19
+ # @return [String]
20
+ required :model, String
21
+
22
+ # @!attribute object
23
+ # The object type, always 'list'
24
+ #
25
+ # @return [String]
26
+ required :object, String
27
+
28
+ # @!attribute usage
29
+ #
30
+ # @return [Telnyx::Models::AI::OpenAI::EmbeddingCreateResponse::Usage]
31
+ required :usage, -> { Telnyx::Models::AI::OpenAI::EmbeddingCreateResponse::Usage }
32
+
33
+ # @!method initialize(data:, model:, object:, usage:)
34
+ # @param data [Array<Telnyx::Models::AI::OpenAI::EmbeddingCreateResponse::Data>] List of embedding objects
35
+ #
36
+ # @param model [String] The model used for embedding
37
+ #
38
+ # @param object [String] The object type, always 'list'
39
+ #
40
+ # @param usage [Telnyx::Models::AI::OpenAI::EmbeddingCreateResponse::Usage]
41
+
42
+ class Data < Telnyx::Internal::Type::BaseModel
43
+ # @!attribute embedding
44
+ # The embedding vector
45
+ #
46
+ # @return [Array<Float>]
47
+ required :embedding, Telnyx::Internal::Type::ArrayOf[Float]
48
+
49
+ # @!attribute index
50
+ # The index of the embedding in the list of embeddings
51
+ #
52
+ # @return [Integer]
53
+ required :index, Integer
54
+
55
+ # @!attribute object
56
+ # The object type, always 'embedding'
57
+ #
58
+ # @return [String]
59
+ required :object, String
60
+
61
+ # @!method initialize(embedding:, index:, object:)
62
+ # @param embedding [Array<Float>] The embedding vector
63
+ #
64
+ # @param index [Integer] The index of the embedding in the list of embeddings
65
+ #
66
+ # @param object [String] The object type, always 'embedding'
67
+ end
68
+
69
+ # @see Telnyx::Models::AI::OpenAI::EmbeddingCreateResponse#usage
70
+ class Usage < Telnyx::Internal::Type::BaseModel
71
+ # @!attribute prompt_tokens
72
+ # Number of tokens in the input
73
+ #
74
+ # @return [Integer]
75
+ required :prompt_tokens, Integer
76
+
77
+ # @!attribute total_tokens
78
+ # Total number of tokens used
79
+ #
80
+ # @return [Integer]
81
+ required :total_tokens, Integer
82
+
83
+ # @!method initialize(prompt_tokens:, total_tokens:)
84
+ # @param prompt_tokens [Integer] Number of tokens in the input
85
+ #
86
+ # @param total_tokens [Integer] Total number of tokens used
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module AI
6
+ module OpenAI
7
+ # @see Telnyx::Resources::AI::OpenAI::Embeddings#list_models
8
+ class EmbeddingListModelsParams < Telnyx::Internal::Type::BaseModel
9
+ extend Telnyx::Internal::Type::RequestParameters::Converter
10
+ include Telnyx::Internal::Type::RequestParameters
11
+
12
+ # @!method initialize(request_options: {})
13
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module AI
6
+ module OpenAI
7
+ # @see Telnyx::Resources::AI::OpenAI::Embeddings#list_models
8
+ class EmbeddingListModelsResponse < Telnyx::Internal::Type::BaseModel
9
+ # @!attribute data
10
+ # List of available embedding models
11
+ #
12
+ # @return [Array<Telnyx::Models::AI::OpenAI::EmbeddingListModelsResponse::Data>]
13
+ required :data,
14
+ -> { Telnyx::Internal::Type::ArrayOf[Telnyx::Models::AI::OpenAI::EmbeddingListModelsResponse::Data] }
15
+
16
+ # @!attribute object
17
+ # The object type, always 'list'
18
+ #
19
+ # @return [String]
20
+ required :object, String
21
+
22
+ # @!method initialize(data:, object:)
23
+ # @param data [Array<Telnyx::Models::AI::OpenAI::EmbeddingListModelsResponse::Data>] List of available embedding models
24
+ #
25
+ # @param object [String] The object type, always 'list'
26
+
27
+ class Data < Telnyx::Internal::Type::BaseModel
28
+ # @!attribute id
29
+ # The model identifier
30
+ #
31
+ # @return [String]
32
+ required :id, String
33
+
34
+ # @!attribute created
35
+ # Unix timestamp of when the model was created
36
+ #
37
+ # @return [Integer]
38
+ required :created, Integer
39
+
40
+ # @!attribute object
41
+ # The object type, always 'model'
42
+ #
43
+ # @return [String]
44
+ required :object, String
45
+
46
+ # @!attribute owned_by
47
+ # The organization that owns the model
48
+ #
49
+ # @return [String]
50
+ required :owned_by, String
51
+
52
+ # @!method initialize(id:, created:, object:, owned_by:)
53
+ # @param id [String] The model identifier
54
+ #
55
+ # @param created [Integer] Unix timestamp of when the model was created
56
+ #
57
+ # @param object [String] The object type, always 'model'
58
+ #
59
+ # @param owned_by [String] The organization that owns the model
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -10,7 +10,7 @@ module Telnyx
10
10
  #
11
11
  # Create a scheduled event for an assistant
12
12
  #
13
- # @overload create(assistant_id, scheduled_at_fixed_datetime:, telnyx_agent_target:, telnyx_conversation_channel:, telnyx_end_user_target:, conversation_metadata: nil, text: nil, request_options: {})
13
+ # @overload create(assistant_id, scheduled_at_fixed_datetime:, telnyx_agent_target:, telnyx_conversation_channel:, telnyx_end_user_target:, conversation_metadata: nil, dynamic_variables: nil, text: nil, request_options: {})
14
14
  #
15
15
  # @param assistant_id [String]
16
16
  #
@@ -24,6 +24,8 @@ module Telnyx
24
24
  #
25
25
  # @param conversation_metadata [Hash{Symbol=>String, Integer, Boolean}] Metadata associated with the conversation. Telnyx provides several pieces of met
26
26
  #
27
+ # @param dynamic_variables [Hash{Symbol=>String}] A map of dynamic variable names to values. These variables can be referenced in
28
+ #
27
29
  # @param text [String] Required for sms scheduled events. The text to be sent to the end user.
28
30
  #
29
31
  # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Resources
5
+ class AI
6
+ class OpenAI
7
+ class Embeddings
8
+ # Some parameter documentations has been truncated, see
9
+ # {Telnyx::Models::AI::OpenAI::EmbeddingCreateParams} for more details.
10
+ #
11
+ # Creates an embedding vector representing the input text. This endpoint is
12
+ # compatible with the
13
+ # [OpenAI Embeddings API](https://platform.openai.com/docs/api-reference/embeddings)
14
+ # and may be used with the OpenAI JS or Python SDK by setting the base URL to
15
+ # `https://api.telnyx.com/v2/ai/openai`.
16
+ #
17
+ # @overload create(input:, model:, dimensions: nil, encoding_format: nil, user: nil, request_options: {})
18
+ #
19
+ # @param input [String, Array<String>] Input text to embed. Can be a string or array of strings.
20
+ #
21
+ # @param model [String] ID of the model to use. Use the List embedding models endpoint to see available
22
+ #
23
+ # @param dimensions [Integer] The number of dimensions the resulting output embeddings should have. Only suppo
24
+ #
25
+ # @param encoding_format [Symbol, Telnyx::Models::AI::OpenAI::EmbeddingCreateParams::EncodingFormat] The format to return the embeddings in.
26
+ #
27
+ # @param user [String] A unique identifier representing your end-user for monitoring and abuse detectio
28
+ #
29
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
30
+ #
31
+ # @return [Telnyx::Models::AI::OpenAI::EmbeddingCreateResponse]
32
+ #
33
+ # @see Telnyx::Models::AI::OpenAI::EmbeddingCreateParams
34
+ def create(params)
35
+ parsed, options = Telnyx::AI::OpenAI::EmbeddingCreateParams.dump_request(params)
36
+ @client.request(
37
+ method: :post,
38
+ path: "ai/openai/embeddings",
39
+ body: parsed,
40
+ model: Telnyx::Models::AI::OpenAI::EmbeddingCreateResponse,
41
+ options: options
42
+ )
43
+ end
44
+
45
+ # Returns a list of available embedding models. This endpoint is compatible with
46
+ # the OpenAI Models API format.
47
+ #
48
+ # @overload list_models(request_options: {})
49
+ #
50
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
51
+ #
52
+ # @return [Telnyx::Models::AI::OpenAI::EmbeddingListModelsResponse]
53
+ #
54
+ # @see Telnyx::Models::AI::OpenAI::EmbeddingListModelsParams
55
+ def list_models(params = {})
56
+ @client.request(
57
+ method: :get,
58
+ path: "ai/openai/embeddings/models",
59
+ model: Telnyx::Models::AI::OpenAI::EmbeddingListModelsResponse,
60
+ options: params[:request_options]
61
+ )
62
+ end
63
+
64
+ # @api private
65
+ #
66
+ # @param client [Telnyx::Client]
67
+ def initialize(client:)
68
+ @client = client
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Resources
5
+ class AI
6
+ class OpenAI
7
+ # @return [Telnyx::Resources::AI::OpenAI::Embeddings]
8
+ attr_reader :embeddings
9
+
10
+ # @api private
11
+ #
12
+ # @param client [Telnyx::Client]
13
+ def initialize(client:)
14
+ @client = client
15
+ @embeddings = Telnyx::Resources::AI::OpenAI::Embeddings.new(client: client)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -30,6 +30,9 @@ module Telnyx
30
30
  # @return [Telnyx::Resources::AI::McpServers]
31
31
  attr_reader :mcp_servers
32
32
 
33
+ # @return [Telnyx::Resources::AI::OpenAI]
34
+ attr_reader :openai
35
+
33
36
  # This endpoint returns a list of Open Source and OpenAI models that are available
34
37
  # for use. <br /><br /> **Note**: Model `id`'s will be in the form
35
38
  # `{source}/{model_name}`. For example `openai/gpt-4` or
@@ -102,6 +105,7 @@ module Telnyx
102
105
  @fine_tuning = Telnyx::Resources::AI::FineTuning.new(client: client)
103
106
  @integrations = Telnyx::Resources::AI::Integrations.new(client: client)
104
107
  @mcp_servers = Telnyx::Resources::AI::McpServers.new(client: client)
108
+ @openai = Telnyx::Resources::AI::OpenAI.new(client: client)
105
109
  end
106
110
  end
107
111
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Telnyx
4
- VERSION = "5.16.0"
4
+ VERSION = "5.18.0"
5
5
  end
data/lib/telnyx.rb CHANGED
@@ -274,6 +274,10 @@ require_relative "telnyx/models/ai/mcp_server_retrieve_response"
274
274
  require_relative "telnyx/models/ai/mcp_server_update_params"
275
275
  require_relative "telnyx/models/ai/mcp_server_update_response"
276
276
  require_relative "telnyx/models/ai/messaging_settings"
277
+ require_relative "telnyx/models/ai/openai/embedding_create_params"
278
+ require_relative "telnyx/models/ai/openai/embedding_create_response"
279
+ require_relative "telnyx/models/ai/openai/embedding_list_models_params"
280
+ require_relative "telnyx/models/ai/openai/embedding_list_models_response"
277
281
  require_relative "telnyx/models/ai/privacy_settings"
278
282
  require_relative "telnyx/models/ai/recursive_cluster"
279
283
  require_relative "telnyx/models/ai/retrieval_tool"
@@ -2059,6 +2063,8 @@ require_relative "telnyx/resources/ai/fine_tuning/jobs"
2059
2063
  require_relative "telnyx/resources/ai/integrations"
2060
2064
  require_relative "telnyx/resources/ai/integrations/connections"
2061
2065
  require_relative "telnyx/resources/ai/mcp_servers"
2066
+ require_relative "telnyx/resources/ai/openai"
2067
+ require_relative "telnyx/resources/ai/openai/embeddings"
2062
2068
  require_relative "telnyx/resources/audit_events"
2063
2069
  require_relative "telnyx/resources/authentication_providers"
2064
2070
  require_relative "telnyx/resources/available_phone_number_blocks"
@@ -58,6 +58,14 @@ module Telnyx
58
58
  end
59
59
  attr_writer :conversation_metadata
60
60
 
61
+ # A map of dynamic variable names to values. These variables can be referenced in
62
+ # the assistant's instructions and messages using {{variable_name}} syntax.
63
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
64
+ attr_reader :dynamic_variables
65
+
66
+ sig { params(dynamic_variables: T::Hash[Symbol, String]).void }
67
+ attr_writer :dynamic_variables
68
+
61
69
  # Required for sms scheduled events. The text to be sent to the end user.
62
70
  sig { returns(T.nilable(String)) }
63
71
  attr_reader :text
@@ -77,6 +85,7 @@ module Telnyx
77
85
  Symbol,
78
86
  Telnyx::AI::Assistants::ScheduledEventCreateParams::ConversationMetadata::Variants
79
87
  ],
88
+ dynamic_variables: T::Hash[Symbol, String],
80
89
  text: String,
81
90
  request_options: Telnyx::RequestOptions::OrHash
82
91
  ).returns(T.attached_class)
@@ -92,6 +101,9 @@ module Telnyx
92
101
  # Metadata associated with the conversation. Telnyx provides several pieces of
93
102
  # metadata, but customers can also add their own.
94
103
  conversation_metadata: nil,
104
+ # A map of dynamic variable names to values. These variables can be referenced in
105
+ # the assistant's instructions and messages using {{variable_name}} syntax.
106
+ dynamic_variables: nil,
95
107
  # Required for sms scheduled events. The text to be sent to the end user.
96
108
  text: nil,
97
109
  request_options: {}
@@ -111,6 +123,7 @@ module Telnyx
111
123
  Symbol,
112
124
  Telnyx::AI::Assistants::ScheduledEventCreateParams::ConversationMetadata::Variants
113
125
  ],
126
+ dynamic_variables: T::Hash[Symbol, String],
114
127
  text: String,
115
128
  request_options: Telnyx::RequestOptions
116
129
  }