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

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

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:



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

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:



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

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:



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

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:



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

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:



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

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