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:



106
107
108
# File 'lib/telnyx/resources/ai/assistants/canary_deploys.rb', line 106

def initialize(client:)
  @client = client
end

Instance Method Details

#create(assistant_id, rules: nil, 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:



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

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:



94
95
96
97
98
99
100
101
# File 'lib/telnyx/resources/ai/assistants/canary_deploys.rb', line 94

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:



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

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, rules: nil, 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:



71
72
73
74
75
76
77
78
79
80
# File 'lib/telnyx/resources/ai/assistants/canary_deploys.rb', line 71

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