Class: Vellum::ModelVersionsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/vellum_ai/model_versions/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ ModelVersionsClient

Parameters:



13
14
15
16
# File 'lib/vellum_ai/model_versions/client.rb', line 13

def initialize(request_client:)
  # @type [RequestClient]
  @request_client = request_client
end

Instance Attribute Details

#request_clientObject (readonly)

Returns the value of attribute request_client.



9
10
11
# File 'lib/vellum_ai/model_versions/client.rb', line 9

def request_client
  @request_client
end

Instance Method Details

#retrieve(id:, request_options: nil) ⇒ ModelVersionRead

Deprecated. Use the ‘deployments/provider-payload` endpoint to fetch information that we send to Model providers.

Parameters:

  • id (String)

    A UUID string identifying this model version.

  • request_options (RequestOptions) (defaults to: nil)

Returns:



23
24
25
26
27
28
29
30
31
# File 'lib/vellum_ai/model_versions/client.rb', line 23

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/model-versions/#{id}"
  end
  ModelVersionRead.from_json(json_object: response.body)
end