Class: Telnyx::Resources::AI::Assistants::CanaryDeploys

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/ai/assistants/canary_deploys.rb

Overview

Configure AI assistant specifications

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CanaryDeploys

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CanaryDeploys.

Parameters:



110
111
112
# File 'lib/telnyx/resources/ai/assistants/canary_deploys.rb', line 110

def initialize(client:)
  @client = client
end

Instance Method Details

#create(assistant_id, versions:, request_options: {}) ⇒ Telnyx::Models::AI::Assistants::CanaryDeployResponse

Endpoint to create a canary deploy configuration for an assistant.

Creates a new canary deploy configuration with multiple version IDs and their traffic percentages for A/B testing or gradual rollouts of assistant versions.

Parameters:

Returns:

See Also:



25
26
27
28
29
30
31
32
33
34
# File 'lib/telnyx/resources/ai/assistants/canary_deploys.rb', line 25

def create(assistant_id, params)
  parsed, options = Telnyx::AI::Assistants::CanaryDeployCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["ai/assistants/%1$s/canary-deploys", assistant_id],
    body: parsed,
    model: Telnyx::AI::Assistants::CanaryDeployResponse,
    options: options
  )
end

#delete(assistant_id, request_options: {}) ⇒ nil

Endpoint to delete a canary deploy configuration for an assistant.

Removes all canary deploy configurations for the specified assistant.

Parameters:

Returns:

  • (nil)

See Also:



98
99
100
101
102
103
104
105
# File 'lib/telnyx/resources/ai/assistants/canary_deploys.rb', line 98

def delete(assistant_id, params = {})
  @client.request(
    method: :delete,
    path: ["ai/assistants/%1$s/canary-deploys", assistant_id],
    model: NilClass,
    options: params[:request_options]
  )
end

#retrieve(assistant_id, request_options: {}) ⇒ Telnyx::Models::AI::Assistants::CanaryDeployResponse

Endpoint to get a canary deploy configuration for an assistant.

Retrieves the current canary deploy configuration with all version IDs and their traffic percentages for the specified assistant.

Parameters:

Returns:

See Also:



49
50
51
52
53
54
55
56
# File 'lib/telnyx/resources/ai/assistants/canary_deploys.rb', line 49

def retrieve(assistant_id, params = {})
  @client.request(
    method: :get,
    path: ["ai/assistants/%1$s/canary-deploys", assistant_id],
    model: Telnyx::AI::Assistants::CanaryDeployResponse,
    options: params[:request_options]
  )
end

#update(assistant_id, versions:, request_options: {}) ⇒ Telnyx::Models::AI::Assistants::CanaryDeployResponse

Endpoint to update a canary deploy configuration for an assistant.

Updates the existing canary deploy configuration with new version IDs and percentages. All old versions and percentages are replaces by new ones from this request.

Parameters:

Returns:

See Also:



75
76
77
78
79
80
81
82
83
84
# File 'lib/telnyx/resources/ai/assistants/canary_deploys.rb', line 75

def update(assistant_id, params)
  parsed, options = Telnyx::AI::Assistants::CanaryDeployUpdateParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["ai/assistants/%1$s/canary-deploys", assistant_id],
    body: parsed,
    model: Telnyx::AI::Assistants::CanaryDeployResponse,
    options: options
  )
end