Class: Cadenya::Resources::Objectives::Feedback
- Inherits:
-
Object
- Object
- Cadenya::Resources::Objectives::Feedback
- Defined in:
- lib/cadenya/resources/objectives/feedback.rb
Instance Method Summary collapse
-
#create(objective_id, workspace_id:, data:, metadata:, request_options: {}) ⇒ Cadenya::Models::Objectives::ObjectiveFeedback
Some parameter documentations has been truncated, see Models::Objectives::FeedbackCreateParams for more details.
-
#initialize(client:) ⇒ Feedback
constructor
private
A new instance of Feedback.
-
#list(objective_id, workspace_id:, cursor: nil, limit: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::Objectives::ObjectiveFeedback>
Some parameter documentations has been truncated, see Models::Objectives::FeedbackListParams for more details.
Constructor Details
#initialize(client:) ⇒ Feedback
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Feedback.
83 84 85 |
# File 'lib/cadenya/resources/objectives/feedback.rb', line 83 def initialize(client:) @client = client end |
Instance Method Details
#create(objective_id, workspace_id:, data:, metadata:, request_options: {}) ⇒ Cadenya::Models::Objectives::ObjectiveFeedback
Some parameter documentations has been truncated, see Models::Objectives::FeedbackCreateParams for more details.
Submits feedback for an objective’s execution. Feedback scores are used by the agent variation scoring system to evaluate and rank variation performance.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/cadenya/resources/objectives/feedback.rb', line 28 def create(objective_id, params) parsed, = Cadenya::Objectives::FeedbackCreateParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["v1/workspaces/%1$s/objectives/%2$s/feedback", workspace_id, objective_id], body: parsed, model: Cadenya::Objectives::ObjectiveFeedback, options: ) end |
#list(objective_id, workspace_id:, cursor: nil, limit: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::Objectives::ObjectiveFeedback>
Some parameter documentations has been truncated, see Models::Objectives::FeedbackListParams for more details.
Lists all feedback submitted for an objective
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/cadenya/resources/objectives/feedback.rb', line 63 def list(objective_id, params) parsed, = Cadenya::Objectives::FeedbackListParams.dump_request(params) query = Cadenya::Internal::Util.encode_query_params(parsed) workspace_id = parsed.delete(:workspace_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["v1/workspaces/%1$s/objectives/%2$s/feedback", workspace_id, objective_id], query: query, page: Cadenya::Internal::CursorPagination, model: Cadenya::Objectives::ObjectiveFeedback, options: ) end |