## 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. ### Parameters - `AgentDataAggregateParams params` - `Optional organizationId` - `Optional projectId` - `String deploymentName` The agent deployment's name to aggregate data for - `Optional collection` The logical agent data collection to aggregate data for - `Optional count` Whether to count the number of items in each group - `Optional filter` A filter object or expression that filters resources listed in the response. - `Optional eq` - `double` - `String` - `LocalDateTime` - `Optional> excludes` - `double` - `String` - `LocalDateTime` - `Optional gt` - `double` - `String` - `LocalDateTime` - `Optional gte` - `double` - `String` - `LocalDateTime` - `Optional> includes` - `double` - `String` - `LocalDateTime` - `Optional lt` - `double` - `String` - `LocalDateTime` - `Optional lte` - `double` - `String` - `LocalDateTime` - `Optional ne` - `double` - `String` - `LocalDateTime` - `Optional first` Whether to return the first item in each group (Sorted by created_at) - `Optional> 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 offset` The offset to start from. If not provided, the first page is returned - `Optional orderBy` A comma-separated list of fields to order by, sorted in ascending order. Use 'field_name desc' to specify descending order. - `Optional 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 pageToken` A page token, received from a previous list call. Provide this to retrieve the subsequent page. ### Returns - `class AgentDataAggregateResponse:` API Result for a single group in the aggregate response - `GroupKey groupKey` - `Optional count` - `Optional firstItem` ### Example ```java 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); } } ``` #### Response ```json { "items": [ { "group_key": { "foo": "bar" }, "count": 0, "first_item": { "foo": "bar" } } ], "next_page_token": "next_page_token", "total_size": 0 } ```