Class: Vellum::TestSuiteRunsClient
- Inherits:
-
Object
- Object
- Vellum::TestSuiteRunsClient
- Defined in:
- lib/vellum_ai/test_suite_runs/client.rb
Instance Attribute Summary collapse
-
#request_client ⇒ Object
readonly
Returns the value of attribute request_client.
Instance Method Summary collapse
-
#create(test_suite_id:, exec_config:, request_options: nil) ⇒ TestSuiteRunRead
Trigger a Test Suite and create a new Test Suite Run.
- #initialize(request_client:) ⇒ TestSuiteRunsClient constructor
- #list_executions(id:, limit: nil, offset: nil, request_options: nil) ⇒ PaginatedTestSuiteRunExecutionList
-
#retrieve(id:, request_options: nil) ⇒ TestSuiteRunRead
Retrieve a specific Test Suite Run by ID.
Constructor Details
#initialize(request_client:) ⇒ TestSuiteRunsClient
15 16 17 18 |
# File 'lib/vellum_ai/test_suite_runs/client.rb', line 15 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.
11 12 13 |
# File 'lib/vellum_ai/test_suite_runs/client.rb', line 11 def request_client @request_client end |
Instance Method Details
#create(test_suite_id:, exec_config:, request_options: nil) ⇒ TestSuiteRunRead
Trigger a Test Suite and create a new Test Suite Run
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/vellum_ai/test_suite_runs/client.rb', line 26 def create(test_suite_id:, exec_config:, request_options: nil) response = @request_client.conn.post 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.body = { **(&.additional_body_parameters || {}), test_suite_id: test_suite_id, exec_config: exec_config }.compact req.url "#{@request_client.default_environment[:Default]}/v1/test-suite-runs" end TestSuiteRunRead.from_json(json_object: response.body) end |
#list_executions(id:, limit: nil, offset: nil, request_options: nil) ⇒ PaginatedTestSuiteRunExecutionList
61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/vellum_ai/test_suite_runs/client.rb', line 61 def list_executions(id:, limit: nil, offset: nil, 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.params = { **(&.additional_query_parameters || {}), "limit": limit, "offset": offset }.compact req.url "#{@request_client.default_environment[:Default]}/v1/test-suite-runs/#{id}/executions" end PaginatedTestSuiteRunExecutionList.from_json(json_object: response.body) end |
#retrieve(id:, request_options: nil) ⇒ TestSuiteRunRead
Retrieve a specific Test Suite Run by ID
46 47 48 49 50 51 52 53 54 |
# File 'lib/vellum_ai/test_suite_runs/client.rb', line 46 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/test-suite-runs/#{id}" end TestSuiteRunRead.from_json(json_object: response.body) end |