class Vellum::DeploymentsClient
def initialize(request_client:)
-
(DeploymentsClient)-
Parameters:
-
request_client(RequestClient) --
def initialize(request_client:) # @type [RequestClient] @request_client = request_client end
def list(limit: nil, offset: nil, ordering: nil, status: nil, request_options: nil)
-
(PaginatedSlimDeploymentReadList)-
Parameters:
-
request_options(RequestOptions) -- -
status(DEPLOYMENTS_LIST_REQUEST_STATUS) -- status -
ordering(String) -- Which field to use when ordering the results. -
offset(Integer) -- The initial index from which to return the results. -
limit(Integer) -- Number of results to return per page.
def list(limit: nil, offset: nil, ordering: nil, status: nil, request_options: nil) response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil? req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact req.params = { **(request_options&.additional_query_parameters || {}), "limit": limit, "offset": offset, "ordering": ordering, "status": status }.compact req.url "#{@request_client.default_environment[:Default]}/v1/deployments" end PaginatedSlimDeploymentReadList.from_json(json_object: response.body) end
def retrieve(id:, request_options: nil)
-
(DeploymentRead)-
Parameters:
-
request_options(RequestOptions) -- -
id(String) -- Either the Deployment's ID or its unique name
def retrieve(id:, request_options: nil) response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil? req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact req.url "#{@request_client.default_environment[:Default]}/v1/deployments/#{id}" end DeploymentRead.from_json(json_object: response.body) end
def retrieve_provider_payload(inputs:, deployment_id: nil, deployment_name: nil, release_tag: nil,
-
(DeploymentProviderPayloadResponse)-
Parameters:
-
request_options(RequestOptions) -- -
release_tag(String) -- Optionally specify a release tag if you want to pin to a specific release of the Workflow Deployment -
inputs(Array) -- The list of inputs defined in the Prompt's deployment with their corresponding values.Request of type Array, as a Hash -
deployment_name(String) -- The name of the deployment. Must provide either this or deployment_id. -
deployment_id(String) -- The ID of the deployment. Must provide either this or deployment_name.
def retrieve_provider_payload(inputs:, deployment_id: nil, deployment_name: nil, release_tag: nil, request_options: nil) response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil? req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact req.body = { **(request_options&.additional_body_parameters || {}), deployment_id: deployment_id, deployment_name: deployment_name, inputs: inputs, release_tag: release_tag }.compact req.url "#{@request_client.default_environment[:Default]}/v1/deployments/provider-payload" end DeploymentProviderPayloadResponse.from_json(json_object: response.body) end