Class: Cadenya::Resources::Agents::Feedback

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/resources/agents/feedback.rb

Overview

Manage AI agents within a workspace. Agents define AI behavior and tool access.

Instance Method Summary collapse

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.

Parameters:



67
68
69
# File 'lib/cadenya/resources/agents/feedback.rb', line 67

def initialize(client:)
  @client = client
end

Instance Method Details

#list(agent_id, workspace_id:, agent_variation_id: nil, created_after: nil, created_before: nil, cursor: nil, include_info: nil, limit: nil, query: nil, sentiment: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::Objectives::ObjectiveFeedback>

Some parameter documentations has been truncated, see Models::Agents::FeedbackListParams for more details.

Lists feedback submitted across all objectives belonging to an agent. Supports search by comment, sentiment filter, agent variation filter, and creation date range. Results are ordered by creation time, newest first.

Parameters:

  • agent_id (String)

    Path param: The ID of the agent. Supports “external_id:” prefix for external IDs

  • workspace_id (String)

    Path param

  • agent_variation_id (String)

    Query param: Optional filter to limit results to feedback on objectives run by a

  • created_after (Time)

    Query param: Inclusive lower bound on feedback creation time.

  • created_before (Time)

    Query param: Exclusive upper bound on feedback creation time.

  • cursor (String)

    Query param: Pagination cursor from previous response.

  • include_info (Boolean)

    Query param: When set to true you may use more of your alloted API rate-limit

  • limit (Integer)

    Query param: Maximum number of results to return.

  • query (String)

    Query param: Free-text search applied to the feedback comment. Case-insensitive

  • sentiment (Symbol, Cadenya::Models::Agents::FeedbackListParams::Sentiment)

    Query param: Filter by sentiment. UNSPECIFIED returns feedback regardless of sco

  • request_options (Cadenya::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/cadenya/resources/agents/feedback.rb', line 42

def list(agent_id, params)
  parsed, options = Cadenya::Agents::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/agents/%2$s/feedback", workspace_id, agent_id],
    query: query.transform_keys(
      agent_variation_id: "agentVariationId",
      created_after: "createdAfter",
      created_before: "createdBefore",
      include_info: "includeInfo"
    ),
    page: Cadenya::Internal::CursorPagination,
    model: Cadenya::Objectives::ObjectiveFeedback,
    options: options
  )
end