Class: Braintrust::Resources::ProjectScores
- Inherits:
-
Object
- Object
- Braintrust::Resources::ProjectScores
- Defined in:
- lib/braintrust/resources/project_scores.rb
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Braintrust::Models::ProjectScore
Create a new project_score.
-
#delete(project_score_id, opts = {}) ⇒ Braintrust::Models::ProjectScore
Delete a project_score object by its id.
-
#initialize(client:) ⇒ ProjectScores
constructor
A new instance of ProjectScores.
-
#list(params = {}, opts = {}) ⇒ Braintrust::ListObjects<Braintrust::Models::ProjectScore>
List out all project_scores.
-
#replace(params = {}, opts = {}) ⇒ Braintrust::Models::ProjectScore
Create or replace project_score.
-
#retrieve(project_score_id, opts = {}) ⇒ Braintrust::Models::ProjectScore
Get a project_score object by its id.
-
#update(project_score_id, params = {}, opts = {}) ⇒ Braintrust::Models::ProjectScore
Partially update a project_score object.
Constructor Details
#initialize(client:) ⇒ ProjectScores
Returns a new instance of ProjectScores.
6 7 8 |
# File 'lib/braintrust/resources/project_scores.rb', line 6 def initialize(client:) @client = client end |
Instance Method Details
#create(params = {}, opts = {}) ⇒ Braintrust::Models::ProjectScore
Create a new project_score. If there is an existing project_score in the project with the same name as the one specified in the request, will return the existing project_score unmodified
25 26 27 28 29 30 31 32 |
# File 'lib/braintrust/resources/project_scores.rb', line 25 def create(params = {}, opts = {}) req = {} req[:method] = :post req[:path] = "/v1/project_score" req[:body] = params req[:model] = Braintrust::Models::ProjectScore @client.request(req, opts) end |
#delete(project_score_id, opts = {}) ⇒ Braintrust::Models::ProjectScore
Delete a project_score object by its id
115 116 117 118 119 120 121 |
# File 'lib/braintrust/resources/project_scores.rb', line 115 def delete(project_score_id, opts = {}) req = {} req[:method] = :delete req[:path] = "/v1/project_score/#{project_score_id}" req[:model] = Braintrust::Models::ProjectScore @client.request(req, opts) end |
#list(params = {}, opts = {}) ⇒ Braintrust::ListObjects<Braintrust::Models::ProjectScore>
List out all project_scores. The project_scores are sorted by creation date, with the most recently-created project_scores coming first
99 100 101 102 103 104 105 106 107 |
# File 'lib/braintrust/resources/project_scores.rb', line 99 def list(params = {}, opts = {}) req = {} req[:method] = :get req[:path] = "/v1/project_score" req[:query] = params req[:page] = Braintrust::ListObjects req[:model] = Braintrust::Models::ProjectScore @client.request(req, opts) end |
#replace(params = {}, opts = {}) ⇒ Braintrust::Models::ProjectScore
Create or replace project_score. If there is an existing project_score in the project with the same name as the one specified in the request, will replace the existing project_score with the provided fields
138 139 140 141 142 143 144 145 |
# File 'lib/braintrust/resources/project_scores.rb', line 138 def replace(params = {}, opts = {}) req = {} req[:method] = :put req[:path] = "/v1/project_score" req[:body] = params req[:model] = Braintrust::Models::ProjectScore @client.request(req, opts) end |
#retrieve(project_score_id, opts = {}) ⇒ Braintrust::Models::ProjectScore
Get a project_score object by its id
40 41 42 43 44 45 46 |
# File 'lib/braintrust/resources/project_scores.rb', line 40 def retrieve(project_score_id, opts = {}) req = {} req[:method] = :get req[:path] = "/v1/project_score/#{project_score_id}" req[:model] = Braintrust::Models::ProjectScore @client.request(req, opts) end |
#update(project_score_id, params = {}, opts = {}) ⇒ Braintrust::Models::ProjectScore
Partially update a project_score object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
64 65 66 67 68 69 70 71 |
# File 'lib/braintrust/resources/project_scores.rb', line 64 def update(project_score_id, params = {}, opts = {}) req = {} req[:method] = :patch req[:path] = "/v1/project_score/#{project_score_id}" req[:body] = params req[:model] = Braintrust::Models::ProjectScore @client.request(req, opts) end |