telnyx 5.99.0 → 5.101.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +1 -1
- data/lib/telnyx/client.rb +5 -0
- data/lib/telnyx/models/ai/assistants/canary_deploy.rb +128 -7
- data/lib/telnyx/models/ai/assistants/canary_deploy_response.rb +131 -7
- data/lib/telnyx/models/ai/chat_create_completion_params.rb +36 -1
- data/lib/telnyx/models/ai/openai/chat_create_completion_params.rb +458 -0
- data/lib/telnyx/models/ai/openai/chat_create_completion_response.rb +12 -0
- data/lib/telnyx/models/ai/openai_list_models_params.rb +16 -0
- data/lib/telnyx/models/ai/openai_list_models_response.rb +52 -0
- data/lib/telnyx/models/uac_connection_create_params.rb +738 -0
- data/lib/telnyx/models/uac_connection_create_response.rb +898 -0
- data/lib/telnyx/models/uac_connection_delete_params.rb +20 -0
- data/lib/telnyx/models/uac_connection_delete_response.rb +898 -0
- data/lib/telnyx/models/uac_connection_list_params.rb +143 -0
- data/lib/telnyx/models/uac_connection_list_response.rb +876 -0
- data/lib/telnyx/models/uac_connection_retrieve_params.rb +20 -0
- data/lib/telnyx/models/uac_connection_retrieve_response.rb +899 -0
- data/lib/telnyx/models/uac_connection_update_params.rb +740 -0
- data/lib/telnyx/models/uac_connection_update_response.rb +898 -0
- data/lib/telnyx/models/uac_connections/action_check_registration_status_params.rb +22 -0
- data/lib/telnyx/models/uac_connections/action_check_registration_status_response.rb +104 -0
- data/lib/telnyx/models.rb +12 -0
- data/lib/telnyx/resources/ai/assistants/canary_deploys.rb +6 -10
- data/lib/telnyx/resources/ai/chat.rb +9 -2
- data/lib/telnyx/resources/ai/openai/chat.rb +96 -0
- data/lib/telnyx/resources/ai/openai.rb +26 -0
- data/lib/telnyx/resources/ai.rb +7 -5
- data/lib/telnyx/resources/uac_connections/actions.rb +39 -0
- data/lib/telnyx/resources/uac_connections.rb +256 -0
- data/lib/telnyx/version.rb +1 -1
- data/lib/telnyx.rb +19 -1
- data/rbi/telnyx/client.rbi +4 -0
- data/rbi/telnyx/models/ai/assistants/canary_deploy.rbi +303 -10
- data/rbi/telnyx/models/ai/assistants/canary_deploy_response.rbi +309 -9
- data/rbi/telnyx/models/ai/chat_create_completion_params.rbi +58 -0
- data/rbi/telnyx/models/ai/openai/chat_create_completion_params.rbi +963 -0
- data/rbi/telnyx/models/ai/openai/chat_create_completion_response.rbi +15 -0
- data/rbi/telnyx/models/ai/openai_list_models_params.rbi +29 -0
- data/rbi/telnyx/models/ai/openai_list_models_response.rbi +96 -0
- data/rbi/telnyx/models/uac_connection_create_params.rbi +1465 -0
- data/rbi/telnyx/models/uac_connection_create_response.rbi +1793 -0
- data/rbi/telnyx/models/uac_connection_delete_params.rbi +35 -0
- data/rbi/telnyx/models/uac_connection_delete_response.rbi +1793 -0
- data/rbi/telnyx/models/uac_connection_list_params.rbi +261 -0
- data/rbi/telnyx/models/uac_connection_list_response.rbi +1727 -0
- data/rbi/telnyx/models/uac_connection_retrieve_params.rbi +35 -0
- data/rbi/telnyx/models/uac_connection_retrieve_response.rbi +1793 -0
- data/rbi/telnyx/models/uac_connection_update_params.rbi +1463 -0
- data/rbi/telnyx/models/uac_connection_update_response.rbi +1793 -0
- data/rbi/telnyx/models/uac_connections/action_check_registration_status_params.rbi +40 -0
- data/rbi/telnyx/models/uac_connections/action_check_registration_status_response.rbi +237 -0
- data/rbi/telnyx/models.rbi +12 -0
- data/rbi/telnyx/resources/ai/assistants/canary_deploys.rbi +6 -14
- data/rbi/telnyx/resources/ai/chat.rbi +11 -1
- data/rbi/telnyx/resources/ai/openai/chat.rbi +147 -0
- data/rbi/telnyx/resources/ai/openai.rbi +16 -0
- data/rbi/telnyx/resources/ai.rbi +5 -5
- data/rbi/telnyx/resources/uac_connections/actions.rbi +33 -0
- data/rbi/telnyx/resources/uac_connections.rbi +348 -0
- data/sig/telnyx/client.rbs +2 -0
- data/sig/telnyx/models/ai/assistants/canary_deploy.rbs +113 -4
- data/sig/telnyx/models/ai/assistants/canary_deploy_response.rbs +113 -8
- data/sig/telnyx/models/ai/chat_create_completion_params.rbs +26 -0
- data/sig/telnyx/models/ai/openai/chat_create_completion_params.rbs +434 -0
- data/sig/telnyx/models/ai/openai/chat_create_completion_response.rbs +11 -0
- data/sig/telnyx/models/ai/openai_list_models_params.rbs +17 -0
- data/sig/telnyx/models/ai/openai_list_models_response.rbs +58 -0
- data/sig/telnyx/models/uac_connection_create_params.rbs +609 -0
- data/sig/telnyx/models/uac_connection_create_response.rbs +741 -0
- data/sig/telnyx/models/uac_connection_delete_params.rbs +20 -0
- data/sig/telnyx/models/uac_connection_delete_response.rbs +741 -0
- data/sig/telnyx/models/uac_connection_list_params.rbs +112 -0
- data/sig/telnyx/models/uac_connection_list_response.rbs +722 -0
- data/sig/telnyx/models/uac_connection_retrieve_params.rbs +20 -0
- data/sig/telnyx/models/uac_connection_retrieve_response.rbs +741 -0
- data/sig/telnyx/models/uac_connection_update_params.rbs +615 -0
- data/sig/telnyx/models/uac_connection_update_response.rbs +741 -0
- data/sig/telnyx/models/uac_connections/action_check_registration_status_params.rbs +22 -0
- data/sig/telnyx/models/uac_connections/action_check_registration_status_response.rbs +117 -0
- data/sig/telnyx/models.rbs +12 -0
- data/sig/telnyx/resources/ai/assistants/canary_deploys.rbs +2 -2
- data/sig/telnyx/resources/ai/chat.rbs +2 -0
- data/sig/telnyx/resources/ai/openai/chat.rbs +41 -0
- data/sig/telnyx/resources/ai/openai.rbs +6 -0
- data/sig/telnyx/resources/uac_connections/actions.rbs +14 -0
- data/sig/telnyx/resources/uac_connections.rbs +90 -0
- metadata +59 -5
- data/lib/telnyx/models/ai/assistants/version_config.rb +0 -30
- data/rbi/telnyx/models/ai/assistants/version_config.rbi +0 -45
- data/sig/telnyx/models/ai/assistants/version_config.rbs +0 -19
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
module UacConnections
|
|
6
|
+
# @see Telnyx::Resources::UacConnections::Actions#check_registration_status
|
|
7
|
+
class ActionCheckRegistrationStatusParams < Telnyx::Internal::Type::BaseModel
|
|
8
|
+
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Telnyx::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :id, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(id:, request_options: {})
|
|
17
|
+
# @param id [String]
|
|
18
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
module UacConnections
|
|
6
|
+
# @see Telnyx::Resources::UacConnections::Actions#check_registration_status
|
|
7
|
+
class ActionCheckRegistrationStatusResponse < Telnyx::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute data
|
|
9
|
+
#
|
|
10
|
+
# @return [Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data, nil]
|
|
11
|
+
optional :data, -> { Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data }
|
|
12
|
+
|
|
13
|
+
# @!method initialize(data: nil)
|
|
14
|
+
# @param data [Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data]
|
|
15
|
+
|
|
16
|
+
# @see Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse#data
|
|
17
|
+
class Data < Telnyx::Internal::Type::BaseModel
|
|
18
|
+
# @!attribute ip_address
|
|
19
|
+
# The ip used during the SIP connection
|
|
20
|
+
#
|
|
21
|
+
# @return [String, nil]
|
|
22
|
+
optional :ip_address, String
|
|
23
|
+
|
|
24
|
+
# @!attribute last_registration
|
|
25
|
+
# ISO 8601 formatted date indicating when the resource was last updated.
|
|
26
|
+
#
|
|
27
|
+
# @return [String, nil]
|
|
28
|
+
optional :last_registration, String
|
|
29
|
+
|
|
30
|
+
# @!attribute port
|
|
31
|
+
# The port of the SIP connection
|
|
32
|
+
#
|
|
33
|
+
# @return [Integer, nil]
|
|
34
|
+
optional :port, Integer
|
|
35
|
+
|
|
36
|
+
# @!attribute record_type
|
|
37
|
+
# Identifies the type of the resource.
|
|
38
|
+
#
|
|
39
|
+
# @return [String, nil]
|
|
40
|
+
optional :record_type, String
|
|
41
|
+
|
|
42
|
+
# @!attribute sip_username
|
|
43
|
+
# The user name of the SIP connection
|
|
44
|
+
#
|
|
45
|
+
# @return [String, nil]
|
|
46
|
+
optional :sip_username, String
|
|
47
|
+
|
|
48
|
+
# @!attribute status
|
|
49
|
+
# The current registration status of your SIP connection
|
|
50
|
+
#
|
|
51
|
+
# @return [Symbol, Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status, nil]
|
|
52
|
+
optional :status,
|
|
53
|
+
enum: -> { Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status }
|
|
54
|
+
|
|
55
|
+
# @!attribute transport
|
|
56
|
+
# The protocol of the SIP connection
|
|
57
|
+
#
|
|
58
|
+
# @return [String, nil]
|
|
59
|
+
optional :transport, String
|
|
60
|
+
|
|
61
|
+
# @!attribute user_agent
|
|
62
|
+
# The user agent of the SIP connection
|
|
63
|
+
#
|
|
64
|
+
# @return [String, nil]
|
|
65
|
+
optional :user_agent, String
|
|
66
|
+
|
|
67
|
+
# @!method initialize(ip_address: nil, last_registration: nil, port: nil, record_type: nil, sip_username: nil, status: nil, transport: nil, user_agent: nil)
|
|
68
|
+
# @param ip_address [String] The ip used during the SIP connection
|
|
69
|
+
#
|
|
70
|
+
# @param last_registration [String] ISO 8601 formatted date indicating when the resource was last updated.
|
|
71
|
+
#
|
|
72
|
+
# @param port [Integer] The port of the SIP connection
|
|
73
|
+
#
|
|
74
|
+
# @param record_type [String] Identifies the type of the resource.
|
|
75
|
+
#
|
|
76
|
+
# @param sip_username [String] The user name of the SIP connection
|
|
77
|
+
#
|
|
78
|
+
# @param status [Symbol, Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status] The current registration status of your SIP connection
|
|
79
|
+
#
|
|
80
|
+
# @param transport [String] The protocol of the SIP connection
|
|
81
|
+
#
|
|
82
|
+
# @param user_agent [String] The user agent of the SIP connection
|
|
83
|
+
|
|
84
|
+
# The current registration status of your SIP connection
|
|
85
|
+
#
|
|
86
|
+
# @see Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data#status
|
|
87
|
+
module Status
|
|
88
|
+
extend Telnyx::Internal::Type::Enum
|
|
89
|
+
|
|
90
|
+
NOT_APPLICABLE = :"Not Applicable"
|
|
91
|
+
NOT_REGISTERED = :"Not Registered"
|
|
92
|
+
FAILED = :Failed
|
|
93
|
+
EXPIRED = :Expired
|
|
94
|
+
REGISTERED = :Registered
|
|
95
|
+
UNREGISTERED = :Unregistered
|
|
96
|
+
|
|
97
|
+
# @!method self.values
|
|
98
|
+
# @return [Array<Symbol>]
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
data/lib/telnyx/models.rb
CHANGED
|
@@ -1626,6 +1626,18 @@ module Telnyx
|
|
|
1626
1626
|
|
|
1627
1627
|
TransportProtocol = Telnyx::Models::TransportProtocol
|
|
1628
1628
|
|
|
1629
|
+
UacConnectionCreateParams = Telnyx::Models::UacConnectionCreateParams
|
|
1630
|
+
|
|
1631
|
+
UacConnectionDeleteParams = Telnyx::Models::UacConnectionDeleteParams
|
|
1632
|
+
|
|
1633
|
+
UacConnectionListParams = Telnyx::Models::UacConnectionListParams
|
|
1634
|
+
|
|
1635
|
+
UacConnectionRetrieveParams = Telnyx::Models::UacConnectionRetrieveParams
|
|
1636
|
+
|
|
1637
|
+
UacConnections = Telnyx::Models::UacConnections
|
|
1638
|
+
|
|
1639
|
+
UacConnectionUpdateParams = Telnyx::Models::UacConnectionUpdateParams
|
|
1640
|
+
|
|
1629
1641
|
UnsafeUnwrapWebhookEvent = Telnyx::Models::UnsafeUnwrapWebhookEvent
|
|
1630
1642
|
|
|
1631
1643
|
UnwrapWebhookEvent = Telnyx::Models::UnwrapWebhookEvent
|
|
@@ -11,18 +11,16 @@ module Telnyx
|
|
|
11
11
|
# Creates a new canary deploy configuration with multiple version IDs and their
|
|
12
12
|
# traffic percentages for A/B testing or gradual rollouts of assistant versions.
|
|
13
13
|
#
|
|
14
|
-
# @overload create(assistant_id,
|
|
14
|
+
# @overload create(assistant_id, rules: nil, request_options: {})
|
|
15
15
|
#
|
|
16
16
|
# @param assistant_id [String]
|
|
17
|
-
#
|
|
18
|
-
# @param versions [Array<Telnyx::Models::AI::Assistants::VersionConfig>] List of version configurations
|
|
19
|
-
#
|
|
17
|
+
# @param rules [Array<Telnyx::Models::AI::Assistants::CanaryDeploy::Rule>]
|
|
20
18
|
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
21
19
|
#
|
|
22
20
|
# @return [Telnyx::Models::AI::Assistants::CanaryDeployResponse]
|
|
23
21
|
#
|
|
24
22
|
# @see Telnyx::Models::AI::Assistants::CanaryDeployCreateParams
|
|
25
|
-
def create(assistant_id, params)
|
|
23
|
+
def create(assistant_id, params = {})
|
|
26
24
|
parsed, options = Telnyx::AI::Assistants::CanaryDeployCreateParams.dump_request(params)
|
|
27
25
|
@client.request(
|
|
28
26
|
method: :post,
|
|
@@ -61,18 +59,16 @@ module Telnyx
|
|
|
61
59
|
# percentages. All old versions and percentages are replaces by new ones from this
|
|
62
60
|
# request.
|
|
63
61
|
#
|
|
64
|
-
# @overload update(assistant_id,
|
|
62
|
+
# @overload update(assistant_id, rules: nil, request_options: {})
|
|
65
63
|
#
|
|
66
64
|
# @param assistant_id [String]
|
|
67
|
-
#
|
|
68
|
-
# @param versions [Array<Telnyx::Models::AI::Assistants::VersionConfig>] List of version configurations
|
|
69
|
-
#
|
|
65
|
+
# @param rules [Array<Telnyx::Models::AI::Assistants::CanaryDeploy::Rule>]
|
|
70
66
|
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
71
67
|
#
|
|
72
68
|
# @return [Telnyx::Models::AI::Assistants::CanaryDeployResponse]
|
|
73
69
|
#
|
|
74
70
|
# @see Telnyx::Models::AI::Assistants::CanaryDeployUpdateParams
|
|
75
|
-
def update(assistant_id, params)
|
|
71
|
+
def update(assistant_id, params = {})
|
|
76
72
|
parsed, options = Telnyx::AI::Assistants::CanaryDeployUpdateParams.dump_request(params)
|
|
77
73
|
@client.request(
|
|
78
74
|
method: :put,
|
|
@@ -5,14 +5,17 @@ module Telnyx
|
|
|
5
5
|
class AI
|
|
6
6
|
# Generate text with LLMs
|
|
7
7
|
class Chat
|
|
8
|
+
# @deprecated
|
|
9
|
+
#
|
|
8
10
|
# Some parameter documentations has been truncated, see
|
|
9
11
|
# {Telnyx::Models::AI::ChatCreateCompletionParams} for more details.
|
|
10
12
|
#
|
|
11
|
-
#
|
|
13
|
+
# **Deprecated**: Use `POST /v2/ai/openai/chat/completions` instead. Chat with a
|
|
14
|
+
# language model. This endpoint is consistent with the
|
|
12
15
|
# [OpenAI Chat Completions API](https://platform.openai.com/docs/api-reference/chat)
|
|
13
16
|
# and may be used with the OpenAI JS or Python SDK.
|
|
14
17
|
#
|
|
15
|
-
# @overload create_completion(messages:, api_key_ref: nil, best_of: nil, early_stopping: nil, enable_thinking: nil, frequency_penalty: nil, guided_choice: nil, guided_json: nil, guided_regex: nil, length_penalty: nil, logprobs: nil, max_tokens: nil, min_p: nil, model: nil, n: nil, presence_penalty: nil, response_format: nil, stream: nil, temperature: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, use_beam_search: nil, request_options: {})
|
|
18
|
+
# @overload create_completion(messages:, api_key_ref: nil, best_of: nil, early_stopping: nil, enable_thinking: nil, frequency_penalty: nil, guided_choice: nil, guided_json: nil, guided_regex: nil, length_penalty: nil, logprobs: nil, max_tokens: nil, min_p: nil, model: nil, n: nil, presence_penalty: nil, response_format: nil, seed: nil, stop: nil, stream: nil, temperature: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, use_beam_search: nil, request_options: {})
|
|
16
19
|
#
|
|
17
20
|
# @param messages [Array<Telnyx::Models::AI::ChatCreateCompletionParams::Message>] A list of the previous chat messages for context.
|
|
18
21
|
#
|
|
@@ -48,6 +51,10 @@ module Telnyx
|
|
|
48
51
|
#
|
|
49
52
|
# @param response_format [Telnyx::Models::AI::ChatCreateCompletionParams::ResponseFormat] Use this is you want to guarantee a JSON output without defining a schema. For c
|
|
50
53
|
#
|
|
54
|
+
# @param seed [Integer] If specified, the system will make a best effort to sample deterministically, su
|
|
55
|
+
#
|
|
56
|
+
# @param stop [String, Array<String>] Up to 4 sequences where the API will stop generating further tokens. The returne
|
|
57
|
+
#
|
|
51
58
|
# @param stream [Boolean] Whether or not to stream data-only server-sent events as they become available.
|
|
52
59
|
#
|
|
53
60
|
# @param temperature [Float] Adjusts the "creativity" of the model. Lower values make the model more determin
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Resources
|
|
5
|
+
class AI
|
|
6
|
+
class OpenAI
|
|
7
|
+
class Chat
|
|
8
|
+
# Some parameter documentations has been truncated, see
|
|
9
|
+
# {Telnyx::Models::AI::OpenAI::ChatCreateCompletionParams} for more details.
|
|
10
|
+
#
|
|
11
|
+
# Chat with a language model. This endpoint is consistent with the
|
|
12
|
+
# [OpenAI Chat Completions API](https://platform.openai.com/docs/api-reference/chat)
|
|
13
|
+
# and may be used with the OpenAI JS or Python SDK by setting the base URL to
|
|
14
|
+
# `https://api.telnyx.com/v2/ai/openai`.
|
|
15
|
+
#
|
|
16
|
+
# @overload create_completion(messages:, api_key_ref: nil, best_of: nil, early_stopping: nil, enable_thinking: nil, frequency_penalty: nil, guided_choice: nil, guided_json: nil, guided_regex: nil, length_penalty: nil, logprobs: nil, max_tokens: nil, min_p: nil, model: nil, n: nil, presence_penalty: nil, response_format: nil, seed: nil, stop: nil, stream: nil, temperature: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, use_beam_search: nil, request_options: {})
|
|
17
|
+
#
|
|
18
|
+
# @param messages [Array<Telnyx::Models::AI::OpenAI::ChatCreateCompletionParams::Message>] A list of the previous chat messages for context.
|
|
19
|
+
#
|
|
20
|
+
# @param api_key_ref [String] If you are using an external inference provider like xAI or OpenAI, this field a
|
|
21
|
+
#
|
|
22
|
+
# @param best_of [Integer] This is used with `use_beam_search` to determine how many candidate beams to exp
|
|
23
|
+
#
|
|
24
|
+
# @param early_stopping [Boolean] This is used with `use_beam_search`. If `true`, generation stops as soon as ther
|
|
25
|
+
#
|
|
26
|
+
# @param enable_thinking [Boolean] Whether to enable the thinking/reasoning phase for models that support it (e.g.,
|
|
27
|
+
#
|
|
28
|
+
# @param frequency_penalty [Float] Higher values will penalize the model from repeating the same output tokens.
|
|
29
|
+
#
|
|
30
|
+
# @param guided_choice [Array<String>] If specified, the output will be exactly one of the choices.
|
|
31
|
+
#
|
|
32
|
+
# @param guided_json [Hash{Symbol=>Object}] Must be a valid JSON schema. If specified, the output will follow the JSON schem
|
|
33
|
+
#
|
|
34
|
+
# @param guided_regex [String] If specified, the output will follow the regex pattern.
|
|
35
|
+
#
|
|
36
|
+
# @param length_penalty [Float] This is used with `use_beam_search` to prefer shorter or longer completions.
|
|
37
|
+
#
|
|
38
|
+
# @param logprobs [Boolean] Whether to return log probabilities of the output tokens or not. If true, return
|
|
39
|
+
#
|
|
40
|
+
# @param max_tokens [Integer] Maximum number of completion tokens the model should generate.
|
|
41
|
+
#
|
|
42
|
+
# @param min_p [Float] This is an alternative to `top_p` that [many prefer](https://github.com/huggingf
|
|
43
|
+
#
|
|
44
|
+
# @param model [String] The language model to chat with.
|
|
45
|
+
#
|
|
46
|
+
# @param n [Float] This will return multiple choices for you instead of a single chat completion.
|
|
47
|
+
#
|
|
48
|
+
# @param presence_penalty [Float] Higher values will penalize the model from repeating the same output tokens.
|
|
49
|
+
#
|
|
50
|
+
# @param response_format [Telnyx::Models::AI::OpenAI::ChatCreateCompletionParams::ResponseFormat] Use this is you want to guarantee a JSON output without defining a schema. For c
|
|
51
|
+
#
|
|
52
|
+
# @param seed [Integer] If specified, the system will make a best effort to sample deterministically, su
|
|
53
|
+
#
|
|
54
|
+
# @param stop [String, Array<String>] Up to 4 sequences where the API will stop generating further tokens. The returne
|
|
55
|
+
#
|
|
56
|
+
# @param stream [Boolean] Whether or not to stream data-only server-sent events as they become available.
|
|
57
|
+
#
|
|
58
|
+
# @param temperature [Float] Adjusts the "creativity" of the model. Lower values make the model more determin
|
|
59
|
+
#
|
|
60
|
+
# @param tool_choice [Symbol, Telnyx::Models::AI::OpenAI::ChatCreateCompletionParams::ToolChoice]
|
|
61
|
+
#
|
|
62
|
+
# @param tools [Array<Telnyx::Models::AI::OpenAI::ChatCreateCompletionParams::Tool::Function, Telnyx::Models::AI::OpenAI::ChatCreateCompletionParams::Tool::Retrieval>] The `function` tool type follows the same schema as the [OpenAI Chat Completions
|
|
63
|
+
#
|
|
64
|
+
# @param top_logprobs [Integer] This is used with `logprobs`. An integer between 0 and 20 specifying the number
|
|
65
|
+
#
|
|
66
|
+
# @param top_p [Float] An alternative or complement to `temperature`. This adjusts how many of the top
|
|
67
|
+
#
|
|
68
|
+
# @param use_beam_search [Boolean] Setting this to `true` will allow the model to [explore more completion options]
|
|
69
|
+
#
|
|
70
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
71
|
+
#
|
|
72
|
+
# @return [Hash{Symbol=>Object}]
|
|
73
|
+
#
|
|
74
|
+
# @see Telnyx::Models::AI::OpenAI::ChatCreateCompletionParams
|
|
75
|
+
def create_completion(params)
|
|
76
|
+
parsed, options = Telnyx::AI::OpenAI::ChatCreateCompletionParams.dump_request(params)
|
|
77
|
+
@client.request(
|
|
78
|
+
method: :post,
|
|
79
|
+
path: "ai/openai/chat/completions",
|
|
80
|
+
body: parsed,
|
|
81
|
+
model: Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown],
|
|
82
|
+
options: options
|
|
83
|
+
)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# @api private
|
|
87
|
+
#
|
|
88
|
+
# @param client [Telnyx::Client]
|
|
89
|
+
def initialize(client:)
|
|
90
|
+
@client = client
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
@@ -9,12 +9,38 @@ module Telnyx
|
|
|
9
9
|
# @return [Telnyx::Resources::AI::OpenAI::Embeddings]
|
|
10
10
|
attr_reader :embeddings
|
|
11
11
|
|
|
12
|
+
# @return [Telnyx::Resources::AI::OpenAI::Chat]
|
|
13
|
+
attr_reader :chat
|
|
14
|
+
|
|
15
|
+
# This endpoint returns a list of Open Source and OpenAI models that are available
|
|
16
|
+
# for use. <br /><br /> **Note**: Model `id`'s will be in the form
|
|
17
|
+
# `{source}/{model_name}`. For example `openai/gpt-4` or
|
|
18
|
+
# `mistralai/Mistral-7B-Instruct-v0.1` consistent with HuggingFace naming
|
|
19
|
+
# conventions.
|
|
20
|
+
#
|
|
21
|
+
# @overload list_models(request_options: {})
|
|
22
|
+
#
|
|
23
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
24
|
+
#
|
|
25
|
+
# @return [Telnyx::Models::AI::OpenAIListModelsResponse]
|
|
26
|
+
#
|
|
27
|
+
# @see Telnyx::Models::AI::OpenAIListModelsParams
|
|
28
|
+
def list_models(params = {})
|
|
29
|
+
@client.request(
|
|
30
|
+
method: :get,
|
|
31
|
+
path: "ai/openai/models",
|
|
32
|
+
model: Telnyx::Models::AI::OpenAIListModelsResponse,
|
|
33
|
+
options: params[:request_options]
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
|
|
12
37
|
# @api private
|
|
13
38
|
#
|
|
14
39
|
# @param client [Telnyx::Client]
|
|
15
40
|
def initialize(client:)
|
|
16
41
|
@client = client
|
|
17
42
|
@embeddings = Telnyx::Resources::AI::OpenAI::Embeddings.new(client: client)
|
|
43
|
+
@chat = Telnyx::Resources::AI::OpenAI::Chat.new(client: client)
|
|
18
44
|
end
|
|
19
45
|
end
|
|
20
46
|
end
|
data/lib/telnyx/resources/ai.rb
CHANGED
|
@@ -46,11 +46,13 @@ module Telnyx
|
|
|
46
46
|
# @return [Telnyx::Resources::AI::Tools]
|
|
47
47
|
attr_reader :tools
|
|
48
48
|
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
49
|
+
# @deprecated
|
|
50
|
+
#
|
|
51
|
+
# **Deprecated**: Use `GET /v2/ai/openai/models` instead. This endpoint returns a
|
|
52
|
+
# list of Open Source and OpenAI models that are available for use. <br /><br />
|
|
53
|
+
# **Note**: Model `id`'s will be in the form `{source}/{model_name}`. For example
|
|
54
|
+
# `openai/gpt-4` or `mistralai/Mistral-7B-Instruct-v0.1` consistent with
|
|
55
|
+
# HuggingFace naming conventions.
|
|
54
56
|
#
|
|
55
57
|
# @overload retrieve_models(request_options: {})
|
|
56
58
|
#
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Resources
|
|
5
|
+
class UacConnections
|
|
6
|
+
# UAC connection operations
|
|
7
|
+
class Actions
|
|
8
|
+
# Checks the registration status for a UAC connection (`registration_status`) as
|
|
9
|
+
# well as the timestamp for the last SIP registration event
|
|
10
|
+
# (`registration_status_updated_at`).
|
|
11
|
+
#
|
|
12
|
+
# @overload check_registration_status(id, request_options: {})
|
|
13
|
+
#
|
|
14
|
+
# @param id [String] Identifies the resource.
|
|
15
|
+
#
|
|
16
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
17
|
+
#
|
|
18
|
+
# @return [Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse]
|
|
19
|
+
#
|
|
20
|
+
# @see Telnyx::Models::UacConnections::ActionCheckRegistrationStatusParams
|
|
21
|
+
def check_registration_status(id, params = {})
|
|
22
|
+
@client.request(
|
|
23
|
+
method: :post,
|
|
24
|
+
path: ["uac_connections/%1$s/actions/check_registration_status", id],
|
|
25
|
+
model: Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse,
|
|
26
|
+
options: params[:request_options]
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# @api private
|
|
31
|
+
#
|
|
32
|
+
# @param client [Telnyx::Client]
|
|
33
|
+
def initialize(client:)
|
|
34
|
+
@client = client
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|