Skip to content
Framework Docs

Aggregate Agent Data

AgentDataAggregatePage beta().agentData().aggregate(AgentDataAggregateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/api/v1/beta/agent-data/:aggregate

Aggregate agent data with grouping and optional counting/first item retrieval.

ParametersExpand Collapse
AgentDataAggregateParams params
Optional<String> organizationId
Optional<String> projectId
String deploymentName

The agent deployment’s name to aggregate data for

Optional<String> collection

The logical agent data collection to aggregate data for

Optional<Boolean> count

Whether to count the number of items in each group

Optional<Filter> filter

A filter object or expression that filters resources listed in the response.

Optional<Eq> eq
One of the following:
double
String
LocalDateTime
Optional<List<Exclude>> excludes
One of the following:
double
String
LocalDateTime
Optional<Gt> gt
One of the following:
double
String
LocalDateTime
Optional<Gte> gte
One of the following:
double
String
LocalDateTime
Optional<List<Include>> includes
One of the following:
double
String
LocalDateTime
Optional<Lt> lt
One of the following:
double
String
LocalDateTime
Optional<Lte> lte
One of the following:
double
String
LocalDateTime
Optional<Ne> ne
One of the following:
double
String
LocalDateTime
Optional<Boolean> first

Whether to return the first item in each group (Sorted by created_at)

Optional<List<String>> groupBy

The fields to group by. If empty, the entire dataset is grouped on. e.g. if left out, can be used for simple count operations

Optional<Long> offset

The offset to start from. If not provided, the first page is returned

maximum1000
minimum0
Optional<String> orderBy

A comma-separated list of fields to order by, sorted in ascending order. Use ‘field_name desc’ to specify descending order.

Optional<Long> pageSize

The maximum number of items to return. The service may return fewer than this value. If unspecified, a default page size will be used. The maximum value is typically 1000; values above this will be coerced to the maximum.

Optional<String> pageToken

A page token, received from a previous list call. Provide this to retrieve the subsequent page.

ReturnsExpand Collapse
class AgentDataAggregateResponse:

API Result for a single group in the aggregate response

GroupKey groupKey
Optional<Long> count
Optional<FirstItem> firstItem

Aggregate Agent Data

package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.beta.agentdata.AgentDataAggregatePage;
import com.llamacloud_prod.api.models.beta.agentdata.AgentDataAggregateParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        AgentDataAggregateParams params = AgentDataAggregateParams.builder()
            .deploymentName("deployment_name")
            .build();
        AgentDataAggregatePage page = client.beta().agentData().aggregate(params);
    }
}
{
  "items": [
    {
      "group_key": {
        "foo": "bar"
      },
      "count": 0,
      "first_item": {
        "foo": "bar"
      }
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}
Returns Examples
{
  "items": [
    {
      "group_key": {
        "foo": "bar"
      },
      "count": 0,
      "first_item": {
        "foo": "bar"
      }
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}