Class: Vellum::AsyncTestSuiteRunsClient
- Inherits:
-
Object
- Object
- Vellum::AsyncTestSuiteRunsClient
- 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:) ⇒ AsyncTestSuiteRunsClient 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:) ⇒ AsyncTestSuiteRunsClient
82 83 84 85 |
# File 'lib/vellum_ai/test_suite_runs/client.rb', line 82 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.
78 79 80 |
# File 'lib/vellum_ai/test_suite_runs/client.rb', line 78 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
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/vellum_ai/test_suite_runs/client.rb', line 93 def create(test_suite_id:, exec_config:, request_options: nil) Async do 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 end |
#list_executions(id:, limit: nil, offset: nil, request_options: nil) ⇒ PaginatedTestSuiteRunExecutionList
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/vellum_ai/test_suite_runs/client.rb', line 132 def list_executions(id:, limit: nil, offset: nil, 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.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 end |
#retrieve(id:, request_options: nil) ⇒ TestSuiteRunRead
Retrieve a specific Test Suite Run by ID
115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/vellum_ai/test_suite_runs/client.rb', line 115 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/test-suite-runs/#{id}" end TestSuiteRunRead.from_json(json_object: response.body) end end |