Class: Vellum::ModelVersionsClient
- Inherits:
-
Object
- Object
- Vellum::ModelVersionsClient
- Defined in:
- lib/vellum_ai/model_versions/client.rb
Instance Attribute Summary collapse
-
#request_client ⇒ Object
readonly
Returns the value of attribute request_client.
Instance Method Summary collapse
- #initialize(request_client:) ⇒ ModelVersionsClient constructor
-
#retrieve(id:, request_options: nil) ⇒ ModelVersionRead
Deprecated.
Constructor Details
#initialize(request_client:) ⇒ ModelVersionsClient
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_client ⇒ Object (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.
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..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["X_API_KEY"] = .api_key unless &.api_key.nil? req.headers = { **req.headers, **(&.additional_headers || {}) }.compact req.url "#{@request_client.default_environment[:Default]}/v1/model-versions/#{id}" end ModelVersionRead.from_json(json_object: response.body) end |