Class: Vellum::AsyncModelVersionsClient
- Inherits:
-
Object
- Object
- Vellum::AsyncModelVersionsClient
- 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:) ⇒ AsyncModelVersionsClient constructor
-
#retrieve(id:, request_options: nil) ⇒ ModelVersionRead
Deprecated.
Constructor Details
#initialize(request_client:) ⇒ AsyncModelVersionsClient
39 40 41 42 |
# File 'lib/vellum_ai/model_versions/client.rb', line 39 def initialize(request_client:) # @type [AsyncRequestClient] @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Object (readonly)
Returns the value of attribute request_client.
35 36 37 |
# File 'lib/vellum_ai/model_versions/client.rb', line 35 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.
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/vellum_ai/model_versions/client.rb', line 49 def retrieve(id:, request_options: nil) Async do 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 end |