# Agent Data ## Get Agent Data `AgentData beta().agentData().get(AgentDataGetParamsparams = AgentDataGetParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **get** `/api/v1/beta/agent-data/{item_id}` Get agent data by ID. ### Parameters - `AgentDataGetParams params` - `Optional itemId` - `Optional organizationId` - `Optional projectId` ### Returns - `class AgentData:` API Result for a single agent data item - `Data data` - `String deploymentName` - `Optional id` - `Optional collection` - `Optional createdAt` - `Optional projectId` - `Optional updatedAt` ### 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.AgentData; import com.llamacloud_prod.api.models.beta.agentdata.AgentDataGetParams; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); AgentData agentData = client.beta().agentData().get("item_id"); } } ``` #### Response ```json { "data": { "foo": "bar" }, "deployment_name": "deployment_name", "id": "id", "collection": "collection", "created_at": "2019-12-27T18:11:19.117Z", "project_id": "project_id", "updated_at": "2019-12-27T18:11:19.117Z" } ``` ## Update Agent Data `AgentData beta().agentData().update(AgentDataUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **put** `/api/v1/beta/agent-data/{item_id}` Update agent data by ID (overwrites). ### Parameters - `AgentDataUpdateParams params` - `Optional itemId` - `Optional organizationId` - `Optional projectId` - `Data data` ### Returns - `class AgentData:` API Result for a single agent data item - `Data data` - `String deploymentName` - `Optional id` - `Optional collection` - `Optional createdAt` - `Optional projectId` - `Optional updatedAt` ### 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.core.JsonValue; import com.llamacloud_prod.api.models.beta.agentdata.AgentData; import com.llamacloud_prod.api.models.beta.agentdata.AgentDataUpdateParams; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); AgentDataUpdateParams params = AgentDataUpdateParams.builder() .itemId("item_id") .data(AgentDataUpdateParams.Data.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build()) .build(); AgentData agentData = client.beta().agentData().update(params); } } ``` #### Response ```json { "data": { "foo": "bar" }, "deployment_name": "deployment_name", "id": "id", "collection": "collection", "created_at": "2019-12-27T18:11:19.117Z", "project_id": "project_id", "updated_at": "2019-12-27T18:11:19.117Z" } ``` ## Delete Agent Data `AgentDataDeleteResponse beta().agentData().delete(AgentDataDeleteParamsparams = AgentDataDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **delete** `/api/v1/beta/agent-data/{item_id}` Delete agent data by ID. ### Parameters - `AgentDataDeleteParams params` - `Optional itemId` - `Optional organizationId` - `Optional projectId` ### Returns - `class AgentDataDeleteResponse:` ### 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.AgentDataDeleteParams; import com.llamacloud_prod.api.models.beta.agentdata.AgentDataDeleteResponse; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); AgentDataDeleteResponse agentData = client.beta().agentData().delete("item_id"); } } ``` #### Response ```json { "foo": "string" } ``` ## Create Agent Data `AgentData beta().agentData().create(AgentDataCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **post** `/api/v1/beta/agent-data` Create new agent data. ### Parameters - `AgentDataCreateParams params` - `Optional organizationId` - `Optional projectId` - `Data data` - `String deploymentName` - `Optional collection` ### Returns - `class AgentData:` API Result for a single agent data item - `Data data` - `String deploymentName` - `Optional id` - `Optional collection` - `Optional createdAt` - `Optional projectId` - `Optional updatedAt` ### 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.core.JsonValue; import com.llamacloud_prod.api.models.beta.agentdata.AgentData; import com.llamacloud_prod.api.models.beta.agentdata.AgentDataCreateParams; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); AgentDataCreateParams params = AgentDataCreateParams.builder() .data(AgentDataCreateParams.Data.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build()) .deploymentName("deployment_name") .build(); AgentData agentData = client.beta().agentData().create(params); } } ``` #### Response ```json { "data": { "foo": "bar" }, "deployment_name": "deployment_name", "id": "id", "collection": "collection", "created_at": "2019-12-27T18:11:19.117Z", "project_id": "project_id", "updated_at": "2019-12-27T18:11:19.117Z" } ``` ## Search Agent Data `AgentDataSearchPage beta().agentData().search(AgentDataSearchParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **post** `/api/v1/beta/agent-data/:search` Search agent data with filtering, sorting, and pagination. ### Parameters - `AgentDataSearchParams params` - `Optional organizationId` - `Optional projectId` - `String deploymentName` The agent deployment's name to search within - `Optional collection` The logical agent data collection to search within - `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 includeTotal` Whether to include the total number of items in the response - `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 AgentData:` API Result for a single agent data item - `Data data` - `String deploymentName` - `Optional id` - `Optional collection` - `Optional createdAt` - `Optional projectId` - `Optional updatedAt` ### 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.AgentDataSearchPage; import com.llamacloud_prod.api.models.beta.agentdata.AgentDataSearchParams; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); AgentDataSearchParams params = AgentDataSearchParams.builder() .deploymentName("deployment_name") .build(); AgentDataSearchPage page = client.beta().agentData().search(params); } } ``` #### Response ```json { "items": [ { "data": { "foo": "bar" }, "deployment_name": "deployment_name", "id": "id", "collection": "collection", "created_at": "2019-12-27T18:11:19.117Z", "project_id": "project_id", "updated_at": "2019-12-27T18:11:19.117Z" } ], "next_page_token": "next_page_token", "total_size": 0 } ``` ## 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 } ``` ## Delete Agent Data By Query `AgentDataDeleteByQueryResponse beta().agentData().deleteByQuery(AgentDataDeleteByQueryParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **post** `/api/v1/beta/agent-data/:delete` Bulk delete agent data by query (deployment_name, collection, optional filters). ### Parameters - `AgentDataDeleteByQueryParams params` - `Optional organizationId` - `Optional projectId` - `String deploymentName` The agent deployment's name to delete data for - `Optional collection` The logical agent data collection to delete from - `Optional filter` Optional filters to select which items to delete - `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` ### Returns - `class AgentDataDeleteByQueryResponse:` API response for bulk delete operation - `long deletedCount` ### 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.AgentDataDeleteByQueryParams; import com.llamacloud_prod.api.models.beta.agentdata.AgentDataDeleteByQueryResponse; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); AgentDataDeleteByQueryParams params = AgentDataDeleteByQueryParams.builder() .deploymentName("deployment_name") .build(); AgentDataDeleteByQueryResponse response = client.beta().agentData().deleteByQuery(params); } } ``` #### Response ```json { "deleted_count": 0 } ``` ## Domain Types ### Agent Data - `class AgentData:` API Result for a single agent data item - `Data data` - `String deploymentName` - `Optional id` - `Optional collection` - `Optional createdAt` - `Optional projectId` - `Optional updatedAt`