diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a70954af0..e584de474 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.43.0" + ".": "4.44.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 3da74b165..83094fdf9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 270 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-ae4c1a92306e31f05678c3de72efbf1903b5c09924dacd42a555cc5ccc0e5eb1.yml -openapi_spec_hash: 0973932f9a3f0b46a0933b143878f9fe -config_hash: b40012963b4619be8229fcca0105b627 +configured_endpoints: 271 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-3d8082a8a69fcab4d284f7316a701759c11ccf1e05fc6d45c210cf752833c9bd.yml +openapi_spec_hash: 56ad4f4009878ee5036929cd7f377591 +config_hash: f26d37753793f28a7c52ab44907a355b diff --git a/CHANGELOG.md b/CHANGELOG.md index 3920418c8..9a93f8629 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## 4.44.0 (2026-07-16) + +Full Changelog: [v4.43.0...v4.44.0](https://github.com/openai/openai-java/compare/v4.43.0...v4.44.0) + +### Features + +* **api:** manual updates ([158aa24](https://github.com/openai/openai-java/commit/158aa249beeb1506336b61f10ee0ed2cfe2fff32)) + + +### Bug Fixes + +* **client:** handle response stream keepalive events ([#776](https://github.com/openai/openai-java/issues/776)) ([6eef965](https://github.com/openai/openai-java/commit/6eef9653f95a9be63436c11ced9c1f8f6c192f3b)) +* **deps:** update Jackson to 2.18.9 ([#777](https://github.com/openai/openai-java/issues/777)) ([2935d47](https://github.com/openai/openai-java/commit/2935d47e753fcbef81a6a0d720eedb3ac559ac73)) +* **deps:** update plexus-utils to 4.0.3 ([#780](https://github.com/openai/openai-java/issues/780)) ([6e4e2a7](https://github.com/openai/openai-java/commit/6e4e2a78b2b021288d141ddbedd9fa3e5d592073)) + + +### Chores + +* **deps:** secure build-time Log4j ([#781](https://github.com/openai/openai-java/issues/781)) ([8735bf7](https://github.com/openai/openai-java/commit/8735bf71d18041f35087b6ec2c3fe8f3edcc903b)) + + +### Build System + +* **deps:** update ProGuard to 7.9.1 ([#782](https://github.com/openai/openai-java/issues/782)) ([845b2bc](https://github.com/openai/openai-java/commit/845b2bc87fb077f2ff1a0f81893cd4f4384214b4)) + ## 4.43.0 (2026-07-13) Full Changelog: [v4.42.0...v4.43.0](https://github.com/openai/openai-java/compare/v4.42.0...v4.43.0) diff --git a/README.md b/README.md index 717cb7a18..758892c40 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/4.43.0) -[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/4.43.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/4.43.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/4.44.0) +[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/4.44.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/4.44.0) @@ -11,7 +11,7 @@ The OpenAI Java SDK provides convenient access to the [OpenAI REST API](https:// -The REST API documentation can be found on [platform.openai.com](https://platform.openai.com/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.openai/openai-java/4.43.0). +The REST API documentation can be found on [platform.openai.com](https://platform.openai.com/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.openai/openai-java/4.44.0). @@ -24,7 +24,7 @@ The REST API documentation can be found on [platform.openai.com](https://platfor ### Gradle ```kotlin -implementation("com.openai:openai-java:4.43.0") +implementation("com.openai:openai-java:4.44.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.openai:openai-java:4.43.0") com.openai openai-java - 4.43.0 + 4.44.0 ``` @@ -1433,7 +1433,7 @@ If you're using Spring Boot, then you can use the SDK's [Spring Boot starter](ht #### Gradle ```kotlin -implementation("com.openai:openai-java-spring-boot-starter:4.43.0") +implementation("com.openai:openai-java-spring-boot-starter:4.44.0") ``` #### Maven @@ -1442,7 +1442,7 @@ implementation("com.openai:openai-java-spring-boot-starter:4.43.0") com.openai openai-java-spring-boot-starter - 4.43.0 + 4.44.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index fbf08aad2..3494621f4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.openai" - version = "4.43.0" // x-release-please-version + version = "4.44.0" // x-release-please-version } subprojects { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/auditlogs/AuditLogListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/auditlogs/AuditLogListParams.kt index 9f445f26f..18710092f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/auditlogs/AuditLogListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/auditlogs/AuditLogListParams.kt @@ -776,6 +776,229 @@ private constructor( @JvmField val USER_DELETED = of("user.deleted") + @JvmField val TENANT_METADATA_UPDATED = of("tenant.metadata.updated") + + @JvmField + val TENANT_MICROSOFT_ENTRA_MAPPING_UPSERTED = + of("tenant.microsoft_entra_mapping.upserted") + + @JvmField + val TENANT_MICROSOFT_ENTRA_MAPPING_DELETED = + of("tenant.microsoft_entra_mapping.deleted") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_PROVIDER_CREATED = + of("tenant.workload_identity.provider.created") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_PROVIDER_UPDATED = + of("tenant.workload_identity.provider.updated") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_PROVIDER_ARCHIVED = + of("tenant.workload_identity.provider.archived") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_MAPPING_CREATED = + of("tenant.workload_identity.mapping.created") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_MAPPING_UPDATED = + of("tenant.workload_identity.mapping.updated") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_MAPPING_ARCHIVED = + of("tenant.workload_identity.mapping.archived") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_BINDING_CREATED = + of("tenant.workload_identity.binding.created") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_PRINCIPAL_PROVISIONED = + of("tenant.workload_identity.principal.provisioned") + + @JvmField val TENANT_ADMIN_API_KEY_CREATED = of("tenant.admin_api_key.created") + + @JvmField val TENANT_ADMIN_API_KEY_UPDATED = of("tenant.admin_api_key.updated") + + @JvmField val TENANT_ADMIN_API_KEY_DELETED = of("tenant.admin_api_key.deleted") + + @JvmField val TENANT_PROJECT_API_KEY_CREATED = of("tenant.project_api_key.created") + + @JvmField + val TENANT_CHATGPT_ACCESS_TOKEN_REVOKED = of("tenant.chatgpt_access_token.revoked") + + @JvmField val TENANT_MIGRATION_COMPLETED = of("tenant.migration.completed") + + @JvmField val TENANT_SSO_MIGRATED = of("tenant.sso.migrated") + + @JvmField val TENANT_DOMAINS_MIGRATED = of("tenant.domains.migrated") + + @JvmField val TENANT_SSO_CONNECTION_CREATED = of("tenant.sso_connection.created") + + @JvmField val TENANT_SSO_CONNECTION_UPDATED = of("tenant.sso_connection.updated") + + @JvmField val TENANT_SSO_CONNECTION_DELETED = of("tenant.sso_connection.deleted") + + @JvmField + val TENANT_SSO_CONNECTION_SETUP_STARTED = of("tenant.sso_connection.setup.started") + + @JvmField val TENANT_POLICY_CREATED = of("tenant.policy.created") + + @JvmField val TENANT_POLICY_UPDATED = of("tenant.policy.updated") + + @JvmField val TENANT_POLICY_DELETED = of("tenant.policy.deleted") + + @JvmField val TENANT_POLICY_ATTACHED = of("tenant.policy.attached") + + @JvmField val TENANT_POLICY_DETACHED = of("tenant.policy.detached") + + @JvmField + val TENANT_PRINCIPAL_AUTHENTICATION_POLICY_RESOLVED = + of("tenant.principal_authentication_policy.resolved") + + @JvmField val TENANT_SCIM_SETUP_STARTED = of("tenant.scim.setup.started") + + @JvmField val TENANT_SCIM_DELETION_REQUESTED = of("tenant.scim.deletion.requested") + + @JvmField val TENANT_SCIM_DIRECTORY_CREATED = of("tenant.scim.directory.created") + + @JvmField + val TENANT_PRODUCT_ACCESS_POLICY_UPDATED = of("tenant.product_access_policy.updated") + + @JvmField + val TENANT_RESOURCE_SHARE_GRANT_CREATED = of("tenant.resource_share_grant.created") + + @JvmField + val TENANT_RESOURCE_SHARE_GRANT_UPDATED = of("tenant.resource_share_grant.updated") + + @JvmField + val TENANT_RESOURCE_SHARE_GRANT_ACCEPTED = of("tenant.resource_share_grant.accepted") + + @JvmField + val TENANT_RESOURCE_SHARE_GRANT_DECLINED = of("tenant.resource_share_grant.declined") + + @JvmField + val TENANT_RESOURCE_SHARE_GRANT_REVOKED = of("tenant.resource_share_grant.revoked") + + @JvmField + val TENANT_RESOURCE_SHARE_GRANT_DELETED = of("tenant.resource_share_grant.deleted") + + @JvmField val TENANT_SERVICE_ACCOUNT_UPDATED = of("tenant.service_account.updated") + + @JvmField val TENANT_SERVICE_ACCOUNT_DELETED = of("tenant.service_account.deleted") + + @JvmField + val TENANT_SERVICE_ACCOUNT_TOKEN_REVOKED = of("tenant.service_account.token.revoked") + + @JvmField + val TENANT_BILLING_OVERAGE_LIMIT_UPDATED = of("tenant.billing.overage_limit.updated") + + @JvmField val TENANT_BILLING_ALERTS_UPDATED = of("tenant.billing.alerts.updated") + + @JvmField val TENANT_BILLING_INFO_UPDATED = of("tenant.billing.info.updated") + + @JvmField + val TENANT_USAGE_LIMIT_WORKSPACE_UPDATED = of("tenant.usage_limit.workspace.updated") + + @JvmField val TENANT_USAGE_LIMIT_GROUP_UPDATED = of("tenant.usage_limit.group.updated") + + @JvmField val TENANT_USAGE_LIMIT_USER_UPDATED = of("tenant.usage_limit.user.updated") + + @JvmField + val TENANT_USAGE_LIMIT_INCREASE_REQUEST_UPDATED = + of("tenant.usage_limit.increase_request.updated") + + @JvmField + val TENANT_USAGE_LIMIT_INCREASE_REQUEST_RESOLVED = + of("tenant.usage_limit.increase_request.resolved") + + @JvmField val TENANT_GROUP_CREATED = of("tenant.group.created") + + @JvmField val TENANT_GROUP_UPDATED = of("tenant.group.updated") + + @JvmField val TENANT_GROUP_DELETED = of("tenant.group.deleted") + + @JvmField val TENANT_GROUP_MEMBER_ADDED = of("tenant.group.member.added") + + @JvmField val TENANT_GROUP_MEMBER_REMOVED = of("tenant.group.member.removed") + + @JvmField + val TENANT_MIGRATION_ROLLOUT_STATUS_UPDATED = + of("tenant.migration_rollout.status.updated") + + @JvmField + val TENANT_MIGRATION_ROLLOUT_TIER_UPDATED = of("tenant.migration_rollout.tier.updated") + + @JvmField val TENANT_ROLE_METADATA_UPDATED = of("tenant.role.metadata.updated") + + @JvmField val TENANT_CUSTOM_ROLE_CREATED = of("tenant.custom_role.created") + + @JvmField val TENANT_CUSTOM_ROLE_UPDATED = of("tenant.custom_role.updated") + + @JvmField val TENANT_CUSTOM_ROLE_DELETED = of("tenant.custom_role.deleted") + + @JvmField val TENANT_ROLE_ASSIGNMENT_CREATED = of("tenant.role_assignment.created") + + @JvmField val TENANT_ROLE_ASSIGNMENT_DELETED = of("tenant.role_assignment.deleted") + + @JvmField + val TENANT_RESOURCE_ROLE_ASSIGNMENT_CREATED = + of("tenant.resource_role_assignment.created") + + @JvmField + val TENANT_RESOURCE_ROLE_ASSIGNMENT_DELETED = + of("tenant.resource_role_assignment.deleted") + + @JvmField val TENANT_RESOURCE_ACCESS_UPDATED = of("tenant.resource_access.updated") + + @JvmField val TENANT_RESOURCE_ACCESS_DELETED = of("tenant.resource_access.deleted") + + @JvmField val TENANT_SESSION_POLICY_CREATED = of("tenant.session_policy.created") + + @JvmField val TENANT_SESSION_POLICY_UPDATED = of("tenant.session_policy.updated") + + @JvmField val TENANT_SESSION_POLICY_DELETED = of("tenant.session_policy.deleted") + + @JvmField + val TENANT_SESSION_REVOCATION_STARTED = of("tenant.session_revocation.started") + + @JvmField + val TENANT_THIRD_PARTY_APP_POLICY_UPDATED = of("tenant.third_party_app_policy.updated") + + @JvmField val TENANT_USER_ADDED = of("tenant.user.added") + + @JvmField val TENANT_USER_UPDATED = of("tenant.user.updated") + + @JvmField val TENANT_USER_REMOVED = of("tenant.user.removed") + + @JvmField val TENANT_USER_LOOKED_UP = of("tenant.user.looked_up") + + @JvmField val TENANT_USER_INVITED = of("tenant.user.invited") + + @JvmField val TENANT_MEMBERSHIP_REVOKED = of("tenant.membership.revoked") + + @JvmField + val TENANT_API_ORGANIZATION_INVITE_UPSERTED = + of("tenant.api_organization_invite.upserted") + + @JvmField + val TENANT_API_ORGANIZATION_INVITE_DELETED = + of("tenant.api_organization_invite.deleted") + + @JvmField + val TENANT_CHATGPT_WORKSPACE_INVITE_UPSERTED = + of("tenant.chatgpt_workspace_invite.upserted") + + @JvmField val TENANT_MEMBERSHIP_ACCEPTED = of("tenant.membership.accepted") + + @JvmField val TENANT_MEMBERSHIP_DECLINED = of("tenant.membership.declined") + + @JvmField + val TENANT_WORKSPACE_INVITE_EMAIL_SETTINGS_UPDATED = + of("tenant.workspace_invite_email_settings.updated") + @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } @@ -840,6 +1063,90 @@ private constructor( USER_ADDED, USER_UPDATED, USER_DELETED, + TENANT_METADATA_UPDATED, + TENANT_MICROSOFT_ENTRA_MAPPING_UPSERTED, + TENANT_MICROSOFT_ENTRA_MAPPING_DELETED, + TENANT_WORKLOAD_IDENTITY_PROVIDER_CREATED, + TENANT_WORKLOAD_IDENTITY_PROVIDER_UPDATED, + TENANT_WORKLOAD_IDENTITY_PROVIDER_ARCHIVED, + TENANT_WORKLOAD_IDENTITY_MAPPING_CREATED, + TENANT_WORKLOAD_IDENTITY_MAPPING_UPDATED, + TENANT_WORKLOAD_IDENTITY_MAPPING_ARCHIVED, + TENANT_WORKLOAD_IDENTITY_BINDING_CREATED, + TENANT_WORKLOAD_IDENTITY_PRINCIPAL_PROVISIONED, + TENANT_ADMIN_API_KEY_CREATED, + TENANT_ADMIN_API_KEY_UPDATED, + TENANT_ADMIN_API_KEY_DELETED, + TENANT_PROJECT_API_KEY_CREATED, + TENANT_CHATGPT_ACCESS_TOKEN_REVOKED, + TENANT_MIGRATION_COMPLETED, + TENANT_SSO_MIGRATED, + TENANT_DOMAINS_MIGRATED, + TENANT_SSO_CONNECTION_CREATED, + TENANT_SSO_CONNECTION_UPDATED, + TENANT_SSO_CONNECTION_DELETED, + TENANT_SSO_CONNECTION_SETUP_STARTED, + TENANT_POLICY_CREATED, + TENANT_POLICY_UPDATED, + TENANT_POLICY_DELETED, + TENANT_POLICY_ATTACHED, + TENANT_POLICY_DETACHED, + TENANT_PRINCIPAL_AUTHENTICATION_POLICY_RESOLVED, + TENANT_SCIM_SETUP_STARTED, + TENANT_SCIM_DELETION_REQUESTED, + TENANT_SCIM_DIRECTORY_CREATED, + TENANT_PRODUCT_ACCESS_POLICY_UPDATED, + TENANT_RESOURCE_SHARE_GRANT_CREATED, + TENANT_RESOURCE_SHARE_GRANT_UPDATED, + TENANT_RESOURCE_SHARE_GRANT_ACCEPTED, + TENANT_RESOURCE_SHARE_GRANT_DECLINED, + TENANT_RESOURCE_SHARE_GRANT_REVOKED, + TENANT_RESOURCE_SHARE_GRANT_DELETED, + TENANT_SERVICE_ACCOUNT_UPDATED, + TENANT_SERVICE_ACCOUNT_DELETED, + TENANT_SERVICE_ACCOUNT_TOKEN_REVOKED, + TENANT_BILLING_OVERAGE_LIMIT_UPDATED, + TENANT_BILLING_ALERTS_UPDATED, + TENANT_BILLING_INFO_UPDATED, + TENANT_USAGE_LIMIT_WORKSPACE_UPDATED, + TENANT_USAGE_LIMIT_GROUP_UPDATED, + TENANT_USAGE_LIMIT_USER_UPDATED, + TENANT_USAGE_LIMIT_INCREASE_REQUEST_UPDATED, + TENANT_USAGE_LIMIT_INCREASE_REQUEST_RESOLVED, + TENANT_GROUP_CREATED, + TENANT_GROUP_UPDATED, + TENANT_GROUP_DELETED, + TENANT_GROUP_MEMBER_ADDED, + TENANT_GROUP_MEMBER_REMOVED, + TENANT_MIGRATION_ROLLOUT_STATUS_UPDATED, + TENANT_MIGRATION_ROLLOUT_TIER_UPDATED, + TENANT_ROLE_METADATA_UPDATED, + TENANT_CUSTOM_ROLE_CREATED, + TENANT_CUSTOM_ROLE_UPDATED, + TENANT_CUSTOM_ROLE_DELETED, + TENANT_ROLE_ASSIGNMENT_CREATED, + TENANT_ROLE_ASSIGNMENT_DELETED, + TENANT_RESOURCE_ROLE_ASSIGNMENT_CREATED, + TENANT_RESOURCE_ROLE_ASSIGNMENT_DELETED, + TENANT_RESOURCE_ACCESS_UPDATED, + TENANT_RESOURCE_ACCESS_DELETED, + TENANT_SESSION_POLICY_CREATED, + TENANT_SESSION_POLICY_UPDATED, + TENANT_SESSION_POLICY_DELETED, + TENANT_SESSION_REVOCATION_STARTED, + TENANT_THIRD_PARTY_APP_POLICY_UPDATED, + TENANT_USER_ADDED, + TENANT_USER_UPDATED, + TENANT_USER_REMOVED, + TENANT_USER_LOOKED_UP, + TENANT_USER_INVITED, + TENANT_MEMBERSHIP_REVOKED, + TENANT_API_ORGANIZATION_INVITE_UPSERTED, + TENANT_API_ORGANIZATION_INVITE_DELETED, + TENANT_CHATGPT_WORKSPACE_INVITE_UPSERTED, + TENANT_MEMBERSHIP_ACCEPTED, + TENANT_MEMBERSHIP_DECLINED, + TENANT_WORKSPACE_INVITE_EMAIL_SETTINGS_UPDATED, } /** @@ -911,6 +1218,90 @@ private constructor( USER_ADDED, USER_UPDATED, USER_DELETED, + TENANT_METADATA_UPDATED, + TENANT_MICROSOFT_ENTRA_MAPPING_UPSERTED, + TENANT_MICROSOFT_ENTRA_MAPPING_DELETED, + TENANT_WORKLOAD_IDENTITY_PROVIDER_CREATED, + TENANT_WORKLOAD_IDENTITY_PROVIDER_UPDATED, + TENANT_WORKLOAD_IDENTITY_PROVIDER_ARCHIVED, + TENANT_WORKLOAD_IDENTITY_MAPPING_CREATED, + TENANT_WORKLOAD_IDENTITY_MAPPING_UPDATED, + TENANT_WORKLOAD_IDENTITY_MAPPING_ARCHIVED, + TENANT_WORKLOAD_IDENTITY_BINDING_CREATED, + TENANT_WORKLOAD_IDENTITY_PRINCIPAL_PROVISIONED, + TENANT_ADMIN_API_KEY_CREATED, + TENANT_ADMIN_API_KEY_UPDATED, + TENANT_ADMIN_API_KEY_DELETED, + TENANT_PROJECT_API_KEY_CREATED, + TENANT_CHATGPT_ACCESS_TOKEN_REVOKED, + TENANT_MIGRATION_COMPLETED, + TENANT_SSO_MIGRATED, + TENANT_DOMAINS_MIGRATED, + TENANT_SSO_CONNECTION_CREATED, + TENANT_SSO_CONNECTION_UPDATED, + TENANT_SSO_CONNECTION_DELETED, + TENANT_SSO_CONNECTION_SETUP_STARTED, + TENANT_POLICY_CREATED, + TENANT_POLICY_UPDATED, + TENANT_POLICY_DELETED, + TENANT_POLICY_ATTACHED, + TENANT_POLICY_DETACHED, + TENANT_PRINCIPAL_AUTHENTICATION_POLICY_RESOLVED, + TENANT_SCIM_SETUP_STARTED, + TENANT_SCIM_DELETION_REQUESTED, + TENANT_SCIM_DIRECTORY_CREATED, + TENANT_PRODUCT_ACCESS_POLICY_UPDATED, + TENANT_RESOURCE_SHARE_GRANT_CREATED, + TENANT_RESOURCE_SHARE_GRANT_UPDATED, + TENANT_RESOURCE_SHARE_GRANT_ACCEPTED, + TENANT_RESOURCE_SHARE_GRANT_DECLINED, + TENANT_RESOURCE_SHARE_GRANT_REVOKED, + TENANT_RESOURCE_SHARE_GRANT_DELETED, + TENANT_SERVICE_ACCOUNT_UPDATED, + TENANT_SERVICE_ACCOUNT_DELETED, + TENANT_SERVICE_ACCOUNT_TOKEN_REVOKED, + TENANT_BILLING_OVERAGE_LIMIT_UPDATED, + TENANT_BILLING_ALERTS_UPDATED, + TENANT_BILLING_INFO_UPDATED, + TENANT_USAGE_LIMIT_WORKSPACE_UPDATED, + TENANT_USAGE_LIMIT_GROUP_UPDATED, + TENANT_USAGE_LIMIT_USER_UPDATED, + TENANT_USAGE_LIMIT_INCREASE_REQUEST_UPDATED, + TENANT_USAGE_LIMIT_INCREASE_REQUEST_RESOLVED, + TENANT_GROUP_CREATED, + TENANT_GROUP_UPDATED, + TENANT_GROUP_DELETED, + TENANT_GROUP_MEMBER_ADDED, + TENANT_GROUP_MEMBER_REMOVED, + TENANT_MIGRATION_ROLLOUT_STATUS_UPDATED, + TENANT_MIGRATION_ROLLOUT_TIER_UPDATED, + TENANT_ROLE_METADATA_UPDATED, + TENANT_CUSTOM_ROLE_CREATED, + TENANT_CUSTOM_ROLE_UPDATED, + TENANT_CUSTOM_ROLE_DELETED, + TENANT_ROLE_ASSIGNMENT_CREATED, + TENANT_ROLE_ASSIGNMENT_DELETED, + TENANT_RESOURCE_ROLE_ASSIGNMENT_CREATED, + TENANT_RESOURCE_ROLE_ASSIGNMENT_DELETED, + TENANT_RESOURCE_ACCESS_UPDATED, + TENANT_RESOURCE_ACCESS_DELETED, + TENANT_SESSION_POLICY_CREATED, + TENANT_SESSION_POLICY_UPDATED, + TENANT_SESSION_POLICY_DELETED, + TENANT_SESSION_REVOCATION_STARTED, + TENANT_THIRD_PARTY_APP_POLICY_UPDATED, + TENANT_USER_ADDED, + TENANT_USER_UPDATED, + TENANT_USER_REMOVED, + TENANT_USER_LOOKED_UP, + TENANT_USER_INVITED, + TENANT_MEMBERSHIP_REVOKED, + TENANT_API_ORGANIZATION_INVITE_UPSERTED, + TENANT_API_ORGANIZATION_INVITE_DELETED, + TENANT_CHATGPT_WORKSPACE_INVITE_UPSERTED, + TENANT_MEMBERSHIP_ACCEPTED, + TENANT_MEMBERSHIP_DECLINED, + TENANT_WORKSPACE_INVITE_EMAIL_SETTINGS_UPDATED, /** * An enum member indicating that [EventType] was instantiated with an unknown value. */ @@ -988,6 +1379,110 @@ private constructor( USER_ADDED -> Value.USER_ADDED USER_UPDATED -> Value.USER_UPDATED USER_DELETED -> Value.USER_DELETED + TENANT_METADATA_UPDATED -> Value.TENANT_METADATA_UPDATED + TENANT_MICROSOFT_ENTRA_MAPPING_UPSERTED -> + Value.TENANT_MICROSOFT_ENTRA_MAPPING_UPSERTED + TENANT_MICROSOFT_ENTRA_MAPPING_DELETED -> + Value.TENANT_MICROSOFT_ENTRA_MAPPING_DELETED + TENANT_WORKLOAD_IDENTITY_PROVIDER_CREATED -> + Value.TENANT_WORKLOAD_IDENTITY_PROVIDER_CREATED + TENANT_WORKLOAD_IDENTITY_PROVIDER_UPDATED -> + Value.TENANT_WORKLOAD_IDENTITY_PROVIDER_UPDATED + TENANT_WORKLOAD_IDENTITY_PROVIDER_ARCHIVED -> + Value.TENANT_WORKLOAD_IDENTITY_PROVIDER_ARCHIVED + TENANT_WORKLOAD_IDENTITY_MAPPING_CREATED -> + Value.TENANT_WORKLOAD_IDENTITY_MAPPING_CREATED + TENANT_WORKLOAD_IDENTITY_MAPPING_UPDATED -> + Value.TENANT_WORKLOAD_IDENTITY_MAPPING_UPDATED + TENANT_WORKLOAD_IDENTITY_MAPPING_ARCHIVED -> + Value.TENANT_WORKLOAD_IDENTITY_MAPPING_ARCHIVED + TENANT_WORKLOAD_IDENTITY_BINDING_CREATED -> + Value.TENANT_WORKLOAD_IDENTITY_BINDING_CREATED + TENANT_WORKLOAD_IDENTITY_PRINCIPAL_PROVISIONED -> + Value.TENANT_WORKLOAD_IDENTITY_PRINCIPAL_PROVISIONED + TENANT_ADMIN_API_KEY_CREATED -> Value.TENANT_ADMIN_API_KEY_CREATED + TENANT_ADMIN_API_KEY_UPDATED -> Value.TENANT_ADMIN_API_KEY_UPDATED + TENANT_ADMIN_API_KEY_DELETED -> Value.TENANT_ADMIN_API_KEY_DELETED + TENANT_PROJECT_API_KEY_CREATED -> Value.TENANT_PROJECT_API_KEY_CREATED + TENANT_CHATGPT_ACCESS_TOKEN_REVOKED -> Value.TENANT_CHATGPT_ACCESS_TOKEN_REVOKED + TENANT_MIGRATION_COMPLETED -> Value.TENANT_MIGRATION_COMPLETED + TENANT_SSO_MIGRATED -> Value.TENANT_SSO_MIGRATED + TENANT_DOMAINS_MIGRATED -> Value.TENANT_DOMAINS_MIGRATED + TENANT_SSO_CONNECTION_CREATED -> Value.TENANT_SSO_CONNECTION_CREATED + TENANT_SSO_CONNECTION_UPDATED -> Value.TENANT_SSO_CONNECTION_UPDATED + TENANT_SSO_CONNECTION_DELETED -> Value.TENANT_SSO_CONNECTION_DELETED + TENANT_SSO_CONNECTION_SETUP_STARTED -> Value.TENANT_SSO_CONNECTION_SETUP_STARTED + TENANT_POLICY_CREATED -> Value.TENANT_POLICY_CREATED + TENANT_POLICY_UPDATED -> Value.TENANT_POLICY_UPDATED + TENANT_POLICY_DELETED -> Value.TENANT_POLICY_DELETED + TENANT_POLICY_ATTACHED -> Value.TENANT_POLICY_ATTACHED + TENANT_POLICY_DETACHED -> Value.TENANT_POLICY_DETACHED + TENANT_PRINCIPAL_AUTHENTICATION_POLICY_RESOLVED -> + Value.TENANT_PRINCIPAL_AUTHENTICATION_POLICY_RESOLVED + TENANT_SCIM_SETUP_STARTED -> Value.TENANT_SCIM_SETUP_STARTED + TENANT_SCIM_DELETION_REQUESTED -> Value.TENANT_SCIM_DELETION_REQUESTED + TENANT_SCIM_DIRECTORY_CREATED -> Value.TENANT_SCIM_DIRECTORY_CREATED + TENANT_PRODUCT_ACCESS_POLICY_UPDATED -> Value.TENANT_PRODUCT_ACCESS_POLICY_UPDATED + TENANT_RESOURCE_SHARE_GRANT_CREATED -> Value.TENANT_RESOURCE_SHARE_GRANT_CREATED + TENANT_RESOURCE_SHARE_GRANT_UPDATED -> Value.TENANT_RESOURCE_SHARE_GRANT_UPDATED + TENANT_RESOURCE_SHARE_GRANT_ACCEPTED -> Value.TENANT_RESOURCE_SHARE_GRANT_ACCEPTED + TENANT_RESOURCE_SHARE_GRANT_DECLINED -> Value.TENANT_RESOURCE_SHARE_GRANT_DECLINED + TENANT_RESOURCE_SHARE_GRANT_REVOKED -> Value.TENANT_RESOURCE_SHARE_GRANT_REVOKED + TENANT_RESOURCE_SHARE_GRANT_DELETED -> Value.TENANT_RESOURCE_SHARE_GRANT_DELETED + TENANT_SERVICE_ACCOUNT_UPDATED -> Value.TENANT_SERVICE_ACCOUNT_UPDATED + TENANT_SERVICE_ACCOUNT_DELETED -> Value.TENANT_SERVICE_ACCOUNT_DELETED + TENANT_SERVICE_ACCOUNT_TOKEN_REVOKED -> Value.TENANT_SERVICE_ACCOUNT_TOKEN_REVOKED + TENANT_BILLING_OVERAGE_LIMIT_UPDATED -> Value.TENANT_BILLING_OVERAGE_LIMIT_UPDATED + TENANT_BILLING_ALERTS_UPDATED -> Value.TENANT_BILLING_ALERTS_UPDATED + TENANT_BILLING_INFO_UPDATED -> Value.TENANT_BILLING_INFO_UPDATED + TENANT_USAGE_LIMIT_WORKSPACE_UPDATED -> Value.TENANT_USAGE_LIMIT_WORKSPACE_UPDATED + TENANT_USAGE_LIMIT_GROUP_UPDATED -> Value.TENANT_USAGE_LIMIT_GROUP_UPDATED + TENANT_USAGE_LIMIT_USER_UPDATED -> Value.TENANT_USAGE_LIMIT_USER_UPDATED + TENANT_USAGE_LIMIT_INCREASE_REQUEST_UPDATED -> + Value.TENANT_USAGE_LIMIT_INCREASE_REQUEST_UPDATED + TENANT_USAGE_LIMIT_INCREASE_REQUEST_RESOLVED -> + Value.TENANT_USAGE_LIMIT_INCREASE_REQUEST_RESOLVED + TENANT_GROUP_CREATED -> Value.TENANT_GROUP_CREATED + TENANT_GROUP_UPDATED -> Value.TENANT_GROUP_UPDATED + TENANT_GROUP_DELETED -> Value.TENANT_GROUP_DELETED + TENANT_GROUP_MEMBER_ADDED -> Value.TENANT_GROUP_MEMBER_ADDED + TENANT_GROUP_MEMBER_REMOVED -> Value.TENANT_GROUP_MEMBER_REMOVED + TENANT_MIGRATION_ROLLOUT_STATUS_UPDATED -> + Value.TENANT_MIGRATION_ROLLOUT_STATUS_UPDATED + TENANT_MIGRATION_ROLLOUT_TIER_UPDATED -> Value.TENANT_MIGRATION_ROLLOUT_TIER_UPDATED + TENANT_ROLE_METADATA_UPDATED -> Value.TENANT_ROLE_METADATA_UPDATED + TENANT_CUSTOM_ROLE_CREATED -> Value.TENANT_CUSTOM_ROLE_CREATED + TENANT_CUSTOM_ROLE_UPDATED -> Value.TENANT_CUSTOM_ROLE_UPDATED + TENANT_CUSTOM_ROLE_DELETED -> Value.TENANT_CUSTOM_ROLE_DELETED + TENANT_ROLE_ASSIGNMENT_CREATED -> Value.TENANT_ROLE_ASSIGNMENT_CREATED + TENANT_ROLE_ASSIGNMENT_DELETED -> Value.TENANT_ROLE_ASSIGNMENT_DELETED + TENANT_RESOURCE_ROLE_ASSIGNMENT_CREATED -> + Value.TENANT_RESOURCE_ROLE_ASSIGNMENT_CREATED + TENANT_RESOURCE_ROLE_ASSIGNMENT_DELETED -> + Value.TENANT_RESOURCE_ROLE_ASSIGNMENT_DELETED + TENANT_RESOURCE_ACCESS_UPDATED -> Value.TENANT_RESOURCE_ACCESS_UPDATED + TENANT_RESOURCE_ACCESS_DELETED -> Value.TENANT_RESOURCE_ACCESS_DELETED + TENANT_SESSION_POLICY_CREATED -> Value.TENANT_SESSION_POLICY_CREATED + TENANT_SESSION_POLICY_UPDATED -> Value.TENANT_SESSION_POLICY_UPDATED + TENANT_SESSION_POLICY_DELETED -> Value.TENANT_SESSION_POLICY_DELETED + TENANT_SESSION_REVOCATION_STARTED -> Value.TENANT_SESSION_REVOCATION_STARTED + TENANT_THIRD_PARTY_APP_POLICY_UPDATED -> Value.TENANT_THIRD_PARTY_APP_POLICY_UPDATED + TENANT_USER_ADDED -> Value.TENANT_USER_ADDED + TENANT_USER_UPDATED -> Value.TENANT_USER_UPDATED + TENANT_USER_REMOVED -> Value.TENANT_USER_REMOVED + TENANT_USER_LOOKED_UP -> Value.TENANT_USER_LOOKED_UP + TENANT_USER_INVITED -> Value.TENANT_USER_INVITED + TENANT_MEMBERSHIP_REVOKED -> Value.TENANT_MEMBERSHIP_REVOKED + TENANT_API_ORGANIZATION_INVITE_UPSERTED -> + Value.TENANT_API_ORGANIZATION_INVITE_UPSERTED + TENANT_API_ORGANIZATION_INVITE_DELETED -> + Value.TENANT_API_ORGANIZATION_INVITE_DELETED + TENANT_CHATGPT_WORKSPACE_INVITE_UPSERTED -> + Value.TENANT_CHATGPT_WORKSPACE_INVITE_UPSERTED + TENANT_MEMBERSHIP_ACCEPTED -> Value.TENANT_MEMBERSHIP_ACCEPTED + TENANT_MEMBERSHIP_DECLINED -> Value.TENANT_MEMBERSHIP_DECLINED + TENANT_WORKSPACE_INVITE_EMAIL_SETTINGS_UPDATED -> + Value.TENANT_WORKSPACE_INVITE_EMAIL_SETTINGS_UPDATED else -> Value._UNKNOWN } @@ -1064,6 +1559,110 @@ private constructor( USER_ADDED -> Known.USER_ADDED USER_UPDATED -> Known.USER_UPDATED USER_DELETED -> Known.USER_DELETED + TENANT_METADATA_UPDATED -> Known.TENANT_METADATA_UPDATED + TENANT_MICROSOFT_ENTRA_MAPPING_UPSERTED -> + Known.TENANT_MICROSOFT_ENTRA_MAPPING_UPSERTED + TENANT_MICROSOFT_ENTRA_MAPPING_DELETED -> + Known.TENANT_MICROSOFT_ENTRA_MAPPING_DELETED + TENANT_WORKLOAD_IDENTITY_PROVIDER_CREATED -> + Known.TENANT_WORKLOAD_IDENTITY_PROVIDER_CREATED + TENANT_WORKLOAD_IDENTITY_PROVIDER_UPDATED -> + Known.TENANT_WORKLOAD_IDENTITY_PROVIDER_UPDATED + TENANT_WORKLOAD_IDENTITY_PROVIDER_ARCHIVED -> + Known.TENANT_WORKLOAD_IDENTITY_PROVIDER_ARCHIVED + TENANT_WORKLOAD_IDENTITY_MAPPING_CREATED -> + Known.TENANT_WORKLOAD_IDENTITY_MAPPING_CREATED + TENANT_WORKLOAD_IDENTITY_MAPPING_UPDATED -> + Known.TENANT_WORKLOAD_IDENTITY_MAPPING_UPDATED + TENANT_WORKLOAD_IDENTITY_MAPPING_ARCHIVED -> + Known.TENANT_WORKLOAD_IDENTITY_MAPPING_ARCHIVED + TENANT_WORKLOAD_IDENTITY_BINDING_CREATED -> + Known.TENANT_WORKLOAD_IDENTITY_BINDING_CREATED + TENANT_WORKLOAD_IDENTITY_PRINCIPAL_PROVISIONED -> + Known.TENANT_WORKLOAD_IDENTITY_PRINCIPAL_PROVISIONED + TENANT_ADMIN_API_KEY_CREATED -> Known.TENANT_ADMIN_API_KEY_CREATED + TENANT_ADMIN_API_KEY_UPDATED -> Known.TENANT_ADMIN_API_KEY_UPDATED + TENANT_ADMIN_API_KEY_DELETED -> Known.TENANT_ADMIN_API_KEY_DELETED + TENANT_PROJECT_API_KEY_CREATED -> Known.TENANT_PROJECT_API_KEY_CREATED + TENANT_CHATGPT_ACCESS_TOKEN_REVOKED -> Known.TENANT_CHATGPT_ACCESS_TOKEN_REVOKED + TENANT_MIGRATION_COMPLETED -> Known.TENANT_MIGRATION_COMPLETED + TENANT_SSO_MIGRATED -> Known.TENANT_SSO_MIGRATED + TENANT_DOMAINS_MIGRATED -> Known.TENANT_DOMAINS_MIGRATED + TENANT_SSO_CONNECTION_CREATED -> Known.TENANT_SSO_CONNECTION_CREATED + TENANT_SSO_CONNECTION_UPDATED -> Known.TENANT_SSO_CONNECTION_UPDATED + TENANT_SSO_CONNECTION_DELETED -> Known.TENANT_SSO_CONNECTION_DELETED + TENANT_SSO_CONNECTION_SETUP_STARTED -> Known.TENANT_SSO_CONNECTION_SETUP_STARTED + TENANT_POLICY_CREATED -> Known.TENANT_POLICY_CREATED + TENANT_POLICY_UPDATED -> Known.TENANT_POLICY_UPDATED + TENANT_POLICY_DELETED -> Known.TENANT_POLICY_DELETED + TENANT_POLICY_ATTACHED -> Known.TENANT_POLICY_ATTACHED + TENANT_POLICY_DETACHED -> Known.TENANT_POLICY_DETACHED + TENANT_PRINCIPAL_AUTHENTICATION_POLICY_RESOLVED -> + Known.TENANT_PRINCIPAL_AUTHENTICATION_POLICY_RESOLVED + TENANT_SCIM_SETUP_STARTED -> Known.TENANT_SCIM_SETUP_STARTED + TENANT_SCIM_DELETION_REQUESTED -> Known.TENANT_SCIM_DELETION_REQUESTED + TENANT_SCIM_DIRECTORY_CREATED -> Known.TENANT_SCIM_DIRECTORY_CREATED + TENANT_PRODUCT_ACCESS_POLICY_UPDATED -> Known.TENANT_PRODUCT_ACCESS_POLICY_UPDATED + TENANT_RESOURCE_SHARE_GRANT_CREATED -> Known.TENANT_RESOURCE_SHARE_GRANT_CREATED + TENANT_RESOURCE_SHARE_GRANT_UPDATED -> Known.TENANT_RESOURCE_SHARE_GRANT_UPDATED + TENANT_RESOURCE_SHARE_GRANT_ACCEPTED -> Known.TENANT_RESOURCE_SHARE_GRANT_ACCEPTED + TENANT_RESOURCE_SHARE_GRANT_DECLINED -> Known.TENANT_RESOURCE_SHARE_GRANT_DECLINED + TENANT_RESOURCE_SHARE_GRANT_REVOKED -> Known.TENANT_RESOURCE_SHARE_GRANT_REVOKED + TENANT_RESOURCE_SHARE_GRANT_DELETED -> Known.TENANT_RESOURCE_SHARE_GRANT_DELETED + TENANT_SERVICE_ACCOUNT_UPDATED -> Known.TENANT_SERVICE_ACCOUNT_UPDATED + TENANT_SERVICE_ACCOUNT_DELETED -> Known.TENANT_SERVICE_ACCOUNT_DELETED + TENANT_SERVICE_ACCOUNT_TOKEN_REVOKED -> Known.TENANT_SERVICE_ACCOUNT_TOKEN_REVOKED + TENANT_BILLING_OVERAGE_LIMIT_UPDATED -> Known.TENANT_BILLING_OVERAGE_LIMIT_UPDATED + TENANT_BILLING_ALERTS_UPDATED -> Known.TENANT_BILLING_ALERTS_UPDATED + TENANT_BILLING_INFO_UPDATED -> Known.TENANT_BILLING_INFO_UPDATED + TENANT_USAGE_LIMIT_WORKSPACE_UPDATED -> Known.TENANT_USAGE_LIMIT_WORKSPACE_UPDATED + TENANT_USAGE_LIMIT_GROUP_UPDATED -> Known.TENANT_USAGE_LIMIT_GROUP_UPDATED + TENANT_USAGE_LIMIT_USER_UPDATED -> Known.TENANT_USAGE_LIMIT_USER_UPDATED + TENANT_USAGE_LIMIT_INCREASE_REQUEST_UPDATED -> + Known.TENANT_USAGE_LIMIT_INCREASE_REQUEST_UPDATED + TENANT_USAGE_LIMIT_INCREASE_REQUEST_RESOLVED -> + Known.TENANT_USAGE_LIMIT_INCREASE_REQUEST_RESOLVED + TENANT_GROUP_CREATED -> Known.TENANT_GROUP_CREATED + TENANT_GROUP_UPDATED -> Known.TENANT_GROUP_UPDATED + TENANT_GROUP_DELETED -> Known.TENANT_GROUP_DELETED + TENANT_GROUP_MEMBER_ADDED -> Known.TENANT_GROUP_MEMBER_ADDED + TENANT_GROUP_MEMBER_REMOVED -> Known.TENANT_GROUP_MEMBER_REMOVED + TENANT_MIGRATION_ROLLOUT_STATUS_UPDATED -> + Known.TENANT_MIGRATION_ROLLOUT_STATUS_UPDATED + TENANT_MIGRATION_ROLLOUT_TIER_UPDATED -> Known.TENANT_MIGRATION_ROLLOUT_TIER_UPDATED + TENANT_ROLE_METADATA_UPDATED -> Known.TENANT_ROLE_METADATA_UPDATED + TENANT_CUSTOM_ROLE_CREATED -> Known.TENANT_CUSTOM_ROLE_CREATED + TENANT_CUSTOM_ROLE_UPDATED -> Known.TENANT_CUSTOM_ROLE_UPDATED + TENANT_CUSTOM_ROLE_DELETED -> Known.TENANT_CUSTOM_ROLE_DELETED + TENANT_ROLE_ASSIGNMENT_CREATED -> Known.TENANT_ROLE_ASSIGNMENT_CREATED + TENANT_ROLE_ASSIGNMENT_DELETED -> Known.TENANT_ROLE_ASSIGNMENT_DELETED + TENANT_RESOURCE_ROLE_ASSIGNMENT_CREATED -> + Known.TENANT_RESOURCE_ROLE_ASSIGNMENT_CREATED + TENANT_RESOURCE_ROLE_ASSIGNMENT_DELETED -> + Known.TENANT_RESOURCE_ROLE_ASSIGNMENT_DELETED + TENANT_RESOURCE_ACCESS_UPDATED -> Known.TENANT_RESOURCE_ACCESS_UPDATED + TENANT_RESOURCE_ACCESS_DELETED -> Known.TENANT_RESOURCE_ACCESS_DELETED + TENANT_SESSION_POLICY_CREATED -> Known.TENANT_SESSION_POLICY_CREATED + TENANT_SESSION_POLICY_UPDATED -> Known.TENANT_SESSION_POLICY_UPDATED + TENANT_SESSION_POLICY_DELETED -> Known.TENANT_SESSION_POLICY_DELETED + TENANT_SESSION_REVOCATION_STARTED -> Known.TENANT_SESSION_REVOCATION_STARTED + TENANT_THIRD_PARTY_APP_POLICY_UPDATED -> Known.TENANT_THIRD_PARTY_APP_POLICY_UPDATED + TENANT_USER_ADDED -> Known.TENANT_USER_ADDED + TENANT_USER_UPDATED -> Known.TENANT_USER_UPDATED + TENANT_USER_REMOVED -> Known.TENANT_USER_REMOVED + TENANT_USER_LOOKED_UP -> Known.TENANT_USER_LOOKED_UP + TENANT_USER_INVITED -> Known.TENANT_USER_INVITED + TENANT_MEMBERSHIP_REVOKED -> Known.TENANT_MEMBERSHIP_REVOKED + TENANT_API_ORGANIZATION_INVITE_UPSERTED -> + Known.TENANT_API_ORGANIZATION_INVITE_UPSERTED + TENANT_API_ORGANIZATION_INVITE_DELETED -> + Known.TENANT_API_ORGANIZATION_INVITE_DELETED + TENANT_CHATGPT_WORKSPACE_INVITE_UPSERTED -> + Known.TENANT_CHATGPT_WORKSPACE_INVITE_UPSERTED + TENANT_MEMBERSHIP_ACCEPTED -> Known.TENANT_MEMBERSHIP_ACCEPTED + TENANT_MEMBERSHIP_DECLINED -> Known.TENANT_MEMBERSHIP_DECLINED + TENANT_WORKSPACE_INVITE_EMAIL_SETTINGS_UPDATED -> + Known.TENANT_WORKSPACE_INVITE_EMAIL_SETTINGS_UPDATED else -> throw OpenAIInvalidDataException("Unknown EventType: $value") } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/auditlogs/AuditLogListResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/auditlogs/AuditLogListResponse.kt index 81c8bf1e1..fe4eb8fed 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/auditlogs/AuditLogListResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/auditlogs/AuditLogListResponse.kt @@ -2850,6 +2850,229 @@ private constructor( @JvmField val USER_DELETED = of("user.deleted") + @JvmField val TENANT_METADATA_UPDATED = of("tenant.metadata.updated") + + @JvmField + val TENANT_MICROSOFT_ENTRA_MAPPING_UPSERTED = + of("tenant.microsoft_entra_mapping.upserted") + + @JvmField + val TENANT_MICROSOFT_ENTRA_MAPPING_DELETED = + of("tenant.microsoft_entra_mapping.deleted") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_PROVIDER_CREATED = + of("tenant.workload_identity.provider.created") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_PROVIDER_UPDATED = + of("tenant.workload_identity.provider.updated") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_PROVIDER_ARCHIVED = + of("tenant.workload_identity.provider.archived") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_MAPPING_CREATED = + of("tenant.workload_identity.mapping.created") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_MAPPING_UPDATED = + of("tenant.workload_identity.mapping.updated") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_MAPPING_ARCHIVED = + of("tenant.workload_identity.mapping.archived") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_BINDING_CREATED = + of("tenant.workload_identity.binding.created") + + @JvmField + val TENANT_WORKLOAD_IDENTITY_PRINCIPAL_PROVISIONED = + of("tenant.workload_identity.principal.provisioned") + + @JvmField val TENANT_ADMIN_API_KEY_CREATED = of("tenant.admin_api_key.created") + + @JvmField val TENANT_ADMIN_API_KEY_UPDATED = of("tenant.admin_api_key.updated") + + @JvmField val TENANT_ADMIN_API_KEY_DELETED = of("tenant.admin_api_key.deleted") + + @JvmField val TENANT_PROJECT_API_KEY_CREATED = of("tenant.project_api_key.created") + + @JvmField + val TENANT_CHATGPT_ACCESS_TOKEN_REVOKED = of("tenant.chatgpt_access_token.revoked") + + @JvmField val TENANT_MIGRATION_COMPLETED = of("tenant.migration.completed") + + @JvmField val TENANT_SSO_MIGRATED = of("tenant.sso.migrated") + + @JvmField val TENANT_DOMAINS_MIGRATED = of("tenant.domains.migrated") + + @JvmField val TENANT_SSO_CONNECTION_CREATED = of("tenant.sso_connection.created") + + @JvmField val TENANT_SSO_CONNECTION_UPDATED = of("tenant.sso_connection.updated") + + @JvmField val TENANT_SSO_CONNECTION_DELETED = of("tenant.sso_connection.deleted") + + @JvmField + val TENANT_SSO_CONNECTION_SETUP_STARTED = of("tenant.sso_connection.setup.started") + + @JvmField val TENANT_POLICY_CREATED = of("tenant.policy.created") + + @JvmField val TENANT_POLICY_UPDATED = of("tenant.policy.updated") + + @JvmField val TENANT_POLICY_DELETED = of("tenant.policy.deleted") + + @JvmField val TENANT_POLICY_ATTACHED = of("tenant.policy.attached") + + @JvmField val TENANT_POLICY_DETACHED = of("tenant.policy.detached") + + @JvmField + val TENANT_PRINCIPAL_AUTHENTICATION_POLICY_RESOLVED = + of("tenant.principal_authentication_policy.resolved") + + @JvmField val TENANT_SCIM_SETUP_STARTED = of("tenant.scim.setup.started") + + @JvmField val TENANT_SCIM_DELETION_REQUESTED = of("tenant.scim.deletion.requested") + + @JvmField val TENANT_SCIM_DIRECTORY_CREATED = of("tenant.scim.directory.created") + + @JvmField + val TENANT_PRODUCT_ACCESS_POLICY_UPDATED = of("tenant.product_access_policy.updated") + + @JvmField + val TENANT_RESOURCE_SHARE_GRANT_CREATED = of("tenant.resource_share_grant.created") + + @JvmField + val TENANT_RESOURCE_SHARE_GRANT_UPDATED = of("tenant.resource_share_grant.updated") + + @JvmField + val TENANT_RESOURCE_SHARE_GRANT_ACCEPTED = of("tenant.resource_share_grant.accepted") + + @JvmField + val TENANT_RESOURCE_SHARE_GRANT_DECLINED = of("tenant.resource_share_grant.declined") + + @JvmField + val TENANT_RESOURCE_SHARE_GRANT_REVOKED = of("tenant.resource_share_grant.revoked") + + @JvmField + val TENANT_RESOURCE_SHARE_GRANT_DELETED = of("tenant.resource_share_grant.deleted") + + @JvmField val TENANT_SERVICE_ACCOUNT_UPDATED = of("tenant.service_account.updated") + + @JvmField val TENANT_SERVICE_ACCOUNT_DELETED = of("tenant.service_account.deleted") + + @JvmField + val TENANT_SERVICE_ACCOUNT_TOKEN_REVOKED = of("tenant.service_account.token.revoked") + + @JvmField + val TENANT_BILLING_OVERAGE_LIMIT_UPDATED = of("tenant.billing.overage_limit.updated") + + @JvmField val TENANT_BILLING_ALERTS_UPDATED = of("tenant.billing.alerts.updated") + + @JvmField val TENANT_BILLING_INFO_UPDATED = of("tenant.billing.info.updated") + + @JvmField + val TENANT_USAGE_LIMIT_WORKSPACE_UPDATED = of("tenant.usage_limit.workspace.updated") + + @JvmField val TENANT_USAGE_LIMIT_GROUP_UPDATED = of("tenant.usage_limit.group.updated") + + @JvmField val TENANT_USAGE_LIMIT_USER_UPDATED = of("tenant.usage_limit.user.updated") + + @JvmField + val TENANT_USAGE_LIMIT_INCREASE_REQUEST_UPDATED = + of("tenant.usage_limit.increase_request.updated") + + @JvmField + val TENANT_USAGE_LIMIT_INCREASE_REQUEST_RESOLVED = + of("tenant.usage_limit.increase_request.resolved") + + @JvmField val TENANT_GROUP_CREATED = of("tenant.group.created") + + @JvmField val TENANT_GROUP_UPDATED = of("tenant.group.updated") + + @JvmField val TENANT_GROUP_DELETED = of("tenant.group.deleted") + + @JvmField val TENANT_GROUP_MEMBER_ADDED = of("tenant.group.member.added") + + @JvmField val TENANT_GROUP_MEMBER_REMOVED = of("tenant.group.member.removed") + + @JvmField + val TENANT_MIGRATION_ROLLOUT_STATUS_UPDATED = + of("tenant.migration_rollout.status.updated") + + @JvmField + val TENANT_MIGRATION_ROLLOUT_TIER_UPDATED = of("tenant.migration_rollout.tier.updated") + + @JvmField val TENANT_ROLE_METADATA_UPDATED = of("tenant.role.metadata.updated") + + @JvmField val TENANT_CUSTOM_ROLE_CREATED = of("tenant.custom_role.created") + + @JvmField val TENANT_CUSTOM_ROLE_UPDATED = of("tenant.custom_role.updated") + + @JvmField val TENANT_CUSTOM_ROLE_DELETED = of("tenant.custom_role.deleted") + + @JvmField val TENANT_ROLE_ASSIGNMENT_CREATED = of("tenant.role_assignment.created") + + @JvmField val TENANT_ROLE_ASSIGNMENT_DELETED = of("tenant.role_assignment.deleted") + + @JvmField + val TENANT_RESOURCE_ROLE_ASSIGNMENT_CREATED = + of("tenant.resource_role_assignment.created") + + @JvmField + val TENANT_RESOURCE_ROLE_ASSIGNMENT_DELETED = + of("tenant.resource_role_assignment.deleted") + + @JvmField val TENANT_RESOURCE_ACCESS_UPDATED = of("tenant.resource_access.updated") + + @JvmField val TENANT_RESOURCE_ACCESS_DELETED = of("tenant.resource_access.deleted") + + @JvmField val TENANT_SESSION_POLICY_CREATED = of("tenant.session_policy.created") + + @JvmField val TENANT_SESSION_POLICY_UPDATED = of("tenant.session_policy.updated") + + @JvmField val TENANT_SESSION_POLICY_DELETED = of("tenant.session_policy.deleted") + + @JvmField + val TENANT_SESSION_REVOCATION_STARTED = of("tenant.session_revocation.started") + + @JvmField + val TENANT_THIRD_PARTY_APP_POLICY_UPDATED = of("tenant.third_party_app_policy.updated") + + @JvmField val TENANT_USER_ADDED = of("tenant.user.added") + + @JvmField val TENANT_USER_UPDATED = of("tenant.user.updated") + + @JvmField val TENANT_USER_REMOVED = of("tenant.user.removed") + + @JvmField val TENANT_USER_LOOKED_UP = of("tenant.user.looked_up") + + @JvmField val TENANT_USER_INVITED = of("tenant.user.invited") + + @JvmField val TENANT_MEMBERSHIP_REVOKED = of("tenant.membership.revoked") + + @JvmField + val TENANT_API_ORGANIZATION_INVITE_UPSERTED = + of("tenant.api_organization_invite.upserted") + + @JvmField + val TENANT_API_ORGANIZATION_INVITE_DELETED = + of("tenant.api_organization_invite.deleted") + + @JvmField + val TENANT_CHATGPT_WORKSPACE_INVITE_UPSERTED = + of("tenant.chatgpt_workspace_invite.upserted") + + @JvmField val TENANT_MEMBERSHIP_ACCEPTED = of("tenant.membership.accepted") + + @JvmField val TENANT_MEMBERSHIP_DECLINED = of("tenant.membership.declined") + + @JvmField + val TENANT_WORKSPACE_INVITE_EMAIL_SETTINGS_UPDATED = + of("tenant.workspace_invite_email_settings.updated") + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -2914,6 +3137,90 @@ private constructor( USER_ADDED, USER_UPDATED, USER_DELETED, + TENANT_METADATA_UPDATED, + TENANT_MICROSOFT_ENTRA_MAPPING_UPSERTED, + TENANT_MICROSOFT_ENTRA_MAPPING_DELETED, + TENANT_WORKLOAD_IDENTITY_PROVIDER_CREATED, + TENANT_WORKLOAD_IDENTITY_PROVIDER_UPDATED, + TENANT_WORKLOAD_IDENTITY_PROVIDER_ARCHIVED, + TENANT_WORKLOAD_IDENTITY_MAPPING_CREATED, + TENANT_WORKLOAD_IDENTITY_MAPPING_UPDATED, + TENANT_WORKLOAD_IDENTITY_MAPPING_ARCHIVED, + TENANT_WORKLOAD_IDENTITY_BINDING_CREATED, + TENANT_WORKLOAD_IDENTITY_PRINCIPAL_PROVISIONED, + TENANT_ADMIN_API_KEY_CREATED, + TENANT_ADMIN_API_KEY_UPDATED, + TENANT_ADMIN_API_KEY_DELETED, + TENANT_PROJECT_API_KEY_CREATED, + TENANT_CHATGPT_ACCESS_TOKEN_REVOKED, + TENANT_MIGRATION_COMPLETED, + TENANT_SSO_MIGRATED, + TENANT_DOMAINS_MIGRATED, + TENANT_SSO_CONNECTION_CREATED, + TENANT_SSO_CONNECTION_UPDATED, + TENANT_SSO_CONNECTION_DELETED, + TENANT_SSO_CONNECTION_SETUP_STARTED, + TENANT_POLICY_CREATED, + TENANT_POLICY_UPDATED, + TENANT_POLICY_DELETED, + TENANT_POLICY_ATTACHED, + TENANT_POLICY_DETACHED, + TENANT_PRINCIPAL_AUTHENTICATION_POLICY_RESOLVED, + TENANT_SCIM_SETUP_STARTED, + TENANT_SCIM_DELETION_REQUESTED, + TENANT_SCIM_DIRECTORY_CREATED, + TENANT_PRODUCT_ACCESS_POLICY_UPDATED, + TENANT_RESOURCE_SHARE_GRANT_CREATED, + TENANT_RESOURCE_SHARE_GRANT_UPDATED, + TENANT_RESOURCE_SHARE_GRANT_ACCEPTED, + TENANT_RESOURCE_SHARE_GRANT_DECLINED, + TENANT_RESOURCE_SHARE_GRANT_REVOKED, + TENANT_RESOURCE_SHARE_GRANT_DELETED, + TENANT_SERVICE_ACCOUNT_UPDATED, + TENANT_SERVICE_ACCOUNT_DELETED, + TENANT_SERVICE_ACCOUNT_TOKEN_REVOKED, + TENANT_BILLING_OVERAGE_LIMIT_UPDATED, + TENANT_BILLING_ALERTS_UPDATED, + TENANT_BILLING_INFO_UPDATED, + TENANT_USAGE_LIMIT_WORKSPACE_UPDATED, + TENANT_USAGE_LIMIT_GROUP_UPDATED, + TENANT_USAGE_LIMIT_USER_UPDATED, + TENANT_USAGE_LIMIT_INCREASE_REQUEST_UPDATED, + TENANT_USAGE_LIMIT_INCREASE_REQUEST_RESOLVED, + TENANT_GROUP_CREATED, + TENANT_GROUP_UPDATED, + TENANT_GROUP_DELETED, + TENANT_GROUP_MEMBER_ADDED, + TENANT_GROUP_MEMBER_REMOVED, + TENANT_MIGRATION_ROLLOUT_STATUS_UPDATED, + TENANT_MIGRATION_ROLLOUT_TIER_UPDATED, + TENANT_ROLE_METADATA_UPDATED, + TENANT_CUSTOM_ROLE_CREATED, + TENANT_CUSTOM_ROLE_UPDATED, + TENANT_CUSTOM_ROLE_DELETED, + TENANT_ROLE_ASSIGNMENT_CREATED, + TENANT_ROLE_ASSIGNMENT_DELETED, + TENANT_RESOURCE_ROLE_ASSIGNMENT_CREATED, + TENANT_RESOURCE_ROLE_ASSIGNMENT_DELETED, + TENANT_RESOURCE_ACCESS_UPDATED, + TENANT_RESOURCE_ACCESS_DELETED, + TENANT_SESSION_POLICY_CREATED, + TENANT_SESSION_POLICY_UPDATED, + TENANT_SESSION_POLICY_DELETED, + TENANT_SESSION_REVOCATION_STARTED, + TENANT_THIRD_PARTY_APP_POLICY_UPDATED, + TENANT_USER_ADDED, + TENANT_USER_UPDATED, + TENANT_USER_REMOVED, + TENANT_USER_LOOKED_UP, + TENANT_USER_INVITED, + TENANT_MEMBERSHIP_REVOKED, + TENANT_API_ORGANIZATION_INVITE_UPSERTED, + TENANT_API_ORGANIZATION_INVITE_DELETED, + TENANT_CHATGPT_WORKSPACE_INVITE_UPSERTED, + TENANT_MEMBERSHIP_ACCEPTED, + TENANT_MEMBERSHIP_DECLINED, + TENANT_WORKSPACE_INVITE_EMAIL_SETTINGS_UPDATED, } /** @@ -2985,6 +3292,90 @@ private constructor( USER_ADDED, USER_UPDATED, USER_DELETED, + TENANT_METADATA_UPDATED, + TENANT_MICROSOFT_ENTRA_MAPPING_UPSERTED, + TENANT_MICROSOFT_ENTRA_MAPPING_DELETED, + TENANT_WORKLOAD_IDENTITY_PROVIDER_CREATED, + TENANT_WORKLOAD_IDENTITY_PROVIDER_UPDATED, + TENANT_WORKLOAD_IDENTITY_PROVIDER_ARCHIVED, + TENANT_WORKLOAD_IDENTITY_MAPPING_CREATED, + TENANT_WORKLOAD_IDENTITY_MAPPING_UPDATED, + TENANT_WORKLOAD_IDENTITY_MAPPING_ARCHIVED, + TENANT_WORKLOAD_IDENTITY_BINDING_CREATED, + TENANT_WORKLOAD_IDENTITY_PRINCIPAL_PROVISIONED, + TENANT_ADMIN_API_KEY_CREATED, + TENANT_ADMIN_API_KEY_UPDATED, + TENANT_ADMIN_API_KEY_DELETED, + TENANT_PROJECT_API_KEY_CREATED, + TENANT_CHATGPT_ACCESS_TOKEN_REVOKED, + TENANT_MIGRATION_COMPLETED, + TENANT_SSO_MIGRATED, + TENANT_DOMAINS_MIGRATED, + TENANT_SSO_CONNECTION_CREATED, + TENANT_SSO_CONNECTION_UPDATED, + TENANT_SSO_CONNECTION_DELETED, + TENANT_SSO_CONNECTION_SETUP_STARTED, + TENANT_POLICY_CREATED, + TENANT_POLICY_UPDATED, + TENANT_POLICY_DELETED, + TENANT_POLICY_ATTACHED, + TENANT_POLICY_DETACHED, + TENANT_PRINCIPAL_AUTHENTICATION_POLICY_RESOLVED, + TENANT_SCIM_SETUP_STARTED, + TENANT_SCIM_DELETION_REQUESTED, + TENANT_SCIM_DIRECTORY_CREATED, + TENANT_PRODUCT_ACCESS_POLICY_UPDATED, + TENANT_RESOURCE_SHARE_GRANT_CREATED, + TENANT_RESOURCE_SHARE_GRANT_UPDATED, + TENANT_RESOURCE_SHARE_GRANT_ACCEPTED, + TENANT_RESOURCE_SHARE_GRANT_DECLINED, + TENANT_RESOURCE_SHARE_GRANT_REVOKED, + TENANT_RESOURCE_SHARE_GRANT_DELETED, + TENANT_SERVICE_ACCOUNT_UPDATED, + TENANT_SERVICE_ACCOUNT_DELETED, + TENANT_SERVICE_ACCOUNT_TOKEN_REVOKED, + TENANT_BILLING_OVERAGE_LIMIT_UPDATED, + TENANT_BILLING_ALERTS_UPDATED, + TENANT_BILLING_INFO_UPDATED, + TENANT_USAGE_LIMIT_WORKSPACE_UPDATED, + TENANT_USAGE_LIMIT_GROUP_UPDATED, + TENANT_USAGE_LIMIT_USER_UPDATED, + TENANT_USAGE_LIMIT_INCREASE_REQUEST_UPDATED, + TENANT_USAGE_LIMIT_INCREASE_REQUEST_RESOLVED, + TENANT_GROUP_CREATED, + TENANT_GROUP_UPDATED, + TENANT_GROUP_DELETED, + TENANT_GROUP_MEMBER_ADDED, + TENANT_GROUP_MEMBER_REMOVED, + TENANT_MIGRATION_ROLLOUT_STATUS_UPDATED, + TENANT_MIGRATION_ROLLOUT_TIER_UPDATED, + TENANT_ROLE_METADATA_UPDATED, + TENANT_CUSTOM_ROLE_CREATED, + TENANT_CUSTOM_ROLE_UPDATED, + TENANT_CUSTOM_ROLE_DELETED, + TENANT_ROLE_ASSIGNMENT_CREATED, + TENANT_ROLE_ASSIGNMENT_DELETED, + TENANT_RESOURCE_ROLE_ASSIGNMENT_CREATED, + TENANT_RESOURCE_ROLE_ASSIGNMENT_DELETED, + TENANT_RESOURCE_ACCESS_UPDATED, + TENANT_RESOURCE_ACCESS_DELETED, + TENANT_SESSION_POLICY_CREATED, + TENANT_SESSION_POLICY_UPDATED, + TENANT_SESSION_POLICY_DELETED, + TENANT_SESSION_REVOCATION_STARTED, + TENANT_THIRD_PARTY_APP_POLICY_UPDATED, + TENANT_USER_ADDED, + TENANT_USER_UPDATED, + TENANT_USER_REMOVED, + TENANT_USER_LOOKED_UP, + TENANT_USER_INVITED, + TENANT_MEMBERSHIP_REVOKED, + TENANT_API_ORGANIZATION_INVITE_UPSERTED, + TENANT_API_ORGANIZATION_INVITE_DELETED, + TENANT_CHATGPT_WORKSPACE_INVITE_UPSERTED, + TENANT_MEMBERSHIP_ACCEPTED, + TENANT_MEMBERSHIP_DECLINED, + TENANT_WORKSPACE_INVITE_EMAIL_SETTINGS_UPDATED, /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } @@ -3060,6 +3451,110 @@ private constructor( USER_ADDED -> Value.USER_ADDED USER_UPDATED -> Value.USER_UPDATED USER_DELETED -> Value.USER_DELETED + TENANT_METADATA_UPDATED -> Value.TENANT_METADATA_UPDATED + TENANT_MICROSOFT_ENTRA_MAPPING_UPSERTED -> + Value.TENANT_MICROSOFT_ENTRA_MAPPING_UPSERTED + TENANT_MICROSOFT_ENTRA_MAPPING_DELETED -> + Value.TENANT_MICROSOFT_ENTRA_MAPPING_DELETED + TENANT_WORKLOAD_IDENTITY_PROVIDER_CREATED -> + Value.TENANT_WORKLOAD_IDENTITY_PROVIDER_CREATED + TENANT_WORKLOAD_IDENTITY_PROVIDER_UPDATED -> + Value.TENANT_WORKLOAD_IDENTITY_PROVIDER_UPDATED + TENANT_WORKLOAD_IDENTITY_PROVIDER_ARCHIVED -> + Value.TENANT_WORKLOAD_IDENTITY_PROVIDER_ARCHIVED + TENANT_WORKLOAD_IDENTITY_MAPPING_CREATED -> + Value.TENANT_WORKLOAD_IDENTITY_MAPPING_CREATED + TENANT_WORKLOAD_IDENTITY_MAPPING_UPDATED -> + Value.TENANT_WORKLOAD_IDENTITY_MAPPING_UPDATED + TENANT_WORKLOAD_IDENTITY_MAPPING_ARCHIVED -> + Value.TENANT_WORKLOAD_IDENTITY_MAPPING_ARCHIVED + TENANT_WORKLOAD_IDENTITY_BINDING_CREATED -> + Value.TENANT_WORKLOAD_IDENTITY_BINDING_CREATED + TENANT_WORKLOAD_IDENTITY_PRINCIPAL_PROVISIONED -> + Value.TENANT_WORKLOAD_IDENTITY_PRINCIPAL_PROVISIONED + TENANT_ADMIN_API_KEY_CREATED -> Value.TENANT_ADMIN_API_KEY_CREATED + TENANT_ADMIN_API_KEY_UPDATED -> Value.TENANT_ADMIN_API_KEY_UPDATED + TENANT_ADMIN_API_KEY_DELETED -> Value.TENANT_ADMIN_API_KEY_DELETED + TENANT_PROJECT_API_KEY_CREATED -> Value.TENANT_PROJECT_API_KEY_CREATED + TENANT_CHATGPT_ACCESS_TOKEN_REVOKED -> Value.TENANT_CHATGPT_ACCESS_TOKEN_REVOKED + TENANT_MIGRATION_COMPLETED -> Value.TENANT_MIGRATION_COMPLETED + TENANT_SSO_MIGRATED -> Value.TENANT_SSO_MIGRATED + TENANT_DOMAINS_MIGRATED -> Value.TENANT_DOMAINS_MIGRATED + TENANT_SSO_CONNECTION_CREATED -> Value.TENANT_SSO_CONNECTION_CREATED + TENANT_SSO_CONNECTION_UPDATED -> Value.TENANT_SSO_CONNECTION_UPDATED + TENANT_SSO_CONNECTION_DELETED -> Value.TENANT_SSO_CONNECTION_DELETED + TENANT_SSO_CONNECTION_SETUP_STARTED -> Value.TENANT_SSO_CONNECTION_SETUP_STARTED + TENANT_POLICY_CREATED -> Value.TENANT_POLICY_CREATED + TENANT_POLICY_UPDATED -> Value.TENANT_POLICY_UPDATED + TENANT_POLICY_DELETED -> Value.TENANT_POLICY_DELETED + TENANT_POLICY_ATTACHED -> Value.TENANT_POLICY_ATTACHED + TENANT_POLICY_DETACHED -> Value.TENANT_POLICY_DETACHED + TENANT_PRINCIPAL_AUTHENTICATION_POLICY_RESOLVED -> + Value.TENANT_PRINCIPAL_AUTHENTICATION_POLICY_RESOLVED + TENANT_SCIM_SETUP_STARTED -> Value.TENANT_SCIM_SETUP_STARTED + TENANT_SCIM_DELETION_REQUESTED -> Value.TENANT_SCIM_DELETION_REQUESTED + TENANT_SCIM_DIRECTORY_CREATED -> Value.TENANT_SCIM_DIRECTORY_CREATED + TENANT_PRODUCT_ACCESS_POLICY_UPDATED -> Value.TENANT_PRODUCT_ACCESS_POLICY_UPDATED + TENANT_RESOURCE_SHARE_GRANT_CREATED -> Value.TENANT_RESOURCE_SHARE_GRANT_CREATED + TENANT_RESOURCE_SHARE_GRANT_UPDATED -> Value.TENANT_RESOURCE_SHARE_GRANT_UPDATED + TENANT_RESOURCE_SHARE_GRANT_ACCEPTED -> Value.TENANT_RESOURCE_SHARE_GRANT_ACCEPTED + TENANT_RESOURCE_SHARE_GRANT_DECLINED -> Value.TENANT_RESOURCE_SHARE_GRANT_DECLINED + TENANT_RESOURCE_SHARE_GRANT_REVOKED -> Value.TENANT_RESOURCE_SHARE_GRANT_REVOKED + TENANT_RESOURCE_SHARE_GRANT_DELETED -> Value.TENANT_RESOURCE_SHARE_GRANT_DELETED + TENANT_SERVICE_ACCOUNT_UPDATED -> Value.TENANT_SERVICE_ACCOUNT_UPDATED + TENANT_SERVICE_ACCOUNT_DELETED -> Value.TENANT_SERVICE_ACCOUNT_DELETED + TENANT_SERVICE_ACCOUNT_TOKEN_REVOKED -> Value.TENANT_SERVICE_ACCOUNT_TOKEN_REVOKED + TENANT_BILLING_OVERAGE_LIMIT_UPDATED -> Value.TENANT_BILLING_OVERAGE_LIMIT_UPDATED + TENANT_BILLING_ALERTS_UPDATED -> Value.TENANT_BILLING_ALERTS_UPDATED + TENANT_BILLING_INFO_UPDATED -> Value.TENANT_BILLING_INFO_UPDATED + TENANT_USAGE_LIMIT_WORKSPACE_UPDATED -> Value.TENANT_USAGE_LIMIT_WORKSPACE_UPDATED + TENANT_USAGE_LIMIT_GROUP_UPDATED -> Value.TENANT_USAGE_LIMIT_GROUP_UPDATED + TENANT_USAGE_LIMIT_USER_UPDATED -> Value.TENANT_USAGE_LIMIT_USER_UPDATED + TENANT_USAGE_LIMIT_INCREASE_REQUEST_UPDATED -> + Value.TENANT_USAGE_LIMIT_INCREASE_REQUEST_UPDATED + TENANT_USAGE_LIMIT_INCREASE_REQUEST_RESOLVED -> + Value.TENANT_USAGE_LIMIT_INCREASE_REQUEST_RESOLVED + TENANT_GROUP_CREATED -> Value.TENANT_GROUP_CREATED + TENANT_GROUP_UPDATED -> Value.TENANT_GROUP_UPDATED + TENANT_GROUP_DELETED -> Value.TENANT_GROUP_DELETED + TENANT_GROUP_MEMBER_ADDED -> Value.TENANT_GROUP_MEMBER_ADDED + TENANT_GROUP_MEMBER_REMOVED -> Value.TENANT_GROUP_MEMBER_REMOVED + TENANT_MIGRATION_ROLLOUT_STATUS_UPDATED -> + Value.TENANT_MIGRATION_ROLLOUT_STATUS_UPDATED + TENANT_MIGRATION_ROLLOUT_TIER_UPDATED -> Value.TENANT_MIGRATION_ROLLOUT_TIER_UPDATED + TENANT_ROLE_METADATA_UPDATED -> Value.TENANT_ROLE_METADATA_UPDATED + TENANT_CUSTOM_ROLE_CREATED -> Value.TENANT_CUSTOM_ROLE_CREATED + TENANT_CUSTOM_ROLE_UPDATED -> Value.TENANT_CUSTOM_ROLE_UPDATED + TENANT_CUSTOM_ROLE_DELETED -> Value.TENANT_CUSTOM_ROLE_DELETED + TENANT_ROLE_ASSIGNMENT_CREATED -> Value.TENANT_ROLE_ASSIGNMENT_CREATED + TENANT_ROLE_ASSIGNMENT_DELETED -> Value.TENANT_ROLE_ASSIGNMENT_DELETED + TENANT_RESOURCE_ROLE_ASSIGNMENT_CREATED -> + Value.TENANT_RESOURCE_ROLE_ASSIGNMENT_CREATED + TENANT_RESOURCE_ROLE_ASSIGNMENT_DELETED -> + Value.TENANT_RESOURCE_ROLE_ASSIGNMENT_DELETED + TENANT_RESOURCE_ACCESS_UPDATED -> Value.TENANT_RESOURCE_ACCESS_UPDATED + TENANT_RESOURCE_ACCESS_DELETED -> Value.TENANT_RESOURCE_ACCESS_DELETED + TENANT_SESSION_POLICY_CREATED -> Value.TENANT_SESSION_POLICY_CREATED + TENANT_SESSION_POLICY_UPDATED -> Value.TENANT_SESSION_POLICY_UPDATED + TENANT_SESSION_POLICY_DELETED -> Value.TENANT_SESSION_POLICY_DELETED + TENANT_SESSION_REVOCATION_STARTED -> Value.TENANT_SESSION_REVOCATION_STARTED + TENANT_THIRD_PARTY_APP_POLICY_UPDATED -> Value.TENANT_THIRD_PARTY_APP_POLICY_UPDATED + TENANT_USER_ADDED -> Value.TENANT_USER_ADDED + TENANT_USER_UPDATED -> Value.TENANT_USER_UPDATED + TENANT_USER_REMOVED -> Value.TENANT_USER_REMOVED + TENANT_USER_LOOKED_UP -> Value.TENANT_USER_LOOKED_UP + TENANT_USER_INVITED -> Value.TENANT_USER_INVITED + TENANT_MEMBERSHIP_REVOKED -> Value.TENANT_MEMBERSHIP_REVOKED + TENANT_API_ORGANIZATION_INVITE_UPSERTED -> + Value.TENANT_API_ORGANIZATION_INVITE_UPSERTED + TENANT_API_ORGANIZATION_INVITE_DELETED -> + Value.TENANT_API_ORGANIZATION_INVITE_DELETED + TENANT_CHATGPT_WORKSPACE_INVITE_UPSERTED -> + Value.TENANT_CHATGPT_WORKSPACE_INVITE_UPSERTED + TENANT_MEMBERSHIP_ACCEPTED -> Value.TENANT_MEMBERSHIP_ACCEPTED + TENANT_MEMBERSHIP_DECLINED -> Value.TENANT_MEMBERSHIP_DECLINED + TENANT_WORKSPACE_INVITE_EMAIL_SETTINGS_UPDATED -> + Value.TENANT_WORKSPACE_INVITE_EMAIL_SETTINGS_UPDATED else -> Value._UNKNOWN } @@ -3136,6 +3631,110 @@ private constructor( USER_ADDED -> Known.USER_ADDED USER_UPDATED -> Known.USER_UPDATED USER_DELETED -> Known.USER_DELETED + TENANT_METADATA_UPDATED -> Known.TENANT_METADATA_UPDATED + TENANT_MICROSOFT_ENTRA_MAPPING_UPSERTED -> + Known.TENANT_MICROSOFT_ENTRA_MAPPING_UPSERTED + TENANT_MICROSOFT_ENTRA_MAPPING_DELETED -> + Known.TENANT_MICROSOFT_ENTRA_MAPPING_DELETED + TENANT_WORKLOAD_IDENTITY_PROVIDER_CREATED -> + Known.TENANT_WORKLOAD_IDENTITY_PROVIDER_CREATED + TENANT_WORKLOAD_IDENTITY_PROVIDER_UPDATED -> + Known.TENANT_WORKLOAD_IDENTITY_PROVIDER_UPDATED + TENANT_WORKLOAD_IDENTITY_PROVIDER_ARCHIVED -> + Known.TENANT_WORKLOAD_IDENTITY_PROVIDER_ARCHIVED + TENANT_WORKLOAD_IDENTITY_MAPPING_CREATED -> + Known.TENANT_WORKLOAD_IDENTITY_MAPPING_CREATED + TENANT_WORKLOAD_IDENTITY_MAPPING_UPDATED -> + Known.TENANT_WORKLOAD_IDENTITY_MAPPING_UPDATED + TENANT_WORKLOAD_IDENTITY_MAPPING_ARCHIVED -> + Known.TENANT_WORKLOAD_IDENTITY_MAPPING_ARCHIVED + TENANT_WORKLOAD_IDENTITY_BINDING_CREATED -> + Known.TENANT_WORKLOAD_IDENTITY_BINDING_CREATED + TENANT_WORKLOAD_IDENTITY_PRINCIPAL_PROVISIONED -> + Known.TENANT_WORKLOAD_IDENTITY_PRINCIPAL_PROVISIONED + TENANT_ADMIN_API_KEY_CREATED -> Known.TENANT_ADMIN_API_KEY_CREATED + TENANT_ADMIN_API_KEY_UPDATED -> Known.TENANT_ADMIN_API_KEY_UPDATED + TENANT_ADMIN_API_KEY_DELETED -> Known.TENANT_ADMIN_API_KEY_DELETED + TENANT_PROJECT_API_KEY_CREATED -> Known.TENANT_PROJECT_API_KEY_CREATED + TENANT_CHATGPT_ACCESS_TOKEN_REVOKED -> Known.TENANT_CHATGPT_ACCESS_TOKEN_REVOKED + TENANT_MIGRATION_COMPLETED -> Known.TENANT_MIGRATION_COMPLETED + TENANT_SSO_MIGRATED -> Known.TENANT_SSO_MIGRATED + TENANT_DOMAINS_MIGRATED -> Known.TENANT_DOMAINS_MIGRATED + TENANT_SSO_CONNECTION_CREATED -> Known.TENANT_SSO_CONNECTION_CREATED + TENANT_SSO_CONNECTION_UPDATED -> Known.TENANT_SSO_CONNECTION_UPDATED + TENANT_SSO_CONNECTION_DELETED -> Known.TENANT_SSO_CONNECTION_DELETED + TENANT_SSO_CONNECTION_SETUP_STARTED -> Known.TENANT_SSO_CONNECTION_SETUP_STARTED + TENANT_POLICY_CREATED -> Known.TENANT_POLICY_CREATED + TENANT_POLICY_UPDATED -> Known.TENANT_POLICY_UPDATED + TENANT_POLICY_DELETED -> Known.TENANT_POLICY_DELETED + TENANT_POLICY_ATTACHED -> Known.TENANT_POLICY_ATTACHED + TENANT_POLICY_DETACHED -> Known.TENANT_POLICY_DETACHED + TENANT_PRINCIPAL_AUTHENTICATION_POLICY_RESOLVED -> + Known.TENANT_PRINCIPAL_AUTHENTICATION_POLICY_RESOLVED + TENANT_SCIM_SETUP_STARTED -> Known.TENANT_SCIM_SETUP_STARTED + TENANT_SCIM_DELETION_REQUESTED -> Known.TENANT_SCIM_DELETION_REQUESTED + TENANT_SCIM_DIRECTORY_CREATED -> Known.TENANT_SCIM_DIRECTORY_CREATED + TENANT_PRODUCT_ACCESS_POLICY_UPDATED -> Known.TENANT_PRODUCT_ACCESS_POLICY_UPDATED + TENANT_RESOURCE_SHARE_GRANT_CREATED -> Known.TENANT_RESOURCE_SHARE_GRANT_CREATED + TENANT_RESOURCE_SHARE_GRANT_UPDATED -> Known.TENANT_RESOURCE_SHARE_GRANT_UPDATED + TENANT_RESOURCE_SHARE_GRANT_ACCEPTED -> Known.TENANT_RESOURCE_SHARE_GRANT_ACCEPTED + TENANT_RESOURCE_SHARE_GRANT_DECLINED -> Known.TENANT_RESOURCE_SHARE_GRANT_DECLINED + TENANT_RESOURCE_SHARE_GRANT_REVOKED -> Known.TENANT_RESOURCE_SHARE_GRANT_REVOKED + TENANT_RESOURCE_SHARE_GRANT_DELETED -> Known.TENANT_RESOURCE_SHARE_GRANT_DELETED + TENANT_SERVICE_ACCOUNT_UPDATED -> Known.TENANT_SERVICE_ACCOUNT_UPDATED + TENANT_SERVICE_ACCOUNT_DELETED -> Known.TENANT_SERVICE_ACCOUNT_DELETED + TENANT_SERVICE_ACCOUNT_TOKEN_REVOKED -> Known.TENANT_SERVICE_ACCOUNT_TOKEN_REVOKED + TENANT_BILLING_OVERAGE_LIMIT_UPDATED -> Known.TENANT_BILLING_OVERAGE_LIMIT_UPDATED + TENANT_BILLING_ALERTS_UPDATED -> Known.TENANT_BILLING_ALERTS_UPDATED + TENANT_BILLING_INFO_UPDATED -> Known.TENANT_BILLING_INFO_UPDATED + TENANT_USAGE_LIMIT_WORKSPACE_UPDATED -> Known.TENANT_USAGE_LIMIT_WORKSPACE_UPDATED + TENANT_USAGE_LIMIT_GROUP_UPDATED -> Known.TENANT_USAGE_LIMIT_GROUP_UPDATED + TENANT_USAGE_LIMIT_USER_UPDATED -> Known.TENANT_USAGE_LIMIT_USER_UPDATED + TENANT_USAGE_LIMIT_INCREASE_REQUEST_UPDATED -> + Known.TENANT_USAGE_LIMIT_INCREASE_REQUEST_UPDATED + TENANT_USAGE_LIMIT_INCREASE_REQUEST_RESOLVED -> + Known.TENANT_USAGE_LIMIT_INCREASE_REQUEST_RESOLVED + TENANT_GROUP_CREATED -> Known.TENANT_GROUP_CREATED + TENANT_GROUP_UPDATED -> Known.TENANT_GROUP_UPDATED + TENANT_GROUP_DELETED -> Known.TENANT_GROUP_DELETED + TENANT_GROUP_MEMBER_ADDED -> Known.TENANT_GROUP_MEMBER_ADDED + TENANT_GROUP_MEMBER_REMOVED -> Known.TENANT_GROUP_MEMBER_REMOVED + TENANT_MIGRATION_ROLLOUT_STATUS_UPDATED -> + Known.TENANT_MIGRATION_ROLLOUT_STATUS_UPDATED + TENANT_MIGRATION_ROLLOUT_TIER_UPDATED -> Known.TENANT_MIGRATION_ROLLOUT_TIER_UPDATED + TENANT_ROLE_METADATA_UPDATED -> Known.TENANT_ROLE_METADATA_UPDATED + TENANT_CUSTOM_ROLE_CREATED -> Known.TENANT_CUSTOM_ROLE_CREATED + TENANT_CUSTOM_ROLE_UPDATED -> Known.TENANT_CUSTOM_ROLE_UPDATED + TENANT_CUSTOM_ROLE_DELETED -> Known.TENANT_CUSTOM_ROLE_DELETED + TENANT_ROLE_ASSIGNMENT_CREATED -> Known.TENANT_ROLE_ASSIGNMENT_CREATED + TENANT_ROLE_ASSIGNMENT_DELETED -> Known.TENANT_ROLE_ASSIGNMENT_DELETED + TENANT_RESOURCE_ROLE_ASSIGNMENT_CREATED -> + Known.TENANT_RESOURCE_ROLE_ASSIGNMENT_CREATED + TENANT_RESOURCE_ROLE_ASSIGNMENT_DELETED -> + Known.TENANT_RESOURCE_ROLE_ASSIGNMENT_DELETED + TENANT_RESOURCE_ACCESS_UPDATED -> Known.TENANT_RESOURCE_ACCESS_UPDATED + TENANT_RESOURCE_ACCESS_DELETED -> Known.TENANT_RESOURCE_ACCESS_DELETED + TENANT_SESSION_POLICY_CREATED -> Known.TENANT_SESSION_POLICY_CREATED + TENANT_SESSION_POLICY_UPDATED -> Known.TENANT_SESSION_POLICY_UPDATED + TENANT_SESSION_POLICY_DELETED -> Known.TENANT_SESSION_POLICY_DELETED + TENANT_SESSION_REVOCATION_STARTED -> Known.TENANT_SESSION_REVOCATION_STARTED + TENANT_THIRD_PARTY_APP_POLICY_UPDATED -> Known.TENANT_THIRD_PARTY_APP_POLICY_UPDATED + TENANT_USER_ADDED -> Known.TENANT_USER_ADDED + TENANT_USER_UPDATED -> Known.TENANT_USER_UPDATED + TENANT_USER_REMOVED -> Known.TENANT_USER_REMOVED + TENANT_USER_LOOKED_UP -> Known.TENANT_USER_LOOKED_UP + TENANT_USER_INVITED -> Known.TENANT_USER_INVITED + TENANT_MEMBERSHIP_REVOKED -> Known.TENANT_MEMBERSHIP_REVOKED + TENANT_API_ORGANIZATION_INVITE_UPSERTED -> + Known.TENANT_API_ORGANIZATION_INVITE_UPSERTED + TENANT_API_ORGANIZATION_INVITE_DELETED -> + Known.TENANT_API_ORGANIZATION_INVITE_DELETED + TENANT_CHATGPT_WORKSPACE_INVITE_UPSERTED -> + Known.TENANT_CHATGPT_WORKSPACE_INVITE_UPSERTED + TENANT_MEMBERSHIP_ACCEPTED -> Known.TENANT_MEMBERSHIP_ACCEPTED + TENANT_MEMBERSHIP_DECLINED -> Known.TENANT_MEMBERSHIP_DECLINED + TENANT_WORKSPACE_INVITE_EMAIL_SETTINGS_UPDATED -> + Known.TENANT_WORKSPACE_INVITE_EMAIL_SETTINGS_UPDATED else -> throw OpenAIInvalidDataException("Unknown Type: $value") } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ProjectServiceAccount.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ProjectServiceAccount.kt index 9f70e6ac5..ced58e0a7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ProjectServiceAccount.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ProjectServiceAccount.kt @@ -76,7 +76,7 @@ private constructor( @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ /** - * `owner` or `member` + * `owner`, `member`, or `none` * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -206,7 +206,7 @@ private constructor( */ fun object_(object_: JsonValue) = apply { this.object_ = object_ } - /** `owner` or `member` */ + /** `owner`, `member`, or `none` */ fun role(role: Role) = role(JsonField.of(role)) /** @@ -312,7 +312,7 @@ private constructor( } + (role.asKnown().getOrNull()?.validity() ?: 0) - /** `owner` or `member` */ + /** `owner`, `member`, or `none` */ class Role @JsonCreator private constructor(private val value: JsonField) : Enum { /** @@ -331,6 +331,8 @@ private constructor( @JvmField val MEMBER = of("member") + @JvmField val NONE = of("none") + @JvmStatic fun of(value: String) = Role(JsonField.of(value)) } @@ -338,6 +340,7 @@ private constructor( enum class Known { OWNER, MEMBER, + NONE, } /** @@ -352,6 +355,7 @@ private constructor( enum class Value { OWNER, MEMBER, + NONE, /** An enum member indicating that [Role] was instantiated with an unknown value. */ _UNKNOWN, } @@ -367,6 +371,7 @@ private constructor( when (this) { OWNER -> Value.OWNER MEMBER -> Value.MEMBER + NONE -> Value.NONE else -> Value._UNKNOWN } @@ -383,6 +388,7 @@ private constructor( when (this) { OWNER -> Known.OWNER MEMBER -> Known.MEMBER + NONE -> Known.NONE else -> throw OpenAIInvalidDataException("Unknown Role: $value") } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateParams.kt index 193d76a08..574e25910 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateParams.kt @@ -21,8 +21,8 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** - * Creates a new service account in the project. This also returns an unredacted API key for the - * service account. + * Creates a new service account in the project. By default, this also returns an unredacted API key + * for the service account. */ class ServiceAccountCreateParams private constructor( @@ -42,6 +42,14 @@ private constructor( */ fun name(): String = body.name() + /** + * Create the service account without default roles or an API key. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun createServiceAccountOnly(): Optional = body.createServiceAccountOnly() + /** * Returns the raw JSON value of [name]. * @@ -49,6 +57,14 @@ private constructor( */ fun _name(): JsonField = body._name() + /** + * Returns the raw JSON value of [createServiceAccountOnly]. + * + * Unlike [createServiceAccountOnly], this method doesn't throw if the JSON field has an + * unexpected type. + */ + fun _createServiceAccountOnly(): JsonField = body._createServiceAccountOnly() + fun _additionalBodyProperties(): Map = body._additionalProperties() /** Additional headers to send with the request. */ @@ -99,6 +115,7 @@ private constructor( * This is generally only useful if you are already constructing the body separately. * Otherwise, it's more convenient to use the top-level setters instead: * - [name] + * - [createServiceAccountOnly] */ fun body(body: Body) = apply { this.body = body.toBuilder() } @@ -113,6 +130,37 @@ private constructor( */ fun name(name: JsonField) = apply { body.name(name) } + /** Create the service account without default roles or an API key. */ + fun createServiceAccountOnly(createServiceAccountOnly: Boolean?) = apply { + body.createServiceAccountOnly(createServiceAccountOnly) + } + + /** + * Alias for [Builder.createServiceAccountOnly]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun createServiceAccountOnly(createServiceAccountOnly: Boolean) = + createServiceAccountOnly(createServiceAccountOnly as Boolean?) + + /** + * Alias for calling [Builder.createServiceAccountOnly] with + * `createServiceAccountOnly.orElse(null)`. + */ + fun createServiceAccountOnly(createServiceAccountOnly: Optional) = + createServiceAccountOnly(createServiceAccountOnly.getOrNull()) + + /** + * Sets [Builder.createServiceAccountOnly] to an arbitrary JSON value. + * + * You should usually call [Builder.createServiceAccountOnly] with a well-typed [Boolean] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun createServiceAccountOnly(createServiceAccountOnly: JsonField) = apply { + body.createServiceAccountOnly(createServiceAccountOnly) + } + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { body.additionalProperties(additionalBodyProperties) } @@ -267,13 +315,17 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val name: JsonField, + private val createServiceAccountOnly: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of() - ) : this(name, mutableMapOf()) + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("create_service_account_only") + @ExcludeMissing + createServiceAccountOnly: JsonField = JsonMissing.of(), + ) : this(name, createServiceAccountOnly, mutableMapOf()) /** * The name of the service account being created. @@ -283,6 +335,15 @@ private constructor( */ fun name(): String = name.getRequired("name") + /** + * Create the service account without default roles or an API key. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun createServiceAccountOnly(): Optional = + createServiceAccountOnly.getOptional("create_service_account_only") + /** * Returns the raw JSON value of [name]. * @@ -290,6 +351,16 @@ private constructor( */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + /** + * Returns the raw JSON value of [createServiceAccountOnly]. + * + * Unlike [createServiceAccountOnly], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("create_service_account_only") + @ExcludeMissing + fun _createServiceAccountOnly(): JsonField = createServiceAccountOnly + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -319,11 +390,13 @@ private constructor( class Builder internal constructor() { private var name: JsonField? = null + private var createServiceAccountOnly: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(body: Body) = apply { name = body.name + createServiceAccountOnly = body.createServiceAccountOnly additionalProperties = body.additionalProperties.toMutableMap() } @@ -339,6 +412,36 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } + /** Create the service account without default roles or an API key. */ + fun createServiceAccountOnly(createServiceAccountOnly: Boolean?) = + createServiceAccountOnly(JsonField.ofNullable(createServiceAccountOnly)) + + /** + * Alias for [Builder.createServiceAccountOnly]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun createServiceAccountOnly(createServiceAccountOnly: Boolean) = + createServiceAccountOnly(createServiceAccountOnly as Boolean?) + + /** + * Alias for calling [Builder.createServiceAccountOnly] with + * `createServiceAccountOnly.orElse(null)`. + */ + fun createServiceAccountOnly(createServiceAccountOnly: Optional) = + createServiceAccountOnly(createServiceAccountOnly.getOrNull()) + + /** + * Sets [Builder.createServiceAccountOnly] to an arbitrary JSON value. + * + * You should usually call [Builder.createServiceAccountOnly] with a well-typed + * [Boolean] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun createServiceAccountOnly(createServiceAccountOnly: JsonField) = apply { + this.createServiceAccountOnly = createServiceAccountOnly + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -371,7 +474,11 @@ private constructor( * @throws IllegalStateException if any required field is unset. */ fun build(): Body = - Body(checkRequired("name", name), additionalProperties.toMutableMap()) + Body( + checkRequired("name", name), + createServiceAccountOnly, + additionalProperties.toMutableMap(), + ) } private var validated: Boolean = false @@ -391,6 +498,7 @@ private constructor( } name() + createServiceAccountOnly() validated = true } @@ -408,7 +516,10 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = (if (name.asKnown().isPresent) 1 else 0) + @JvmSynthetic + internal fun validity(): Int = + (if (name.asKnown().isPresent) 1 else 0) + + (if (createServiceAccountOnly.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -417,14 +528,18 @@ private constructor( return other is Body && name == other.name && + createServiceAccountOnly == other.createServiceAccountOnly && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(name, additionalProperties) } + private val hashCode: Int by lazy { + Objects.hash(name, createServiceAccountOnly, additionalProperties) + } override fun hashCode(): Int = hashCode - override fun toString() = "Body{name=$name, additionalProperties=$additionalProperties}" + override fun toString() = + "Body{name=$name, createServiceAccountOnly=$createServiceAccountOnly, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateResponse.kt index abd593d58..a628f82d1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateResponse.kt @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty +import com.openai.core.Enum import com.openai.core.ExcludeMissing import com.openai.core.JsonField import com.openai.core.JsonMissing @@ -25,7 +26,7 @@ private constructor( private val createdAt: JsonField, private val name: JsonField, private val object_: JsonValue, - private val role: JsonValue, + private val role: JsonField, private val additionalProperties: MutableMap, ) { @@ -36,7 +37,7 @@ private constructor( @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), @JsonProperty("object") @ExcludeMissing object_: JsonValue = JsonMissing.of(), - @JsonProperty("role") @ExcludeMissing role: JsonValue = JsonMissing.of(), + @JsonProperty("role") @ExcludeMissing role: JsonField = JsonMissing.of(), ) : this(id, apiKey, createdAt, name, object_, role, mutableMapOf()) /** @@ -75,17 +76,13 @@ private constructor( @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ /** - * Service accounts can only have one role of type `member` + * Service accounts created with default project membership have role `member`. Accounts created + * with `create_service_account_only` have role `none`. * - * Expected to always return the following: - * ```java - * JsonValue.from("member") - * ``` - * - * However, this method can be useful for debugging and logging (e.g. if the server responded - * with an unexpected value). + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - @JsonProperty("role") @ExcludeMissing fun _role(): JsonValue = role + fun role(): Role = role.getRequired("role") /** * Returns the raw JSON value of [id]. @@ -115,6 +112,13 @@ private constructor( */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + /** + * Returns the raw JSON value of [role]. + * + * Unlike [role], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("role") @ExcludeMissing fun _role(): JsonField = role + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -138,6 +142,7 @@ private constructor( * .apiKey() * .createdAt() * .name() + * .role() * ``` */ @JvmStatic fun builder() = Builder() @@ -151,7 +156,7 @@ private constructor( private var createdAt: JsonField? = null private var name: JsonField? = null private var object_: JsonValue = JsonValue.from("organization.project.service_account") - private var role: JsonValue = JsonValue.from("member") + private var role: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -223,18 +228,18 @@ private constructor( fun object_(object_: JsonValue) = apply { this.object_ = object_ } /** - * Sets the field to an arbitrary JSON value. - * - * It is usually unnecessary to call this method because the field defaults to the - * following: - * ```java - * JsonValue.from("member") - * ``` + * Service accounts created with default project membership have role `member`. Accounts + * created with `create_service_account_only` have role `none`. + */ + fun role(role: Role) = role(JsonField.of(role)) + + /** + * Sets [Builder.role] to an arbitrary JSON value. * - * This method is primarily for setting the field to an undocumented or not yet supported - * value. + * You should usually call [Builder.role] with a well-typed [Role] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. */ - fun role(role: JsonValue) = apply { this.role = role } + fun role(role: JsonField) = apply { this.role = role } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -266,6 +271,7 @@ private constructor( * .apiKey() * .createdAt() * .name() + * .role() * ``` * * @throws IllegalStateException if any required field is unset. @@ -277,7 +283,7 @@ private constructor( checkRequired("createdAt", createdAt), checkRequired("name", name), object_, - role, + checkRequired("role", role), additionalProperties.toMutableMap(), ) } @@ -306,11 +312,7 @@ private constructor( throw OpenAIInvalidDataException("'object_' is invalid, received $it") } } - _role().let { - if (it != JsonValue.from("member")) { - throw OpenAIInvalidDataException("'role' is invalid, received $it") - } - } + role().validate() validated = true } @@ -336,7 +338,7 @@ private constructor( object_.let { if (it == JsonValue.from("organization.project.service_account")) 1 else 0 } + - role.let { if (it == JsonValue.from("member")) 1 else 0 } + (role.asKnown().getOrNull()?.validity() ?: 0) class ApiKey @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -654,6 +656,144 @@ private constructor( "ApiKey{id=$id, createdAt=$createdAt, name=$name, object_=$object_, value=$value, additionalProperties=$additionalProperties}" } + /** + * Service accounts created with default project membership have role `member`. Accounts created + * with `create_service_account_only` have role `none`. + */ + class Role @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val MEMBER = of("member") + + @JvmField val NONE = of("none") + + @JvmStatic fun of(value: String) = Role(JsonField.of(value)) + } + + /** An enum containing [Role]'s known values. */ + enum class Known { + MEMBER, + NONE, + } + + /** + * An enum containing [Role]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Role] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + MEMBER, + NONE, + /** An enum member indicating that [Role] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + MEMBER -> Value.MEMBER + NONE -> Value.NONE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OpenAIInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + MEMBER -> Known.MEMBER + NONE -> Known.NONE + else -> throw OpenAIInvalidDataException("Unknown Role: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws OpenAIInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OpenAIInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenAIInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Role = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OpenAIInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Role && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + override fun equals(other: Any?): Boolean { if (this === other) { return true diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/apikeys/ApiKeyCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/apikeys/ApiKeyCreateParams.kt new file mode 100644 index 000000000..165f30bdc --- /dev/null +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/apikeys/ApiKeyCreateParams.kt @@ -0,0 +1,536 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openai.models.admin.organization.projects.serviceaccounts.apikeys + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.openai.core.ExcludeMissing +import com.openai.core.JsonField +import com.openai.core.JsonMissing +import com.openai.core.JsonValue +import com.openai.core.Params +import com.openai.core.checkKnown +import com.openai.core.checkRequired +import com.openai.core.http.Headers +import com.openai.core.http.QueryParams +import com.openai.core.toImmutable +import com.openai.errors.OpenAIInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Creates an API key for a service account in the project. */ +class ApiKeyCreateParams +private constructor( + private val projectId: String, + private val serviceAccountId: String?, + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun projectId(): String = projectId + + fun serviceAccountId(): Optional = Optional.ofNullable(serviceAccountId) + + /** + * API key name. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun name(): Optional = body.name() + + /** + * API key scopes. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun scopes(): Optional> = body.scopes() + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _name(): JsonField = body._name() + + /** + * Returns the raw JSON value of [scopes]. + * + * Unlike [scopes], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _scopes(): JsonField> = body._scopes() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [ApiKeyCreateParams]. + * + * The following fields are required: + * ```java + * .projectId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ApiKeyCreateParams]. */ + class Builder internal constructor() { + + private var projectId: String? = null + private var serviceAccountId: String? = null + private var body: Body.Builder = Body.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(apiKeyCreateParams: ApiKeyCreateParams) = apply { + projectId = apiKeyCreateParams.projectId + serviceAccountId = apiKeyCreateParams.serviceAccountId + body = apiKeyCreateParams.body.toBuilder() + additionalHeaders = apiKeyCreateParams.additionalHeaders.toBuilder() + additionalQueryParams = apiKeyCreateParams.additionalQueryParams.toBuilder() + } + + fun projectId(projectId: String) = apply { this.projectId = projectId } + + fun serviceAccountId(serviceAccountId: String?) = apply { + this.serviceAccountId = serviceAccountId + } + + /** Alias for calling [Builder.serviceAccountId] with `serviceAccountId.orElse(null)`. */ + fun serviceAccountId(serviceAccountId: Optional) = + serviceAccountId(serviceAccountId.getOrNull()) + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [name] + * - [scopes] + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** API key name. */ + fun name(name: String) = apply { body.name(name) } + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { body.name(name) } + + /** API key scopes. */ + fun scopes(scopes: List) = apply { body.scopes(scopes) } + + /** + * Sets [Builder.scopes] to an arbitrary JSON value. + * + * You should usually call [Builder.scopes] with a well-typed `List` value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun scopes(scopes: JsonField>) = apply { body.scopes(scopes) } + + /** + * Adds a single [String] to [scopes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addScope(scope: String) = apply { body.addScope(scope) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + body.additionalProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + body.putAdditionalProperty(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + body.putAllAdditionalProperties(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + body.removeAllAdditionalProperties(keys) + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [ApiKeyCreateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .projectId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ApiKeyCreateParams = + ApiKeyCreateParams( + checkRequired("projectId", projectId), + serviceAccountId, + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + fun _pathParam(index: Int): String = + when (index) { + 0 -> projectId + 1 -> serviceAccountId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val name: JsonField, + private val scopes: JsonField>, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("scopes") + @ExcludeMissing + scopes: JsonField> = JsonMissing.of(), + ) : this(name, scopes, mutableMapOf()) + + /** + * API key name. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun name(): Optional = name.getOptional("name") + + /** + * API key scopes. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun scopes(): Optional> = scopes.getOptional("scopes") + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [scopes]. + * + * Unlike [scopes], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("scopes") @ExcludeMissing fun _scopes(): JsonField> = scopes + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Body]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var name: JsonField = JsonMissing.of() + private var scopes: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + name = body.name + scopes = body.scopes.map { it.toMutableList() } + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** API key name. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** API key scopes. */ + fun scopes(scopes: List) = scopes(JsonField.of(scopes)) + + /** + * Sets [Builder.scopes] to an arbitrary JSON value. + * + * You should usually call [Builder.scopes] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun scopes(scopes: JsonField>) = apply { + this.scopes = scopes.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [scopes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addScope(scope: String) = apply { + scopes = + (scopes ?: JsonField.of(mutableListOf())).also { + checkKnown("scopes", it).add(scope) + } + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Body = + Body( + name, + (scopes ?: JsonMissing.of()).map { it.toImmutable() }, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenAIInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Body = apply { + if (validated) { + return@apply + } + + name() + scopes() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OpenAIInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (name.asKnown().isPresent) 1 else 0) + (scopes.asKnown().getOrNull()?.size ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + name == other.name && + scopes == other.scopes && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(name, scopes, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{name=$name, scopes=$scopes, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ApiKeyCreateParams && + projectId == other.projectId && + serviceAccountId == other.serviceAccountId && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(projectId, serviceAccountId, body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "ApiKeyCreateParams{projectId=$projectId, serviceAccountId=$serviceAccountId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/apikeys/ApiKeyCreateResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/apikeys/ApiKeyCreateResponse.kt new file mode 100644 index 000000000..4eb15b97a --- /dev/null +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/apikeys/ApiKeyCreateResponse.kt @@ -0,0 +1,323 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openai.models.admin.organization.projects.serviceaccounts.apikeys + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.openai.core.ExcludeMissing +import com.openai.core.JsonField +import com.openai.core.JsonMissing +import com.openai.core.JsonValue +import com.openai.core.checkRequired +import com.openai.errors.OpenAIInvalidDataException +import java.util.Collections +import java.util.Objects + +class ApiKeyCreateResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val createdAt: JsonField, + private val name: JsonField, + private val object_: JsonValue, + private val value: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("object") @ExcludeMissing object_: JsonValue = JsonMissing.of(), + @JsonProperty("value") @ExcludeMissing value: JsonField = JsonMissing.of(), + ) : this(id, createdAt, name, object_, value, mutableMapOf()) + + /** + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun createdAt(): Long = createdAt.getRequired("created_at") + + /** + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun name(): String = name.getRequired("name") + + /** + * The object type, which is always `organization.project.service_account.api_key` + * + * Expected to always return the following: + * ```java + * JsonValue.from("organization.project.service_account.api_key") + * ``` + * + * However, this method can be useful for debugging and logging (e.g. if the server responded + * with an unexpected value). + */ + @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ + + /** + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun value(): String = value.getRequired("value") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [createdAt]. + * + * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("created_at") @ExcludeMissing fun _createdAt(): JsonField = createdAt + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [value]. + * + * Unlike [value], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("value") @ExcludeMissing fun _value(): JsonField = value + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [ApiKeyCreateResponse]. + * + * The following fields are required: + * ```java + * .id() + * .createdAt() + * .name() + * .value() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ApiKeyCreateResponse]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var createdAt: JsonField? = null + private var name: JsonField? = null + private var object_: JsonValue = + JsonValue.from("organization.project.service_account.api_key") + private var value: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(apiKeyCreateResponse: ApiKeyCreateResponse) = apply { + id = apiKeyCreateResponse.id + createdAt = apiKeyCreateResponse.createdAt + name = apiKeyCreateResponse.name + object_ = apiKeyCreateResponse.object_ + value = apiKeyCreateResponse.value + additionalProperties = apiKeyCreateResponse.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + fun createdAt(createdAt: Long) = createdAt(JsonField.of(createdAt)) + + /** + * Sets [Builder.createdAt] to an arbitrary JSON value. + * + * You should usually call [Builder.createdAt] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } + + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** + * Sets the field to an arbitrary JSON value. + * + * It is usually unnecessary to call this method because the field defaults to the + * following: + * ```java + * JsonValue.from("organization.project.service_account.api_key") + * ``` + * + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun object_(object_: JsonValue) = apply { this.object_ = object_ } + + fun value(value: String) = value(JsonField.of(value)) + + /** + * Sets [Builder.value] to an arbitrary JSON value. + * + * You should usually call [Builder.value] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun value(value: JsonField) = apply { this.value = value } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ApiKeyCreateResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .createdAt() + * .name() + * .value() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ApiKeyCreateResponse = + ApiKeyCreateResponse( + checkRequired("id", id), + checkRequired("createdAt", createdAt), + checkRequired("name", name), + object_, + checkRequired("value", value), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenAIInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): ApiKeyCreateResponse = apply { + if (validated) { + return@apply + } + + id() + createdAt() + name() + _object_().let { + if (it != JsonValue.from("organization.project.service_account.api_key")) { + throw OpenAIInvalidDataException("'object_' is invalid, received $it") + } + } + value() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OpenAIInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + object_.let { + if (it == JsonValue.from("organization.project.service_account.api_key")) 1 else 0 + } + + (if (value.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ApiKeyCreateResponse && + id == other.id && + createdAt == other.createdAt && + name == other.name && + object_ == other.object_ && + value == other.value && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(id, createdAt, name, object_, value, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ApiKeyCreateResponse{id=$id, createdAt=$createdAt, name=$name, object_=$object_, value=$value, additionalProperties=$additionalProperties}" +} diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponse.kt index a4e7997c0..71e9cf355 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponse.kt @@ -1442,9 +1442,18 @@ private constructor( private val apiKeyId: JsonField, private val batch: JsonField, private val inputAudioTokens: JsonField, + private val inputCacheWriteTokens: JsonField, + private val inputCachedAudioTokens: JsonField, + private val inputCachedImageTokens: JsonField, + private val inputCachedTextTokens: JsonField, private val inputCachedTokens: JsonField, + private val inputImageTokens: JsonField, + private val inputTextTokens: JsonField, + private val inputUncachedTokens: JsonField, private val model: JsonField, private val outputAudioTokens: JsonField, + private val outputImageTokens: JsonField, + private val outputTextTokens: JsonField, private val projectId: JsonField, private val serviceTier: JsonField, private val userId: JsonField, @@ -1472,15 +1481,42 @@ private constructor( @JsonProperty("input_audio_tokens") @ExcludeMissing inputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + inputCacheWriteTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + inputCachedAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + inputCachedImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + inputCachedTextTokens: JsonField = JsonMissing.of(), @JsonProperty("input_cached_tokens") @ExcludeMissing inputCachedTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_image_tokens") + @ExcludeMissing + inputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_text_tokens") + @ExcludeMissing + inputTextTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + inputUncachedTokens: JsonField = JsonMissing.of(), @JsonProperty("model") @ExcludeMissing model: JsonField = JsonMissing.of(), @JsonProperty("output_audio_tokens") @ExcludeMissing outputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_image_tokens") + @ExcludeMissing + outputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_text_tokens") + @ExcludeMissing + outputTextTokens: JsonField = JsonMissing.of(), @JsonProperty("project_id") @ExcludeMissing projectId: JsonField = JsonMissing.of(), @@ -1498,9 +1534,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -1508,8 +1553,9 @@ private constructor( ) /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed to + * Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1538,8 +1584,8 @@ private constructor( @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1566,7 +1612,7 @@ private constructor( fun batch(): Optional = batch.getOptional("batch") /** - * The aggregated number of audio input tokens used, including cached tokens. + * The aggregated number of uncached audio input tokens used. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1575,8 +1621,44 @@ private constructor( inputAudioTokens.getOptional("input_audio_tokens") /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens written to the cache. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCacheWriteTokens(): Optional = + inputCacheWriteTokens.getOptional("input_cache_write_tokens") + + /** + * The aggregated number of cached audio input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedAudioTokens(): Optional = + inputCachedAudioTokens.getOptional("input_cached_audio_tokens") + + /** + * The aggregated number of cached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedImageTokens(): Optional = + inputCachedImageTokens.getOptional("input_cached_image_tokens") + + /** + * The aggregated number of cached text input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedTextTokens(): Optional = + inputCachedTextTokens.getOptional("input_cached_text_tokens") + + /** + * The aggregated number of cached input tokens used across text, audio, and image + * inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1584,6 +1666,35 @@ private constructor( fun inputCachedTokens(): Optional = inputCachedTokens.getOptional("input_cached_tokens") + /** + * The aggregated number of uncached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputImageTokens(): Optional = + inputImageTokens.getOptional("input_image_tokens") + + /** + * The aggregated number of uncached text input tokens used, excluding cache-write + * tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputTextTokens(): Optional = + inputTextTokens.getOptional("input_text_tokens") + + /** + * The aggregated number of uncached input tokens used across text, audio, and image + * inputs, excluding cache-write tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputUncachedTokens(): Optional = + inputUncachedTokens.getOptional("input_uncached_tokens") + /** * When `group_by=model`, this field provides the model name of the grouped usage * result. @@ -1602,6 +1713,24 @@ private constructor( fun outputAudioTokens(): Optional = outputAudioTokens.getOptional("output_audio_tokens") + /** + * The aggregated number of image output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputImageTokens(): Optional = + outputImageTokens.getOptional("output_image_tokens") + + /** + * The aggregated number of text output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputTextTokens(): Optional = + outputTextTokens.getOptional("output_text_tokens") + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -1687,6 +1816,46 @@ private constructor( @ExcludeMissing fun _inputAudioTokens(): JsonField = inputAudioTokens + /** + * Returns the raw JSON value of [inputCacheWriteTokens]. + * + * Unlike [inputCacheWriteTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + fun _inputCacheWriteTokens(): JsonField = inputCacheWriteTokens + + /** + * Returns the raw JSON value of [inputCachedAudioTokens]. + * + * Unlike [inputCachedAudioTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + fun _inputCachedAudioTokens(): JsonField = inputCachedAudioTokens + + /** + * Returns the raw JSON value of [inputCachedImageTokens]. + * + * Unlike [inputCachedImageTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + fun _inputCachedImageTokens(): JsonField = inputCachedImageTokens + + /** + * Returns the raw JSON value of [inputCachedTextTokens]. + * + * Unlike [inputCachedTextTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + fun _inputCachedTextTokens(): JsonField = inputCachedTextTokens + /** * Returns the raw JSON value of [inputCachedTokens]. * @@ -1697,6 +1866,36 @@ private constructor( @ExcludeMissing fun _inputCachedTokens(): JsonField = inputCachedTokens + /** + * Returns the raw JSON value of [inputImageTokens]. + * + * Unlike [inputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_image_tokens") + @ExcludeMissing + fun _inputImageTokens(): JsonField = inputImageTokens + + /** + * Returns the raw JSON value of [inputTextTokens]. + * + * Unlike [inputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_text_tokens") + @ExcludeMissing + fun _inputTextTokens(): JsonField = inputTextTokens + + /** + * Returns the raw JSON value of [inputUncachedTokens]. + * + * Unlike [inputUncachedTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + fun _inputUncachedTokens(): JsonField = inputUncachedTokens + /** * Returns the raw JSON value of [model]. * @@ -1715,6 +1914,26 @@ private constructor( @ExcludeMissing fun _outputAudioTokens(): JsonField = outputAudioTokens + /** + * Returns the raw JSON value of [outputImageTokens]. + * + * Unlike [outputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_image_tokens") + @ExcludeMissing + fun _outputImageTokens(): JsonField = outputImageTokens + + /** + * Returns the raw JSON value of [outputTextTokens]. + * + * Unlike [outputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_text_tokens") + @ExcludeMissing + fun _outputTextTokens(): JsonField = outputTextTokens + /** * Returns the raw JSON value of [projectId]. * @@ -1782,9 +2001,18 @@ private constructor( private var apiKeyId: JsonField = JsonMissing.of() private var batch: JsonField = JsonMissing.of() private var inputAudioTokens: JsonField = JsonMissing.of() + private var inputCacheWriteTokens: JsonField = JsonMissing.of() + private var inputCachedAudioTokens: JsonField = JsonMissing.of() + private var inputCachedImageTokens: JsonField = JsonMissing.of() + private var inputCachedTextTokens: JsonField = JsonMissing.of() private var inputCachedTokens: JsonField = JsonMissing.of() + private var inputImageTokens: JsonField = JsonMissing.of() + private var inputTextTokens: JsonField = JsonMissing.of() + private var inputUncachedTokens: JsonField = JsonMissing.of() private var model: JsonField = JsonMissing.of() private var outputAudioTokens: JsonField = JsonMissing.of() + private var outputImageTokens: JsonField = JsonMissing.of() + private var outputTextTokens: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var serviceTier: JsonField = JsonMissing.of() private var userId: JsonField = JsonMissing.of() @@ -1801,9 +2029,22 @@ private constructor( apiKeyId = organizationUsageCompletionsResult.apiKeyId batch = organizationUsageCompletionsResult.batch inputAudioTokens = organizationUsageCompletionsResult.inputAudioTokens + inputCacheWriteTokens = + organizationUsageCompletionsResult.inputCacheWriteTokens + inputCachedAudioTokens = + organizationUsageCompletionsResult.inputCachedAudioTokens + inputCachedImageTokens = + organizationUsageCompletionsResult.inputCachedImageTokens + inputCachedTextTokens = + organizationUsageCompletionsResult.inputCachedTextTokens inputCachedTokens = organizationUsageCompletionsResult.inputCachedTokens + inputImageTokens = organizationUsageCompletionsResult.inputImageTokens + inputTextTokens = organizationUsageCompletionsResult.inputTextTokens + inputUncachedTokens = organizationUsageCompletionsResult.inputUncachedTokens model = organizationUsageCompletionsResult.model outputAudioTokens = organizationUsageCompletionsResult.outputAudioTokens + outputImageTokens = organizationUsageCompletionsResult.outputImageTokens + outputTextTokens = organizationUsageCompletionsResult.outputTextTokens projectId = organizationUsageCompletionsResult.projectId serviceTier = organizationUsageCompletionsResult.serviceTier userId = organizationUsageCompletionsResult.userId @@ -1812,8 +2053,9 @@ private constructor( } /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed + * to Scale Tier, this includes Scale Tier tokens. */ fun inputTokens(inputTokens: Long) = inputTokens(JsonField.of(inputTokens)) @@ -1858,8 +2100,9 @@ private constructor( fun object_(object_: JsonValue) = apply { this.object_ = object_ } /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier + * tokens. */ fun outputTokens(outputTokens: Long) = outputTokens(JsonField.of(outputTokens)) @@ -1917,9 +2160,7 @@ private constructor( */ fun batch(batch: JsonField) = apply { this.batch = batch } - /** - * The aggregated number of audio input tokens used, including cached tokens. - */ + /** The aggregated number of uncached audio input tokens used. */ fun inputAudioTokens(inputAudioTokens: Long) = inputAudioTokens(JsonField.of(inputAudioTokens)) @@ -1934,10 +2175,70 @@ private constructor( this.inputAudioTokens = inputAudioTokens } + /** The aggregated number of input tokens written to the cache. */ + fun inputCacheWriteTokens(inputCacheWriteTokens: Long) = + inputCacheWriteTokens(JsonField.of(inputCacheWriteTokens)) + /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier - * tokens. + * Sets [Builder.inputCacheWriteTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCacheWriteTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCacheWriteTokens(inputCacheWriteTokens: JsonField) = apply { + this.inputCacheWriteTokens = inputCacheWriteTokens + } + + /** The aggregated number of cached audio input tokens used. */ + fun inputCachedAudioTokens(inputCachedAudioTokens: Long) = + inputCachedAudioTokens(JsonField.of(inputCachedAudioTokens)) + + /** + * Sets [Builder.inputCachedAudioTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedAudioTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedAudioTokens(inputCachedAudioTokens: JsonField) = apply { + this.inputCachedAudioTokens = inputCachedAudioTokens + } + + /** The aggregated number of cached image input tokens used. */ + fun inputCachedImageTokens(inputCachedImageTokens: Long) = + inputCachedImageTokens(JsonField.of(inputCachedImageTokens)) + + /** + * Sets [Builder.inputCachedImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedImageTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedImageTokens(inputCachedImageTokens: JsonField) = apply { + this.inputCachedImageTokens = inputCachedImageTokens + } + + /** The aggregated number of cached text input tokens used. */ + fun inputCachedTextTokens(inputCachedTextTokens: Long) = + inputCachedTextTokens(JsonField.of(inputCachedTextTokens)) + + /** + * Sets [Builder.inputCachedTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedTextTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedTextTokens(inputCachedTextTokens: JsonField) = apply { + this.inputCachedTextTokens = inputCachedTextTokens + } + + /** + * The aggregated number of cached input tokens used across text, audio, and + * image inputs. For customers subscribed to Scale Tier, this includes Scale + * Tier tokens. */ fun inputCachedTokens(inputCachedTokens: Long) = inputCachedTokens(JsonField.of(inputCachedTokens)) @@ -1953,6 +2254,57 @@ private constructor( this.inputCachedTokens = inputCachedTokens } + /** The aggregated number of uncached image input tokens used. */ + fun inputImageTokens(inputImageTokens: Long) = + inputImageTokens(JsonField.of(inputImageTokens)) + + /** + * Sets [Builder.inputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputImageTokens(inputImageTokens: JsonField) = apply { + this.inputImageTokens = inputImageTokens + } + + /** + * The aggregated number of uncached text input tokens used, excluding + * cache-write tokens. + */ + fun inputTextTokens(inputTextTokens: Long) = + inputTextTokens(JsonField.of(inputTextTokens)) + + /** + * Sets [Builder.inputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputTextTokens(inputTextTokens: JsonField) = apply { + this.inputTextTokens = inputTextTokens + } + + /** + * The aggregated number of uncached input tokens used across text, audio, and + * image inputs, excluding cache-write tokens. + */ + fun inputUncachedTokens(inputUncachedTokens: Long) = + inputUncachedTokens(JsonField.of(inputUncachedTokens)) + + /** + * Sets [Builder.inputUncachedTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputUncachedTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputUncachedTokens(inputUncachedTokens: JsonField) = apply { + this.inputUncachedTokens = inputUncachedTokens + } + /** * When `group_by=model`, this field provides the model name of the grouped * usage result. @@ -1986,6 +2338,36 @@ private constructor( this.outputAudioTokens = outputAudioTokens } + /** The aggregated number of image output tokens used. */ + fun outputImageTokens(outputImageTokens: Long) = + outputImageTokens(JsonField.of(outputImageTokens)) + + /** + * Sets [Builder.outputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputImageTokens(outputImageTokens: JsonField) = apply { + this.outputImageTokens = outputImageTokens + } + + /** The aggregated number of text output tokens used. */ + fun outputTextTokens(outputTextTokens: Long) = + outputTextTokens(JsonField.of(outputTextTokens)) + + /** + * Sets [Builder.outputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputTextTokens(outputTextTokens: JsonField) = apply { + this.outputTextTokens = outputTextTokens + } + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -2091,9 +2473,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2129,9 +2520,18 @@ private constructor( apiKeyId() batch() inputAudioTokens() + inputCacheWriteTokens() + inputCachedAudioTokens() + inputCachedImageTokens() + inputCachedTextTokens() inputCachedTokens() + inputImageTokens() + inputTextTokens() + inputUncachedTokens() model() outputAudioTokens() + outputImageTokens() + outputTextTokens() projectId() serviceTier() userId() @@ -2164,9 +2564,18 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (batch.asKnown().isPresent) 1 else 0) + (if (inputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCacheWriteTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedTextTokens.asKnown().isPresent) 1 else 0) + (if (inputCachedTokens.asKnown().isPresent) 1 else 0) + + (if (inputImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputTextTokens.asKnown().isPresent) 1 else 0) + + (if (inputUncachedTokens.asKnown().isPresent) 1 else 0) + (if (model.asKnown().isPresent) 1 else 0) + (if (outputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (outputImageTokens.asKnown().isPresent) 1 else 0) + + (if (outputTextTokens.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + (if (serviceTier.asKnown().isPresent) 1 else 0) + (if (userId.asKnown().isPresent) 1 else 0) @@ -2184,9 +2593,18 @@ private constructor( apiKeyId == other.apiKeyId && batch == other.batch && inputAudioTokens == other.inputAudioTokens && + inputCacheWriteTokens == other.inputCacheWriteTokens && + inputCachedAudioTokens == other.inputCachedAudioTokens && + inputCachedImageTokens == other.inputCachedImageTokens && + inputCachedTextTokens == other.inputCachedTextTokens && inputCachedTokens == other.inputCachedTokens && + inputImageTokens == other.inputImageTokens && + inputTextTokens == other.inputTextTokens && + inputUncachedTokens == other.inputUncachedTokens && model == other.model && outputAudioTokens == other.outputAudioTokens && + outputImageTokens == other.outputImageTokens && + outputTextTokens == other.outputTextTokens && projectId == other.projectId && serviceTier == other.serviceTier && userId == other.userId && @@ -2202,9 +2620,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2215,7 +2642,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCachedTokens=$inputCachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" + "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCacheWriteTokens=$inputCacheWriteTokens, inputCachedAudioTokens=$inputCachedAudioTokens, inputCachedImageTokens=$inputCachedImageTokens, inputCachedTextTokens=$inputCachedTextTokens, inputCachedTokens=$inputCachedTokens, inputImageTokens=$inputImageTokens, inputTextTokens=$inputTextTokens, inputUncachedTokens=$inputUncachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, outputImageTokens=$outputImageTokens, outputTextTokens=$outputTextTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" } /** The aggregated embeddings usage details of the specific time bucket. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponse.kt index 77bce8b5c..a19a57103 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponse.kt @@ -1445,9 +1445,18 @@ private constructor( private val apiKeyId: JsonField, private val batch: JsonField, private val inputAudioTokens: JsonField, + private val inputCacheWriteTokens: JsonField, + private val inputCachedAudioTokens: JsonField, + private val inputCachedImageTokens: JsonField, + private val inputCachedTextTokens: JsonField, private val inputCachedTokens: JsonField, + private val inputImageTokens: JsonField, + private val inputTextTokens: JsonField, + private val inputUncachedTokens: JsonField, private val model: JsonField, private val outputAudioTokens: JsonField, + private val outputImageTokens: JsonField, + private val outputTextTokens: JsonField, private val projectId: JsonField, private val serviceTier: JsonField, private val userId: JsonField, @@ -1475,15 +1484,42 @@ private constructor( @JsonProperty("input_audio_tokens") @ExcludeMissing inputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + inputCacheWriteTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + inputCachedAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + inputCachedImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + inputCachedTextTokens: JsonField = JsonMissing.of(), @JsonProperty("input_cached_tokens") @ExcludeMissing inputCachedTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_image_tokens") + @ExcludeMissing + inputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_text_tokens") + @ExcludeMissing + inputTextTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + inputUncachedTokens: JsonField = JsonMissing.of(), @JsonProperty("model") @ExcludeMissing model: JsonField = JsonMissing.of(), @JsonProperty("output_audio_tokens") @ExcludeMissing outputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_image_tokens") + @ExcludeMissing + outputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_text_tokens") + @ExcludeMissing + outputTextTokens: JsonField = JsonMissing.of(), @JsonProperty("project_id") @ExcludeMissing projectId: JsonField = JsonMissing.of(), @@ -1501,9 +1537,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -1511,8 +1556,9 @@ private constructor( ) /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed to + * Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1541,8 +1587,8 @@ private constructor( @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1569,7 +1615,7 @@ private constructor( fun batch(): Optional = batch.getOptional("batch") /** - * The aggregated number of audio input tokens used, including cached tokens. + * The aggregated number of uncached audio input tokens used. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1578,8 +1624,44 @@ private constructor( inputAudioTokens.getOptional("input_audio_tokens") /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens written to the cache. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCacheWriteTokens(): Optional = + inputCacheWriteTokens.getOptional("input_cache_write_tokens") + + /** + * The aggregated number of cached audio input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedAudioTokens(): Optional = + inputCachedAudioTokens.getOptional("input_cached_audio_tokens") + + /** + * The aggregated number of cached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedImageTokens(): Optional = + inputCachedImageTokens.getOptional("input_cached_image_tokens") + + /** + * The aggregated number of cached text input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedTextTokens(): Optional = + inputCachedTextTokens.getOptional("input_cached_text_tokens") + + /** + * The aggregated number of cached input tokens used across text, audio, and image + * inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1587,6 +1669,35 @@ private constructor( fun inputCachedTokens(): Optional = inputCachedTokens.getOptional("input_cached_tokens") + /** + * The aggregated number of uncached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputImageTokens(): Optional = + inputImageTokens.getOptional("input_image_tokens") + + /** + * The aggregated number of uncached text input tokens used, excluding cache-write + * tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputTextTokens(): Optional = + inputTextTokens.getOptional("input_text_tokens") + + /** + * The aggregated number of uncached input tokens used across text, audio, and image + * inputs, excluding cache-write tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputUncachedTokens(): Optional = + inputUncachedTokens.getOptional("input_uncached_tokens") + /** * When `group_by=model`, this field provides the model name of the grouped usage * result. @@ -1605,6 +1716,24 @@ private constructor( fun outputAudioTokens(): Optional = outputAudioTokens.getOptional("output_audio_tokens") + /** + * The aggregated number of image output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputImageTokens(): Optional = + outputImageTokens.getOptional("output_image_tokens") + + /** + * The aggregated number of text output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputTextTokens(): Optional = + outputTextTokens.getOptional("output_text_tokens") + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -1690,6 +1819,46 @@ private constructor( @ExcludeMissing fun _inputAudioTokens(): JsonField = inputAudioTokens + /** + * Returns the raw JSON value of [inputCacheWriteTokens]. + * + * Unlike [inputCacheWriteTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + fun _inputCacheWriteTokens(): JsonField = inputCacheWriteTokens + + /** + * Returns the raw JSON value of [inputCachedAudioTokens]. + * + * Unlike [inputCachedAudioTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + fun _inputCachedAudioTokens(): JsonField = inputCachedAudioTokens + + /** + * Returns the raw JSON value of [inputCachedImageTokens]. + * + * Unlike [inputCachedImageTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + fun _inputCachedImageTokens(): JsonField = inputCachedImageTokens + + /** + * Returns the raw JSON value of [inputCachedTextTokens]. + * + * Unlike [inputCachedTextTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + fun _inputCachedTextTokens(): JsonField = inputCachedTextTokens + /** * Returns the raw JSON value of [inputCachedTokens]. * @@ -1700,6 +1869,36 @@ private constructor( @ExcludeMissing fun _inputCachedTokens(): JsonField = inputCachedTokens + /** + * Returns the raw JSON value of [inputImageTokens]. + * + * Unlike [inputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_image_tokens") + @ExcludeMissing + fun _inputImageTokens(): JsonField = inputImageTokens + + /** + * Returns the raw JSON value of [inputTextTokens]. + * + * Unlike [inputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_text_tokens") + @ExcludeMissing + fun _inputTextTokens(): JsonField = inputTextTokens + + /** + * Returns the raw JSON value of [inputUncachedTokens]. + * + * Unlike [inputUncachedTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + fun _inputUncachedTokens(): JsonField = inputUncachedTokens + /** * Returns the raw JSON value of [model]. * @@ -1718,6 +1917,26 @@ private constructor( @ExcludeMissing fun _outputAudioTokens(): JsonField = outputAudioTokens + /** + * Returns the raw JSON value of [outputImageTokens]. + * + * Unlike [outputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_image_tokens") + @ExcludeMissing + fun _outputImageTokens(): JsonField = outputImageTokens + + /** + * Returns the raw JSON value of [outputTextTokens]. + * + * Unlike [outputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_text_tokens") + @ExcludeMissing + fun _outputTextTokens(): JsonField = outputTextTokens + /** * Returns the raw JSON value of [projectId]. * @@ -1785,9 +2004,18 @@ private constructor( private var apiKeyId: JsonField = JsonMissing.of() private var batch: JsonField = JsonMissing.of() private var inputAudioTokens: JsonField = JsonMissing.of() + private var inputCacheWriteTokens: JsonField = JsonMissing.of() + private var inputCachedAudioTokens: JsonField = JsonMissing.of() + private var inputCachedImageTokens: JsonField = JsonMissing.of() + private var inputCachedTextTokens: JsonField = JsonMissing.of() private var inputCachedTokens: JsonField = JsonMissing.of() + private var inputImageTokens: JsonField = JsonMissing.of() + private var inputTextTokens: JsonField = JsonMissing.of() + private var inputUncachedTokens: JsonField = JsonMissing.of() private var model: JsonField = JsonMissing.of() private var outputAudioTokens: JsonField = JsonMissing.of() + private var outputImageTokens: JsonField = JsonMissing.of() + private var outputTextTokens: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var serviceTier: JsonField = JsonMissing.of() private var userId: JsonField = JsonMissing.of() @@ -1804,9 +2032,22 @@ private constructor( apiKeyId = organizationUsageCompletionsResult.apiKeyId batch = organizationUsageCompletionsResult.batch inputAudioTokens = organizationUsageCompletionsResult.inputAudioTokens + inputCacheWriteTokens = + organizationUsageCompletionsResult.inputCacheWriteTokens + inputCachedAudioTokens = + organizationUsageCompletionsResult.inputCachedAudioTokens + inputCachedImageTokens = + organizationUsageCompletionsResult.inputCachedImageTokens + inputCachedTextTokens = + organizationUsageCompletionsResult.inputCachedTextTokens inputCachedTokens = organizationUsageCompletionsResult.inputCachedTokens + inputImageTokens = organizationUsageCompletionsResult.inputImageTokens + inputTextTokens = organizationUsageCompletionsResult.inputTextTokens + inputUncachedTokens = organizationUsageCompletionsResult.inputUncachedTokens model = organizationUsageCompletionsResult.model outputAudioTokens = organizationUsageCompletionsResult.outputAudioTokens + outputImageTokens = organizationUsageCompletionsResult.outputImageTokens + outputTextTokens = organizationUsageCompletionsResult.outputTextTokens projectId = organizationUsageCompletionsResult.projectId serviceTier = organizationUsageCompletionsResult.serviceTier userId = organizationUsageCompletionsResult.userId @@ -1815,8 +2056,9 @@ private constructor( } /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed + * to Scale Tier, this includes Scale Tier tokens. */ fun inputTokens(inputTokens: Long) = inputTokens(JsonField.of(inputTokens)) @@ -1861,8 +2103,9 @@ private constructor( fun object_(object_: JsonValue) = apply { this.object_ = object_ } /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier + * tokens. */ fun outputTokens(outputTokens: Long) = outputTokens(JsonField.of(outputTokens)) @@ -1920,9 +2163,7 @@ private constructor( */ fun batch(batch: JsonField) = apply { this.batch = batch } - /** - * The aggregated number of audio input tokens used, including cached tokens. - */ + /** The aggregated number of uncached audio input tokens used. */ fun inputAudioTokens(inputAudioTokens: Long) = inputAudioTokens(JsonField.of(inputAudioTokens)) @@ -1937,10 +2178,70 @@ private constructor( this.inputAudioTokens = inputAudioTokens } + /** The aggregated number of input tokens written to the cache. */ + fun inputCacheWriteTokens(inputCacheWriteTokens: Long) = + inputCacheWriteTokens(JsonField.of(inputCacheWriteTokens)) + /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier - * tokens. + * Sets [Builder.inputCacheWriteTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCacheWriteTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCacheWriteTokens(inputCacheWriteTokens: JsonField) = apply { + this.inputCacheWriteTokens = inputCacheWriteTokens + } + + /** The aggregated number of cached audio input tokens used. */ + fun inputCachedAudioTokens(inputCachedAudioTokens: Long) = + inputCachedAudioTokens(JsonField.of(inputCachedAudioTokens)) + + /** + * Sets [Builder.inputCachedAudioTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedAudioTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedAudioTokens(inputCachedAudioTokens: JsonField) = apply { + this.inputCachedAudioTokens = inputCachedAudioTokens + } + + /** The aggregated number of cached image input tokens used. */ + fun inputCachedImageTokens(inputCachedImageTokens: Long) = + inputCachedImageTokens(JsonField.of(inputCachedImageTokens)) + + /** + * Sets [Builder.inputCachedImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedImageTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedImageTokens(inputCachedImageTokens: JsonField) = apply { + this.inputCachedImageTokens = inputCachedImageTokens + } + + /** The aggregated number of cached text input tokens used. */ + fun inputCachedTextTokens(inputCachedTextTokens: Long) = + inputCachedTextTokens(JsonField.of(inputCachedTextTokens)) + + /** + * Sets [Builder.inputCachedTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedTextTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedTextTokens(inputCachedTextTokens: JsonField) = apply { + this.inputCachedTextTokens = inputCachedTextTokens + } + + /** + * The aggregated number of cached input tokens used across text, audio, and + * image inputs. For customers subscribed to Scale Tier, this includes Scale + * Tier tokens. */ fun inputCachedTokens(inputCachedTokens: Long) = inputCachedTokens(JsonField.of(inputCachedTokens)) @@ -1956,6 +2257,57 @@ private constructor( this.inputCachedTokens = inputCachedTokens } + /** The aggregated number of uncached image input tokens used. */ + fun inputImageTokens(inputImageTokens: Long) = + inputImageTokens(JsonField.of(inputImageTokens)) + + /** + * Sets [Builder.inputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputImageTokens(inputImageTokens: JsonField) = apply { + this.inputImageTokens = inputImageTokens + } + + /** + * The aggregated number of uncached text input tokens used, excluding + * cache-write tokens. + */ + fun inputTextTokens(inputTextTokens: Long) = + inputTextTokens(JsonField.of(inputTextTokens)) + + /** + * Sets [Builder.inputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputTextTokens(inputTextTokens: JsonField) = apply { + this.inputTextTokens = inputTextTokens + } + + /** + * The aggregated number of uncached input tokens used across text, audio, and + * image inputs, excluding cache-write tokens. + */ + fun inputUncachedTokens(inputUncachedTokens: Long) = + inputUncachedTokens(JsonField.of(inputUncachedTokens)) + + /** + * Sets [Builder.inputUncachedTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputUncachedTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputUncachedTokens(inputUncachedTokens: JsonField) = apply { + this.inputUncachedTokens = inputUncachedTokens + } + /** * When `group_by=model`, this field provides the model name of the grouped * usage result. @@ -1989,6 +2341,36 @@ private constructor( this.outputAudioTokens = outputAudioTokens } + /** The aggregated number of image output tokens used. */ + fun outputImageTokens(outputImageTokens: Long) = + outputImageTokens(JsonField.of(outputImageTokens)) + + /** + * Sets [Builder.outputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputImageTokens(outputImageTokens: JsonField) = apply { + this.outputImageTokens = outputImageTokens + } + + /** The aggregated number of text output tokens used. */ + fun outputTextTokens(outputTextTokens: Long) = + outputTextTokens(JsonField.of(outputTextTokens)) + + /** + * Sets [Builder.outputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputTextTokens(outputTextTokens: JsonField) = apply { + this.outputTextTokens = outputTextTokens + } + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -2094,9 +2476,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2132,9 +2523,18 @@ private constructor( apiKeyId() batch() inputAudioTokens() + inputCacheWriteTokens() + inputCachedAudioTokens() + inputCachedImageTokens() + inputCachedTextTokens() inputCachedTokens() + inputImageTokens() + inputTextTokens() + inputUncachedTokens() model() outputAudioTokens() + outputImageTokens() + outputTextTokens() projectId() serviceTier() userId() @@ -2167,9 +2567,18 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (batch.asKnown().isPresent) 1 else 0) + (if (inputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCacheWriteTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedTextTokens.asKnown().isPresent) 1 else 0) + (if (inputCachedTokens.asKnown().isPresent) 1 else 0) + + (if (inputImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputTextTokens.asKnown().isPresent) 1 else 0) + + (if (inputUncachedTokens.asKnown().isPresent) 1 else 0) + (if (model.asKnown().isPresent) 1 else 0) + (if (outputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (outputImageTokens.asKnown().isPresent) 1 else 0) + + (if (outputTextTokens.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + (if (serviceTier.asKnown().isPresent) 1 else 0) + (if (userId.asKnown().isPresent) 1 else 0) @@ -2187,9 +2596,18 @@ private constructor( apiKeyId == other.apiKeyId && batch == other.batch && inputAudioTokens == other.inputAudioTokens && + inputCacheWriteTokens == other.inputCacheWriteTokens && + inputCachedAudioTokens == other.inputCachedAudioTokens && + inputCachedImageTokens == other.inputCachedImageTokens && + inputCachedTextTokens == other.inputCachedTextTokens && inputCachedTokens == other.inputCachedTokens && + inputImageTokens == other.inputImageTokens && + inputTextTokens == other.inputTextTokens && + inputUncachedTokens == other.inputUncachedTokens && model == other.model && outputAudioTokens == other.outputAudioTokens && + outputImageTokens == other.outputImageTokens && + outputTextTokens == other.outputTextTokens && projectId == other.projectId && serviceTier == other.serviceTier && userId == other.userId && @@ -2205,9 +2623,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2218,7 +2645,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCachedTokens=$inputCachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" + "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCacheWriteTokens=$inputCacheWriteTokens, inputCachedAudioTokens=$inputCachedAudioTokens, inputCachedImageTokens=$inputCachedImageTokens, inputCachedTextTokens=$inputCachedTextTokens, inputCachedTokens=$inputCachedTokens, inputImageTokens=$inputImageTokens, inputTextTokens=$inputTextTokens, inputUncachedTokens=$inputUncachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, outputImageTokens=$outputImageTokens, outputTextTokens=$outputTextTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" } /** The aggregated embeddings usage details of the specific time bucket. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponse.kt index b3eea02e2..52c0f8f71 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponse.kt @@ -1446,9 +1446,18 @@ private constructor( private val apiKeyId: JsonField, private val batch: JsonField, private val inputAudioTokens: JsonField, + private val inputCacheWriteTokens: JsonField, + private val inputCachedAudioTokens: JsonField, + private val inputCachedImageTokens: JsonField, + private val inputCachedTextTokens: JsonField, private val inputCachedTokens: JsonField, + private val inputImageTokens: JsonField, + private val inputTextTokens: JsonField, + private val inputUncachedTokens: JsonField, private val model: JsonField, private val outputAudioTokens: JsonField, + private val outputImageTokens: JsonField, + private val outputTextTokens: JsonField, private val projectId: JsonField, private val serviceTier: JsonField, private val userId: JsonField, @@ -1476,15 +1485,42 @@ private constructor( @JsonProperty("input_audio_tokens") @ExcludeMissing inputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + inputCacheWriteTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + inputCachedAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + inputCachedImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + inputCachedTextTokens: JsonField = JsonMissing.of(), @JsonProperty("input_cached_tokens") @ExcludeMissing inputCachedTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_image_tokens") + @ExcludeMissing + inputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_text_tokens") + @ExcludeMissing + inputTextTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + inputUncachedTokens: JsonField = JsonMissing.of(), @JsonProperty("model") @ExcludeMissing model: JsonField = JsonMissing.of(), @JsonProperty("output_audio_tokens") @ExcludeMissing outputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_image_tokens") + @ExcludeMissing + outputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_text_tokens") + @ExcludeMissing + outputTextTokens: JsonField = JsonMissing.of(), @JsonProperty("project_id") @ExcludeMissing projectId: JsonField = JsonMissing.of(), @@ -1502,9 +1538,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -1512,8 +1557,9 @@ private constructor( ) /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed to + * Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1542,8 +1588,8 @@ private constructor( @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1570,7 +1616,7 @@ private constructor( fun batch(): Optional = batch.getOptional("batch") /** - * The aggregated number of audio input tokens used, including cached tokens. + * The aggregated number of uncached audio input tokens used. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1579,8 +1625,44 @@ private constructor( inputAudioTokens.getOptional("input_audio_tokens") /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens written to the cache. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCacheWriteTokens(): Optional = + inputCacheWriteTokens.getOptional("input_cache_write_tokens") + + /** + * The aggregated number of cached audio input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedAudioTokens(): Optional = + inputCachedAudioTokens.getOptional("input_cached_audio_tokens") + + /** + * The aggregated number of cached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedImageTokens(): Optional = + inputCachedImageTokens.getOptional("input_cached_image_tokens") + + /** + * The aggregated number of cached text input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedTextTokens(): Optional = + inputCachedTextTokens.getOptional("input_cached_text_tokens") + + /** + * The aggregated number of cached input tokens used across text, audio, and image + * inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1588,6 +1670,35 @@ private constructor( fun inputCachedTokens(): Optional = inputCachedTokens.getOptional("input_cached_tokens") + /** + * The aggregated number of uncached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputImageTokens(): Optional = + inputImageTokens.getOptional("input_image_tokens") + + /** + * The aggregated number of uncached text input tokens used, excluding cache-write + * tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputTextTokens(): Optional = + inputTextTokens.getOptional("input_text_tokens") + + /** + * The aggregated number of uncached input tokens used across text, audio, and image + * inputs, excluding cache-write tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputUncachedTokens(): Optional = + inputUncachedTokens.getOptional("input_uncached_tokens") + /** * When `group_by=model`, this field provides the model name of the grouped usage * result. @@ -1606,6 +1717,24 @@ private constructor( fun outputAudioTokens(): Optional = outputAudioTokens.getOptional("output_audio_tokens") + /** + * The aggregated number of image output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputImageTokens(): Optional = + outputImageTokens.getOptional("output_image_tokens") + + /** + * The aggregated number of text output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputTextTokens(): Optional = + outputTextTokens.getOptional("output_text_tokens") + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -1691,6 +1820,46 @@ private constructor( @ExcludeMissing fun _inputAudioTokens(): JsonField = inputAudioTokens + /** + * Returns the raw JSON value of [inputCacheWriteTokens]. + * + * Unlike [inputCacheWriteTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + fun _inputCacheWriteTokens(): JsonField = inputCacheWriteTokens + + /** + * Returns the raw JSON value of [inputCachedAudioTokens]. + * + * Unlike [inputCachedAudioTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + fun _inputCachedAudioTokens(): JsonField = inputCachedAudioTokens + + /** + * Returns the raw JSON value of [inputCachedImageTokens]. + * + * Unlike [inputCachedImageTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + fun _inputCachedImageTokens(): JsonField = inputCachedImageTokens + + /** + * Returns the raw JSON value of [inputCachedTextTokens]. + * + * Unlike [inputCachedTextTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + fun _inputCachedTextTokens(): JsonField = inputCachedTextTokens + /** * Returns the raw JSON value of [inputCachedTokens]. * @@ -1701,6 +1870,36 @@ private constructor( @ExcludeMissing fun _inputCachedTokens(): JsonField = inputCachedTokens + /** + * Returns the raw JSON value of [inputImageTokens]. + * + * Unlike [inputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_image_tokens") + @ExcludeMissing + fun _inputImageTokens(): JsonField = inputImageTokens + + /** + * Returns the raw JSON value of [inputTextTokens]. + * + * Unlike [inputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_text_tokens") + @ExcludeMissing + fun _inputTextTokens(): JsonField = inputTextTokens + + /** + * Returns the raw JSON value of [inputUncachedTokens]. + * + * Unlike [inputUncachedTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + fun _inputUncachedTokens(): JsonField = inputUncachedTokens + /** * Returns the raw JSON value of [model]. * @@ -1719,6 +1918,26 @@ private constructor( @ExcludeMissing fun _outputAudioTokens(): JsonField = outputAudioTokens + /** + * Returns the raw JSON value of [outputImageTokens]. + * + * Unlike [outputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_image_tokens") + @ExcludeMissing + fun _outputImageTokens(): JsonField = outputImageTokens + + /** + * Returns the raw JSON value of [outputTextTokens]. + * + * Unlike [outputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_text_tokens") + @ExcludeMissing + fun _outputTextTokens(): JsonField = outputTextTokens + /** * Returns the raw JSON value of [projectId]. * @@ -1786,9 +2005,18 @@ private constructor( private var apiKeyId: JsonField = JsonMissing.of() private var batch: JsonField = JsonMissing.of() private var inputAudioTokens: JsonField = JsonMissing.of() + private var inputCacheWriteTokens: JsonField = JsonMissing.of() + private var inputCachedAudioTokens: JsonField = JsonMissing.of() + private var inputCachedImageTokens: JsonField = JsonMissing.of() + private var inputCachedTextTokens: JsonField = JsonMissing.of() private var inputCachedTokens: JsonField = JsonMissing.of() + private var inputImageTokens: JsonField = JsonMissing.of() + private var inputTextTokens: JsonField = JsonMissing.of() + private var inputUncachedTokens: JsonField = JsonMissing.of() private var model: JsonField = JsonMissing.of() private var outputAudioTokens: JsonField = JsonMissing.of() + private var outputImageTokens: JsonField = JsonMissing.of() + private var outputTextTokens: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var serviceTier: JsonField = JsonMissing.of() private var userId: JsonField = JsonMissing.of() @@ -1805,9 +2033,22 @@ private constructor( apiKeyId = organizationUsageCompletionsResult.apiKeyId batch = organizationUsageCompletionsResult.batch inputAudioTokens = organizationUsageCompletionsResult.inputAudioTokens + inputCacheWriteTokens = + organizationUsageCompletionsResult.inputCacheWriteTokens + inputCachedAudioTokens = + organizationUsageCompletionsResult.inputCachedAudioTokens + inputCachedImageTokens = + organizationUsageCompletionsResult.inputCachedImageTokens + inputCachedTextTokens = + organizationUsageCompletionsResult.inputCachedTextTokens inputCachedTokens = organizationUsageCompletionsResult.inputCachedTokens + inputImageTokens = organizationUsageCompletionsResult.inputImageTokens + inputTextTokens = organizationUsageCompletionsResult.inputTextTokens + inputUncachedTokens = organizationUsageCompletionsResult.inputUncachedTokens model = organizationUsageCompletionsResult.model outputAudioTokens = organizationUsageCompletionsResult.outputAudioTokens + outputImageTokens = organizationUsageCompletionsResult.outputImageTokens + outputTextTokens = organizationUsageCompletionsResult.outputTextTokens projectId = organizationUsageCompletionsResult.projectId serviceTier = organizationUsageCompletionsResult.serviceTier userId = organizationUsageCompletionsResult.userId @@ -1816,8 +2057,9 @@ private constructor( } /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed + * to Scale Tier, this includes Scale Tier tokens. */ fun inputTokens(inputTokens: Long) = inputTokens(JsonField.of(inputTokens)) @@ -1862,8 +2104,9 @@ private constructor( fun object_(object_: JsonValue) = apply { this.object_ = object_ } /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier + * tokens. */ fun outputTokens(outputTokens: Long) = outputTokens(JsonField.of(outputTokens)) @@ -1921,9 +2164,7 @@ private constructor( */ fun batch(batch: JsonField) = apply { this.batch = batch } - /** - * The aggregated number of audio input tokens used, including cached tokens. - */ + /** The aggregated number of uncached audio input tokens used. */ fun inputAudioTokens(inputAudioTokens: Long) = inputAudioTokens(JsonField.of(inputAudioTokens)) @@ -1938,10 +2179,70 @@ private constructor( this.inputAudioTokens = inputAudioTokens } + /** The aggregated number of input tokens written to the cache. */ + fun inputCacheWriteTokens(inputCacheWriteTokens: Long) = + inputCacheWriteTokens(JsonField.of(inputCacheWriteTokens)) + /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier - * tokens. + * Sets [Builder.inputCacheWriteTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCacheWriteTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCacheWriteTokens(inputCacheWriteTokens: JsonField) = apply { + this.inputCacheWriteTokens = inputCacheWriteTokens + } + + /** The aggregated number of cached audio input tokens used. */ + fun inputCachedAudioTokens(inputCachedAudioTokens: Long) = + inputCachedAudioTokens(JsonField.of(inputCachedAudioTokens)) + + /** + * Sets [Builder.inputCachedAudioTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedAudioTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedAudioTokens(inputCachedAudioTokens: JsonField) = apply { + this.inputCachedAudioTokens = inputCachedAudioTokens + } + + /** The aggregated number of cached image input tokens used. */ + fun inputCachedImageTokens(inputCachedImageTokens: Long) = + inputCachedImageTokens(JsonField.of(inputCachedImageTokens)) + + /** + * Sets [Builder.inputCachedImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedImageTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedImageTokens(inputCachedImageTokens: JsonField) = apply { + this.inputCachedImageTokens = inputCachedImageTokens + } + + /** The aggregated number of cached text input tokens used. */ + fun inputCachedTextTokens(inputCachedTextTokens: Long) = + inputCachedTextTokens(JsonField.of(inputCachedTextTokens)) + + /** + * Sets [Builder.inputCachedTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedTextTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedTextTokens(inputCachedTextTokens: JsonField) = apply { + this.inputCachedTextTokens = inputCachedTextTokens + } + + /** + * The aggregated number of cached input tokens used across text, audio, and + * image inputs. For customers subscribed to Scale Tier, this includes Scale + * Tier tokens. */ fun inputCachedTokens(inputCachedTokens: Long) = inputCachedTokens(JsonField.of(inputCachedTokens)) @@ -1957,6 +2258,57 @@ private constructor( this.inputCachedTokens = inputCachedTokens } + /** The aggregated number of uncached image input tokens used. */ + fun inputImageTokens(inputImageTokens: Long) = + inputImageTokens(JsonField.of(inputImageTokens)) + + /** + * Sets [Builder.inputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputImageTokens(inputImageTokens: JsonField) = apply { + this.inputImageTokens = inputImageTokens + } + + /** + * The aggregated number of uncached text input tokens used, excluding + * cache-write tokens. + */ + fun inputTextTokens(inputTextTokens: Long) = + inputTextTokens(JsonField.of(inputTextTokens)) + + /** + * Sets [Builder.inputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputTextTokens(inputTextTokens: JsonField) = apply { + this.inputTextTokens = inputTextTokens + } + + /** + * The aggregated number of uncached input tokens used across text, audio, and + * image inputs, excluding cache-write tokens. + */ + fun inputUncachedTokens(inputUncachedTokens: Long) = + inputUncachedTokens(JsonField.of(inputUncachedTokens)) + + /** + * Sets [Builder.inputUncachedTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputUncachedTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputUncachedTokens(inputUncachedTokens: JsonField) = apply { + this.inputUncachedTokens = inputUncachedTokens + } + /** * When `group_by=model`, this field provides the model name of the grouped * usage result. @@ -1990,6 +2342,36 @@ private constructor( this.outputAudioTokens = outputAudioTokens } + /** The aggregated number of image output tokens used. */ + fun outputImageTokens(outputImageTokens: Long) = + outputImageTokens(JsonField.of(outputImageTokens)) + + /** + * Sets [Builder.outputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputImageTokens(outputImageTokens: JsonField) = apply { + this.outputImageTokens = outputImageTokens + } + + /** The aggregated number of text output tokens used. */ + fun outputTextTokens(outputTextTokens: Long) = + outputTextTokens(JsonField.of(outputTextTokens)) + + /** + * Sets [Builder.outputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputTextTokens(outputTextTokens: JsonField) = apply { + this.outputTextTokens = outputTextTokens + } + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -2095,9 +2477,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2133,9 +2524,18 @@ private constructor( apiKeyId() batch() inputAudioTokens() + inputCacheWriteTokens() + inputCachedAudioTokens() + inputCachedImageTokens() + inputCachedTextTokens() inputCachedTokens() + inputImageTokens() + inputTextTokens() + inputUncachedTokens() model() outputAudioTokens() + outputImageTokens() + outputTextTokens() projectId() serviceTier() userId() @@ -2168,9 +2568,18 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (batch.asKnown().isPresent) 1 else 0) + (if (inputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCacheWriteTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedTextTokens.asKnown().isPresent) 1 else 0) + (if (inputCachedTokens.asKnown().isPresent) 1 else 0) + + (if (inputImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputTextTokens.asKnown().isPresent) 1 else 0) + + (if (inputUncachedTokens.asKnown().isPresent) 1 else 0) + (if (model.asKnown().isPresent) 1 else 0) + (if (outputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (outputImageTokens.asKnown().isPresent) 1 else 0) + + (if (outputTextTokens.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + (if (serviceTier.asKnown().isPresent) 1 else 0) + (if (userId.asKnown().isPresent) 1 else 0) @@ -2188,9 +2597,18 @@ private constructor( apiKeyId == other.apiKeyId && batch == other.batch && inputAudioTokens == other.inputAudioTokens && + inputCacheWriteTokens == other.inputCacheWriteTokens && + inputCachedAudioTokens == other.inputCachedAudioTokens && + inputCachedImageTokens == other.inputCachedImageTokens && + inputCachedTextTokens == other.inputCachedTextTokens && inputCachedTokens == other.inputCachedTokens && + inputImageTokens == other.inputImageTokens && + inputTextTokens == other.inputTextTokens && + inputUncachedTokens == other.inputUncachedTokens && model == other.model && outputAudioTokens == other.outputAudioTokens && + outputImageTokens == other.outputImageTokens && + outputTextTokens == other.outputTextTokens && projectId == other.projectId && serviceTier == other.serviceTier && userId == other.userId && @@ -2206,9 +2624,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2219,7 +2646,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCachedTokens=$inputCachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" + "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCacheWriteTokens=$inputCacheWriteTokens, inputCachedAudioTokens=$inputCachedAudioTokens, inputCachedImageTokens=$inputCachedImageTokens, inputCachedTextTokens=$inputCachedTextTokens, inputCachedTokens=$inputCachedTokens, inputImageTokens=$inputImageTokens, inputTextTokens=$inputTextTokens, inputUncachedTokens=$inputUncachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, outputImageTokens=$outputImageTokens, outputTextTokens=$outputTextTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" } /** The aggregated embeddings usage details of the specific time bucket. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponse.kt index 04d418d88..6d5c6992d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponse.kt @@ -1442,9 +1442,18 @@ private constructor( private val apiKeyId: JsonField, private val batch: JsonField, private val inputAudioTokens: JsonField, + private val inputCacheWriteTokens: JsonField, + private val inputCachedAudioTokens: JsonField, + private val inputCachedImageTokens: JsonField, + private val inputCachedTextTokens: JsonField, private val inputCachedTokens: JsonField, + private val inputImageTokens: JsonField, + private val inputTextTokens: JsonField, + private val inputUncachedTokens: JsonField, private val model: JsonField, private val outputAudioTokens: JsonField, + private val outputImageTokens: JsonField, + private val outputTextTokens: JsonField, private val projectId: JsonField, private val serviceTier: JsonField, private val userId: JsonField, @@ -1472,15 +1481,42 @@ private constructor( @JsonProperty("input_audio_tokens") @ExcludeMissing inputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + inputCacheWriteTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + inputCachedAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + inputCachedImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + inputCachedTextTokens: JsonField = JsonMissing.of(), @JsonProperty("input_cached_tokens") @ExcludeMissing inputCachedTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_image_tokens") + @ExcludeMissing + inputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_text_tokens") + @ExcludeMissing + inputTextTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + inputUncachedTokens: JsonField = JsonMissing.of(), @JsonProperty("model") @ExcludeMissing model: JsonField = JsonMissing.of(), @JsonProperty("output_audio_tokens") @ExcludeMissing outputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_image_tokens") + @ExcludeMissing + outputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_text_tokens") + @ExcludeMissing + outputTextTokens: JsonField = JsonMissing.of(), @JsonProperty("project_id") @ExcludeMissing projectId: JsonField = JsonMissing.of(), @@ -1498,9 +1534,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -1508,8 +1553,9 @@ private constructor( ) /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed to + * Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1538,8 +1584,8 @@ private constructor( @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1566,7 +1612,7 @@ private constructor( fun batch(): Optional = batch.getOptional("batch") /** - * The aggregated number of audio input tokens used, including cached tokens. + * The aggregated number of uncached audio input tokens used. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1575,8 +1621,44 @@ private constructor( inputAudioTokens.getOptional("input_audio_tokens") /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens written to the cache. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCacheWriteTokens(): Optional = + inputCacheWriteTokens.getOptional("input_cache_write_tokens") + + /** + * The aggregated number of cached audio input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedAudioTokens(): Optional = + inputCachedAudioTokens.getOptional("input_cached_audio_tokens") + + /** + * The aggregated number of cached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedImageTokens(): Optional = + inputCachedImageTokens.getOptional("input_cached_image_tokens") + + /** + * The aggregated number of cached text input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedTextTokens(): Optional = + inputCachedTextTokens.getOptional("input_cached_text_tokens") + + /** + * The aggregated number of cached input tokens used across text, audio, and image + * inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1584,6 +1666,35 @@ private constructor( fun inputCachedTokens(): Optional = inputCachedTokens.getOptional("input_cached_tokens") + /** + * The aggregated number of uncached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputImageTokens(): Optional = + inputImageTokens.getOptional("input_image_tokens") + + /** + * The aggregated number of uncached text input tokens used, excluding cache-write + * tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputTextTokens(): Optional = + inputTextTokens.getOptional("input_text_tokens") + + /** + * The aggregated number of uncached input tokens used across text, audio, and image + * inputs, excluding cache-write tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputUncachedTokens(): Optional = + inputUncachedTokens.getOptional("input_uncached_tokens") + /** * When `group_by=model`, this field provides the model name of the grouped usage * result. @@ -1602,6 +1713,24 @@ private constructor( fun outputAudioTokens(): Optional = outputAudioTokens.getOptional("output_audio_tokens") + /** + * The aggregated number of image output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputImageTokens(): Optional = + outputImageTokens.getOptional("output_image_tokens") + + /** + * The aggregated number of text output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputTextTokens(): Optional = + outputTextTokens.getOptional("output_text_tokens") + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -1687,6 +1816,46 @@ private constructor( @ExcludeMissing fun _inputAudioTokens(): JsonField = inputAudioTokens + /** + * Returns the raw JSON value of [inputCacheWriteTokens]. + * + * Unlike [inputCacheWriteTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + fun _inputCacheWriteTokens(): JsonField = inputCacheWriteTokens + + /** + * Returns the raw JSON value of [inputCachedAudioTokens]. + * + * Unlike [inputCachedAudioTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + fun _inputCachedAudioTokens(): JsonField = inputCachedAudioTokens + + /** + * Returns the raw JSON value of [inputCachedImageTokens]. + * + * Unlike [inputCachedImageTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + fun _inputCachedImageTokens(): JsonField = inputCachedImageTokens + + /** + * Returns the raw JSON value of [inputCachedTextTokens]. + * + * Unlike [inputCachedTextTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + fun _inputCachedTextTokens(): JsonField = inputCachedTextTokens + /** * Returns the raw JSON value of [inputCachedTokens]. * @@ -1697,6 +1866,36 @@ private constructor( @ExcludeMissing fun _inputCachedTokens(): JsonField = inputCachedTokens + /** + * Returns the raw JSON value of [inputImageTokens]. + * + * Unlike [inputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_image_tokens") + @ExcludeMissing + fun _inputImageTokens(): JsonField = inputImageTokens + + /** + * Returns the raw JSON value of [inputTextTokens]. + * + * Unlike [inputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_text_tokens") + @ExcludeMissing + fun _inputTextTokens(): JsonField = inputTextTokens + + /** + * Returns the raw JSON value of [inputUncachedTokens]. + * + * Unlike [inputUncachedTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + fun _inputUncachedTokens(): JsonField = inputUncachedTokens + /** * Returns the raw JSON value of [model]. * @@ -1715,6 +1914,26 @@ private constructor( @ExcludeMissing fun _outputAudioTokens(): JsonField = outputAudioTokens + /** + * Returns the raw JSON value of [outputImageTokens]. + * + * Unlike [outputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_image_tokens") + @ExcludeMissing + fun _outputImageTokens(): JsonField = outputImageTokens + + /** + * Returns the raw JSON value of [outputTextTokens]. + * + * Unlike [outputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_text_tokens") + @ExcludeMissing + fun _outputTextTokens(): JsonField = outputTextTokens + /** * Returns the raw JSON value of [projectId]. * @@ -1782,9 +2001,18 @@ private constructor( private var apiKeyId: JsonField = JsonMissing.of() private var batch: JsonField = JsonMissing.of() private var inputAudioTokens: JsonField = JsonMissing.of() + private var inputCacheWriteTokens: JsonField = JsonMissing.of() + private var inputCachedAudioTokens: JsonField = JsonMissing.of() + private var inputCachedImageTokens: JsonField = JsonMissing.of() + private var inputCachedTextTokens: JsonField = JsonMissing.of() private var inputCachedTokens: JsonField = JsonMissing.of() + private var inputImageTokens: JsonField = JsonMissing.of() + private var inputTextTokens: JsonField = JsonMissing.of() + private var inputUncachedTokens: JsonField = JsonMissing.of() private var model: JsonField = JsonMissing.of() private var outputAudioTokens: JsonField = JsonMissing.of() + private var outputImageTokens: JsonField = JsonMissing.of() + private var outputTextTokens: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var serviceTier: JsonField = JsonMissing.of() private var userId: JsonField = JsonMissing.of() @@ -1801,9 +2029,22 @@ private constructor( apiKeyId = organizationUsageCompletionsResult.apiKeyId batch = organizationUsageCompletionsResult.batch inputAudioTokens = organizationUsageCompletionsResult.inputAudioTokens + inputCacheWriteTokens = + organizationUsageCompletionsResult.inputCacheWriteTokens + inputCachedAudioTokens = + organizationUsageCompletionsResult.inputCachedAudioTokens + inputCachedImageTokens = + organizationUsageCompletionsResult.inputCachedImageTokens + inputCachedTextTokens = + organizationUsageCompletionsResult.inputCachedTextTokens inputCachedTokens = organizationUsageCompletionsResult.inputCachedTokens + inputImageTokens = organizationUsageCompletionsResult.inputImageTokens + inputTextTokens = organizationUsageCompletionsResult.inputTextTokens + inputUncachedTokens = organizationUsageCompletionsResult.inputUncachedTokens model = organizationUsageCompletionsResult.model outputAudioTokens = organizationUsageCompletionsResult.outputAudioTokens + outputImageTokens = organizationUsageCompletionsResult.outputImageTokens + outputTextTokens = organizationUsageCompletionsResult.outputTextTokens projectId = organizationUsageCompletionsResult.projectId serviceTier = organizationUsageCompletionsResult.serviceTier userId = organizationUsageCompletionsResult.userId @@ -1812,8 +2053,9 @@ private constructor( } /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed + * to Scale Tier, this includes Scale Tier tokens. */ fun inputTokens(inputTokens: Long) = inputTokens(JsonField.of(inputTokens)) @@ -1858,8 +2100,9 @@ private constructor( fun object_(object_: JsonValue) = apply { this.object_ = object_ } /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier + * tokens. */ fun outputTokens(outputTokens: Long) = outputTokens(JsonField.of(outputTokens)) @@ -1917,9 +2160,7 @@ private constructor( */ fun batch(batch: JsonField) = apply { this.batch = batch } - /** - * The aggregated number of audio input tokens used, including cached tokens. - */ + /** The aggregated number of uncached audio input tokens used. */ fun inputAudioTokens(inputAudioTokens: Long) = inputAudioTokens(JsonField.of(inputAudioTokens)) @@ -1934,10 +2175,70 @@ private constructor( this.inputAudioTokens = inputAudioTokens } + /** The aggregated number of input tokens written to the cache. */ + fun inputCacheWriteTokens(inputCacheWriteTokens: Long) = + inputCacheWriteTokens(JsonField.of(inputCacheWriteTokens)) + /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier - * tokens. + * Sets [Builder.inputCacheWriteTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCacheWriteTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCacheWriteTokens(inputCacheWriteTokens: JsonField) = apply { + this.inputCacheWriteTokens = inputCacheWriteTokens + } + + /** The aggregated number of cached audio input tokens used. */ + fun inputCachedAudioTokens(inputCachedAudioTokens: Long) = + inputCachedAudioTokens(JsonField.of(inputCachedAudioTokens)) + + /** + * Sets [Builder.inputCachedAudioTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedAudioTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedAudioTokens(inputCachedAudioTokens: JsonField) = apply { + this.inputCachedAudioTokens = inputCachedAudioTokens + } + + /** The aggregated number of cached image input tokens used. */ + fun inputCachedImageTokens(inputCachedImageTokens: Long) = + inputCachedImageTokens(JsonField.of(inputCachedImageTokens)) + + /** + * Sets [Builder.inputCachedImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedImageTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedImageTokens(inputCachedImageTokens: JsonField) = apply { + this.inputCachedImageTokens = inputCachedImageTokens + } + + /** The aggregated number of cached text input tokens used. */ + fun inputCachedTextTokens(inputCachedTextTokens: Long) = + inputCachedTextTokens(JsonField.of(inputCachedTextTokens)) + + /** + * Sets [Builder.inputCachedTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedTextTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedTextTokens(inputCachedTextTokens: JsonField) = apply { + this.inputCachedTextTokens = inputCachedTextTokens + } + + /** + * The aggregated number of cached input tokens used across text, audio, and + * image inputs. For customers subscribed to Scale Tier, this includes Scale + * Tier tokens. */ fun inputCachedTokens(inputCachedTokens: Long) = inputCachedTokens(JsonField.of(inputCachedTokens)) @@ -1953,6 +2254,57 @@ private constructor( this.inputCachedTokens = inputCachedTokens } + /** The aggregated number of uncached image input tokens used. */ + fun inputImageTokens(inputImageTokens: Long) = + inputImageTokens(JsonField.of(inputImageTokens)) + + /** + * Sets [Builder.inputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputImageTokens(inputImageTokens: JsonField) = apply { + this.inputImageTokens = inputImageTokens + } + + /** + * The aggregated number of uncached text input tokens used, excluding + * cache-write tokens. + */ + fun inputTextTokens(inputTextTokens: Long) = + inputTextTokens(JsonField.of(inputTextTokens)) + + /** + * Sets [Builder.inputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputTextTokens(inputTextTokens: JsonField) = apply { + this.inputTextTokens = inputTextTokens + } + + /** + * The aggregated number of uncached input tokens used across text, audio, and + * image inputs, excluding cache-write tokens. + */ + fun inputUncachedTokens(inputUncachedTokens: Long) = + inputUncachedTokens(JsonField.of(inputUncachedTokens)) + + /** + * Sets [Builder.inputUncachedTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputUncachedTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputUncachedTokens(inputUncachedTokens: JsonField) = apply { + this.inputUncachedTokens = inputUncachedTokens + } + /** * When `group_by=model`, this field provides the model name of the grouped * usage result. @@ -1986,6 +2338,36 @@ private constructor( this.outputAudioTokens = outputAudioTokens } + /** The aggregated number of image output tokens used. */ + fun outputImageTokens(outputImageTokens: Long) = + outputImageTokens(JsonField.of(outputImageTokens)) + + /** + * Sets [Builder.outputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputImageTokens(outputImageTokens: JsonField) = apply { + this.outputImageTokens = outputImageTokens + } + + /** The aggregated number of text output tokens used. */ + fun outputTextTokens(outputTextTokens: Long) = + outputTextTokens(JsonField.of(outputTextTokens)) + + /** + * Sets [Builder.outputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputTextTokens(outputTextTokens: JsonField) = apply { + this.outputTextTokens = outputTextTokens + } + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -2091,9 +2473,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2129,9 +2520,18 @@ private constructor( apiKeyId() batch() inputAudioTokens() + inputCacheWriteTokens() + inputCachedAudioTokens() + inputCachedImageTokens() + inputCachedTextTokens() inputCachedTokens() + inputImageTokens() + inputTextTokens() + inputUncachedTokens() model() outputAudioTokens() + outputImageTokens() + outputTextTokens() projectId() serviceTier() userId() @@ -2164,9 +2564,18 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (batch.asKnown().isPresent) 1 else 0) + (if (inputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCacheWriteTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedTextTokens.asKnown().isPresent) 1 else 0) + (if (inputCachedTokens.asKnown().isPresent) 1 else 0) + + (if (inputImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputTextTokens.asKnown().isPresent) 1 else 0) + + (if (inputUncachedTokens.asKnown().isPresent) 1 else 0) + (if (model.asKnown().isPresent) 1 else 0) + (if (outputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (outputImageTokens.asKnown().isPresent) 1 else 0) + + (if (outputTextTokens.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + (if (serviceTier.asKnown().isPresent) 1 else 0) + (if (userId.asKnown().isPresent) 1 else 0) @@ -2184,9 +2593,18 @@ private constructor( apiKeyId == other.apiKeyId && batch == other.batch && inputAudioTokens == other.inputAudioTokens && + inputCacheWriteTokens == other.inputCacheWriteTokens && + inputCachedAudioTokens == other.inputCachedAudioTokens && + inputCachedImageTokens == other.inputCachedImageTokens && + inputCachedTextTokens == other.inputCachedTextTokens && inputCachedTokens == other.inputCachedTokens && + inputImageTokens == other.inputImageTokens && + inputTextTokens == other.inputTextTokens && + inputUncachedTokens == other.inputUncachedTokens && model == other.model && outputAudioTokens == other.outputAudioTokens && + outputImageTokens == other.outputImageTokens && + outputTextTokens == other.outputTextTokens && projectId == other.projectId && serviceTier == other.serviceTier && userId == other.userId && @@ -2202,9 +2620,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2215,7 +2642,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCachedTokens=$inputCachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" + "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCacheWriteTokens=$inputCacheWriteTokens, inputCachedAudioTokens=$inputCachedAudioTokens, inputCachedImageTokens=$inputCachedImageTokens, inputCachedTextTokens=$inputCachedTextTokens, inputCachedTokens=$inputCachedTokens, inputImageTokens=$inputImageTokens, inputTextTokens=$inputTextTokens, inputUncachedTokens=$inputUncachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, outputImageTokens=$outputImageTokens, outputTextTokens=$outputTextTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" } /** The aggregated embeddings usage details of the specific time bucket. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponse.kt index 760f89b5c..19dd63b37 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponse.kt @@ -1442,9 +1442,18 @@ private constructor( private val apiKeyId: JsonField, private val batch: JsonField, private val inputAudioTokens: JsonField, + private val inputCacheWriteTokens: JsonField, + private val inputCachedAudioTokens: JsonField, + private val inputCachedImageTokens: JsonField, + private val inputCachedTextTokens: JsonField, private val inputCachedTokens: JsonField, + private val inputImageTokens: JsonField, + private val inputTextTokens: JsonField, + private val inputUncachedTokens: JsonField, private val model: JsonField, private val outputAudioTokens: JsonField, + private val outputImageTokens: JsonField, + private val outputTextTokens: JsonField, private val projectId: JsonField, private val serviceTier: JsonField, private val userId: JsonField, @@ -1472,15 +1481,42 @@ private constructor( @JsonProperty("input_audio_tokens") @ExcludeMissing inputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + inputCacheWriteTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + inputCachedAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + inputCachedImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + inputCachedTextTokens: JsonField = JsonMissing.of(), @JsonProperty("input_cached_tokens") @ExcludeMissing inputCachedTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_image_tokens") + @ExcludeMissing + inputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_text_tokens") + @ExcludeMissing + inputTextTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + inputUncachedTokens: JsonField = JsonMissing.of(), @JsonProperty("model") @ExcludeMissing model: JsonField = JsonMissing.of(), @JsonProperty("output_audio_tokens") @ExcludeMissing outputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_image_tokens") + @ExcludeMissing + outputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_text_tokens") + @ExcludeMissing + outputTextTokens: JsonField = JsonMissing.of(), @JsonProperty("project_id") @ExcludeMissing projectId: JsonField = JsonMissing.of(), @@ -1498,9 +1534,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -1508,8 +1553,9 @@ private constructor( ) /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed to + * Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1538,8 +1584,8 @@ private constructor( @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1566,7 +1612,7 @@ private constructor( fun batch(): Optional = batch.getOptional("batch") /** - * The aggregated number of audio input tokens used, including cached tokens. + * The aggregated number of uncached audio input tokens used. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1575,8 +1621,44 @@ private constructor( inputAudioTokens.getOptional("input_audio_tokens") /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens written to the cache. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCacheWriteTokens(): Optional = + inputCacheWriteTokens.getOptional("input_cache_write_tokens") + + /** + * The aggregated number of cached audio input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedAudioTokens(): Optional = + inputCachedAudioTokens.getOptional("input_cached_audio_tokens") + + /** + * The aggregated number of cached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedImageTokens(): Optional = + inputCachedImageTokens.getOptional("input_cached_image_tokens") + + /** + * The aggregated number of cached text input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedTextTokens(): Optional = + inputCachedTextTokens.getOptional("input_cached_text_tokens") + + /** + * The aggregated number of cached input tokens used across text, audio, and image + * inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1584,6 +1666,35 @@ private constructor( fun inputCachedTokens(): Optional = inputCachedTokens.getOptional("input_cached_tokens") + /** + * The aggregated number of uncached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputImageTokens(): Optional = + inputImageTokens.getOptional("input_image_tokens") + + /** + * The aggregated number of uncached text input tokens used, excluding cache-write + * tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputTextTokens(): Optional = + inputTextTokens.getOptional("input_text_tokens") + + /** + * The aggregated number of uncached input tokens used across text, audio, and image + * inputs, excluding cache-write tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputUncachedTokens(): Optional = + inputUncachedTokens.getOptional("input_uncached_tokens") + /** * When `group_by=model`, this field provides the model name of the grouped usage * result. @@ -1602,6 +1713,24 @@ private constructor( fun outputAudioTokens(): Optional = outputAudioTokens.getOptional("output_audio_tokens") + /** + * The aggregated number of image output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputImageTokens(): Optional = + outputImageTokens.getOptional("output_image_tokens") + + /** + * The aggregated number of text output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputTextTokens(): Optional = + outputTextTokens.getOptional("output_text_tokens") + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -1687,6 +1816,46 @@ private constructor( @ExcludeMissing fun _inputAudioTokens(): JsonField = inputAudioTokens + /** + * Returns the raw JSON value of [inputCacheWriteTokens]. + * + * Unlike [inputCacheWriteTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + fun _inputCacheWriteTokens(): JsonField = inputCacheWriteTokens + + /** + * Returns the raw JSON value of [inputCachedAudioTokens]. + * + * Unlike [inputCachedAudioTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + fun _inputCachedAudioTokens(): JsonField = inputCachedAudioTokens + + /** + * Returns the raw JSON value of [inputCachedImageTokens]. + * + * Unlike [inputCachedImageTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + fun _inputCachedImageTokens(): JsonField = inputCachedImageTokens + + /** + * Returns the raw JSON value of [inputCachedTextTokens]. + * + * Unlike [inputCachedTextTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + fun _inputCachedTextTokens(): JsonField = inputCachedTextTokens + /** * Returns the raw JSON value of [inputCachedTokens]. * @@ -1697,6 +1866,36 @@ private constructor( @ExcludeMissing fun _inputCachedTokens(): JsonField = inputCachedTokens + /** + * Returns the raw JSON value of [inputImageTokens]. + * + * Unlike [inputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_image_tokens") + @ExcludeMissing + fun _inputImageTokens(): JsonField = inputImageTokens + + /** + * Returns the raw JSON value of [inputTextTokens]. + * + * Unlike [inputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_text_tokens") + @ExcludeMissing + fun _inputTextTokens(): JsonField = inputTextTokens + + /** + * Returns the raw JSON value of [inputUncachedTokens]. + * + * Unlike [inputUncachedTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + fun _inputUncachedTokens(): JsonField = inputUncachedTokens + /** * Returns the raw JSON value of [model]. * @@ -1715,6 +1914,26 @@ private constructor( @ExcludeMissing fun _outputAudioTokens(): JsonField = outputAudioTokens + /** + * Returns the raw JSON value of [outputImageTokens]. + * + * Unlike [outputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_image_tokens") + @ExcludeMissing + fun _outputImageTokens(): JsonField = outputImageTokens + + /** + * Returns the raw JSON value of [outputTextTokens]. + * + * Unlike [outputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_text_tokens") + @ExcludeMissing + fun _outputTextTokens(): JsonField = outputTextTokens + /** * Returns the raw JSON value of [projectId]. * @@ -1782,9 +2001,18 @@ private constructor( private var apiKeyId: JsonField = JsonMissing.of() private var batch: JsonField = JsonMissing.of() private var inputAudioTokens: JsonField = JsonMissing.of() + private var inputCacheWriteTokens: JsonField = JsonMissing.of() + private var inputCachedAudioTokens: JsonField = JsonMissing.of() + private var inputCachedImageTokens: JsonField = JsonMissing.of() + private var inputCachedTextTokens: JsonField = JsonMissing.of() private var inputCachedTokens: JsonField = JsonMissing.of() + private var inputImageTokens: JsonField = JsonMissing.of() + private var inputTextTokens: JsonField = JsonMissing.of() + private var inputUncachedTokens: JsonField = JsonMissing.of() private var model: JsonField = JsonMissing.of() private var outputAudioTokens: JsonField = JsonMissing.of() + private var outputImageTokens: JsonField = JsonMissing.of() + private var outputTextTokens: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var serviceTier: JsonField = JsonMissing.of() private var userId: JsonField = JsonMissing.of() @@ -1801,9 +2029,22 @@ private constructor( apiKeyId = organizationUsageCompletionsResult.apiKeyId batch = organizationUsageCompletionsResult.batch inputAudioTokens = organizationUsageCompletionsResult.inputAudioTokens + inputCacheWriteTokens = + organizationUsageCompletionsResult.inputCacheWriteTokens + inputCachedAudioTokens = + organizationUsageCompletionsResult.inputCachedAudioTokens + inputCachedImageTokens = + organizationUsageCompletionsResult.inputCachedImageTokens + inputCachedTextTokens = + organizationUsageCompletionsResult.inputCachedTextTokens inputCachedTokens = organizationUsageCompletionsResult.inputCachedTokens + inputImageTokens = organizationUsageCompletionsResult.inputImageTokens + inputTextTokens = organizationUsageCompletionsResult.inputTextTokens + inputUncachedTokens = organizationUsageCompletionsResult.inputUncachedTokens model = organizationUsageCompletionsResult.model outputAudioTokens = organizationUsageCompletionsResult.outputAudioTokens + outputImageTokens = organizationUsageCompletionsResult.outputImageTokens + outputTextTokens = organizationUsageCompletionsResult.outputTextTokens projectId = organizationUsageCompletionsResult.projectId serviceTier = organizationUsageCompletionsResult.serviceTier userId = organizationUsageCompletionsResult.userId @@ -1812,8 +2053,9 @@ private constructor( } /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed + * to Scale Tier, this includes Scale Tier tokens. */ fun inputTokens(inputTokens: Long) = inputTokens(JsonField.of(inputTokens)) @@ -1858,8 +2100,9 @@ private constructor( fun object_(object_: JsonValue) = apply { this.object_ = object_ } /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier + * tokens. */ fun outputTokens(outputTokens: Long) = outputTokens(JsonField.of(outputTokens)) @@ -1917,9 +2160,7 @@ private constructor( */ fun batch(batch: JsonField) = apply { this.batch = batch } - /** - * The aggregated number of audio input tokens used, including cached tokens. - */ + /** The aggregated number of uncached audio input tokens used. */ fun inputAudioTokens(inputAudioTokens: Long) = inputAudioTokens(JsonField.of(inputAudioTokens)) @@ -1934,10 +2175,70 @@ private constructor( this.inputAudioTokens = inputAudioTokens } + /** The aggregated number of input tokens written to the cache. */ + fun inputCacheWriteTokens(inputCacheWriteTokens: Long) = + inputCacheWriteTokens(JsonField.of(inputCacheWriteTokens)) + /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier - * tokens. + * Sets [Builder.inputCacheWriteTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCacheWriteTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCacheWriteTokens(inputCacheWriteTokens: JsonField) = apply { + this.inputCacheWriteTokens = inputCacheWriteTokens + } + + /** The aggregated number of cached audio input tokens used. */ + fun inputCachedAudioTokens(inputCachedAudioTokens: Long) = + inputCachedAudioTokens(JsonField.of(inputCachedAudioTokens)) + + /** + * Sets [Builder.inputCachedAudioTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedAudioTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedAudioTokens(inputCachedAudioTokens: JsonField) = apply { + this.inputCachedAudioTokens = inputCachedAudioTokens + } + + /** The aggregated number of cached image input tokens used. */ + fun inputCachedImageTokens(inputCachedImageTokens: Long) = + inputCachedImageTokens(JsonField.of(inputCachedImageTokens)) + + /** + * Sets [Builder.inputCachedImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedImageTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedImageTokens(inputCachedImageTokens: JsonField) = apply { + this.inputCachedImageTokens = inputCachedImageTokens + } + + /** The aggregated number of cached text input tokens used. */ + fun inputCachedTextTokens(inputCachedTextTokens: Long) = + inputCachedTextTokens(JsonField.of(inputCachedTextTokens)) + + /** + * Sets [Builder.inputCachedTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedTextTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedTextTokens(inputCachedTextTokens: JsonField) = apply { + this.inputCachedTextTokens = inputCachedTextTokens + } + + /** + * The aggregated number of cached input tokens used across text, audio, and + * image inputs. For customers subscribed to Scale Tier, this includes Scale + * Tier tokens. */ fun inputCachedTokens(inputCachedTokens: Long) = inputCachedTokens(JsonField.of(inputCachedTokens)) @@ -1953,6 +2254,57 @@ private constructor( this.inputCachedTokens = inputCachedTokens } + /** The aggregated number of uncached image input tokens used. */ + fun inputImageTokens(inputImageTokens: Long) = + inputImageTokens(JsonField.of(inputImageTokens)) + + /** + * Sets [Builder.inputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputImageTokens(inputImageTokens: JsonField) = apply { + this.inputImageTokens = inputImageTokens + } + + /** + * The aggregated number of uncached text input tokens used, excluding + * cache-write tokens. + */ + fun inputTextTokens(inputTextTokens: Long) = + inputTextTokens(JsonField.of(inputTextTokens)) + + /** + * Sets [Builder.inputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputTextTokens(inputTextTokens: JsonField) = apply { + this.inputTextTokens = inputTextTokens + } + + /** + * The aggregated number of uncached input tokens used across text, audio, and + * image inputs, excluding cache-write tokens. + */ + fun inputUncachedTokens(inputUncachedTokens: Long) = + inputUncachedTokens(JsonField.of(inputUncachedTokens)) + + /** + * Sets [Builder.inputUncachedTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputUncachedTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputUncachedTokens(inputUncachedTokens: JsonField) = apply { + this.inputUncachedTokens = inputUncachedTokens + } + /** * When `group_by=model`, this field provides the model name of the grouped * usage result. @@ -1986,6 +2338,36 @@ private constructor( this.outputAudioTokens = outputAudioTokens } + /** The aggregated number of image output tokens used. */ + fun outputImageTokens(outputImageTokens: Long) = + outputImageTokens(JsonField.of(outputImageTokens)) + + /** + * Sets [Builder.outputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputImageTokens(outputImageTokens: JsonField) = apply { + this.outputImageTokens = outputImageTokens + } + + /** The aggregated number of text output tokens used. */ + fun outputTextTokens(outputTextTokens: Long) = + outputTextTokens(JsonField.of(outputTextTokens)) + + /** + * Sets [Builder.outputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputTextTokens(outputTextTokens: JsonField) = apply { + this.outputTextTokens = outputTextTokens + } + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -2091,9 +2473,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2129,9 +2520,18 @@ private constructor( apiKeyId() batch() inputAudioTokens() + inputCacheWriteTokens() + inputCachedAudioTokens() + inputCachedImageTokens() + inputCachedTextTokens() inputCachedTokens() + inputImageTokens() + inputTextTokens() + inputUncachedTokens() model() outputAudioTokens() + outputImageTokens() + outputTextTokens() projectId() serviceTier() userId() @@ -2164,9 +2564,18 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (batch.asKnown().isPresent) 1 else 0) + (if (inputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCacheWriteTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedTextTokens.asKnown().isPresent) 1 else 0) + (if (inputCachedTokens.asKnown().isPresent) 1 else 0) + + (if (inputImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputTextTokens.asKnown().isPresent) 1 else 0) + + (if (inputUncachedTokens.asKnown().isPresent) 1 else 0) + (if (model.asKnown().isPresent) 1 else 0) + (if (outputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (outputImageTokens.asKnown().isPresent) 1 else 0) + + (if (outputTextTokens.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + (if (serviceTier.asKnown().isPresent) 1 else 0) + (if (userId.asKnown().isPresent) 1 else 0) @@ -2184,9 +2593,18 @@ private constructor( apiKeyId == other.apiKeyId && batch == other.batch && inputAudioTokens == other.inputAudioTokens && + inputCacheWriteTokens == other.inputCacheWriteTokens && + inputCachedAudioTokens == other.inputCachedAudioTokens && + inputCachedImageTokens == other.inputCachedImageTokens && + inputCachedTextTokens == other.inputCachedTextTokens && inputCachedTokens == other.inputCachedTokens && + inputImageTokens == other.inputImageTokens && + inputTextTokens == other.inputTextTokens && + inputUncachedTokens == other.inputUncachedTokens && model == other.model && outputAudioTokens == other.outputAudioTokens && + outputImageTokens == other.outputImageTokens && + outputTextTokens == other.outputTextTokens && projectId == other.projectId && serviceTier == other.serviceTier && userId == other.userId && @@ -2202,9 +2620,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2215,7 +2642,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCachedTokens=$inputCachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" + "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCacheWriteTokens=$inputCacheWriteTokens, inputCachedAudioTokens=$inputCachedAudioTokens, inputCachedImageTokens=$inputCachedImageTokens, inputCachedTextTokens=$inputCachedTextTokens, inputCachedTokens=$inputCachedTokens, inputImageTokens=$inputImageTokens, inputTextTokens=$inputTextTokens, inputUncachedTokens=$inputUncachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, outputImageTokens=$outputImageTokens, outputTextTokens=$outputTextTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" } /** The aggregated embeddings usage details of the specific time bucket. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponse.kt index 88472bb36..7447c9387 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponse.kt @@ -1442,9 +1442,18 @@ private constructor( private val apiKeyId: JsonField, private val batch: JsonField, private val inputAudioTokens: JsonField, + private val inputCacheWriteTokens: JsonField, + private val inputCachedAudioTokens: JsonField, + private val inputCachedImageTokens: JsonField, + private val inputCachedTextTokens: JsonField, private val inputCachedTokens: JsonField, + private val inputImageTokens: JsonField, + private val inputTextTokens: JsonField, + private val inputUncachedTokens: JsonField, private val model: JsonField, private val outputAudioTokens: JsonField, + private val outputImageTokens: JsonField, + private val outputTextTokens: JsonField, private val projectId: JsonField, private val serviceTier: JsonField, private val userId: JsonField, @@ -1472,15 +1481,42 @@ private constructor( @JsonProperty("input_audio_tokens") @ExcludeMissing inputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + inputCacheWriteTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + inputCachedAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + inputCachedImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + inputCachedTextTokens: JsonField = JsonMissing.of(), @JsonProperty("input_cached_tokens") @ExcludeMissing inputCachedTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_image_tokens") + @ExcludeMissing + inputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_text_tokens") + @ExcludeMissing + inputTextTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + inputUncachedTokens: JsonField = JsonMissing.of(), @JsonProperty("model") @ExcludeMissing model: JsonField = JsonMissing.of(), @JsonProperty("output_audio_tokens") @ExcludeMissing outputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_image_tokens") + @ExcludeMissing + outputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_text_tokens") + @ExcludeMissing + outputTextTokens: JsonField = JsonMissing.of(), @JsonProperty("project_id") @ExcludeMissing projectId: JsonField = JsonMissing.of(), @@ -1498,9 +1534,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -1508,8 +1553,9 @@ private constructor( ) /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed to + * Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1538,8 +1584,8 @@ private constructor( @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1566,7 +1612,7 @@ private constructor( fun batch(): Optional = batch.getOptional("batch") /** - * The aggregated number of audio input tokens used, including cached tokens. + * The aggregated number of uncached audio input tokens used. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1575,8 +1621,44 @@ private constructor( inputAudioTokens.getOptional("input_audio_tokens") /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens written to the cache. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCacheWriteTokens(): Optional = + inputCacheWriteTokens.getOptional("input_cache_write_tokens") + + /** + * The aggregated number of cached audio input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedAudioTokens(): Optional = + inputCachedAudioTokens.getOptional("input_cached_audio_tokens") + + /** + * The aggregated number of cached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedImageTokens(): Optional = + inputCachedImageTokens.getOptional("input_cached_image_tokens") + + /** + * The aggregated number of cached text input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedTextTokens(): Optional = + inputCachedTextTokens.getOptional("input_cached_text_tokens") + + /** + * The aggregated number of cached input tokens used across text, audio, and image + * inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1584,6 +1666,35 @@ private constructor( fun inputCachedTokens(): Optional = inputCachedTokens.getOptional("input_cached_tokens") + /** + * The aggregated number of uncached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputImageTokens(): Optional = + inputImageTokens.getOptional("input_image_tokens") + + /** + * The aggregated number of uncached text input tokens used, excluding cache-write + * tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputTextTokens(): Optional = + inputTextTokens.getOptional("input_text_tokens") + + /** + * The aggregated number of uncached input tokens used across text, audio, and image + * inputs, excluding cache-write tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputUncachedTokens(): Optional = + inputUncachedTokens.getOptional("input_uncached_tokens") + /** * When `group_by=model`, this field provides the model name of the grouped usage * result. @@ -1602,6 +1713,24 @@ private constructor( fun outputAudioTokens(): Optional = outputAudioTokens.getOptional("output_audio_tokens") + /** + * The aggregated number of image output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputImageTokens(): Optional = + outputImageTokens.getOptional("output_image_tokens") + + /** + * The aggregated number of text output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputTextTokens(): Optional = + outputTextTokens.getOptional("output_text_tokens") + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -1687,6 +1816,46 @@ private constructor( @ExcludeMissing fun _inputAudioTokens(): JsonField = inputAudioTokens + /** + * Returns the raw JSON value of [inputCacheWriteTokens]. + * + * Unlike [inputCacheWriteTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + fun _inputCacheWriteTokens(): JsonField = inputCacheWriteTokens + + /** + * Returns the raw JSON value of [inputCachedAudioTokens]. + * + * Unlike [inputCachedAudioTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + fun _inputCachedAudioTokens(): JsonField = inputCachedAudioTokens + + /** + * Returns the raw JSON value of [inputCachedImageTokens]. + * + * Unlike [inputCachedImageTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + fun _inputCachedImageTokens(): JsonField = inputCachedImageTokens + + /** + * Returns the raw JSON value of [inputCachedTextTokens]. + * + * Unlike [inputCachedTextTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + fun _inputCachedTextTokens(): JsonField = inputCachedTextTokens + /** * Returns the raw JSON value of [inputCachedTokens]. * @@ -1697,6 +1866,36 @@ private constructor( @ExcludeMissing fun _inputCachedTokens(): JsonField = inputCachedTokens + /** + * Returns the raw JSON value of [inputImageTokens]. + * + * Unlike [inputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_image_tokens") + @ExcludeMissing + fun _inputImageTokens(): JsonField = inputImageTokens + + /** + * Returns the raw JSON value of [inputTextTokens]. + * + * Unlike [inputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_text_tokens") + @ExcludeMissing + fun _inputTextTokens(): JsonField = inputTextTokens + + /** + * Returns the raw JSON value of [inputUncachedTokens]. + * + * Unlike [inputUncachedTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + fun _inputUncachedTokens(): JsonField = inputUncachedTokens + /** * Returns the raw JSON value of [model]. * @@ -1715,6 +1914,26 @@ private constructor( @ExcludeMissing fun _outputAudioTokens(): JsonField = outputAudioTokens + /** + * Returns the raw JSON value of [outputImageTokens]. + * + * Unlike [outputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_image_tokens") + @ExcludeMissing + fun _outputImageTokens(): JsonField = outputImageTokens + + /** + * Returns the raw JSON value of [outputTextTokens]. + * + * Unlike [outputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_text_tokens") + @ExcludeMissing + fun _outputTextTokens(): JsonField = outputTextTokens + /** * Returns the raw JSON value of [projectId]. * @@ -1782,9 +2001,18 @@ private constructor( private var apiKeyId: JsonField = JsonMissing.of() private var batch: JsonField = JsonMissing.of() private var inputAudioTokens: JsonField = JsonMissing.of() + private var inputCacheWriteTokens: JsonField = JsonMissing.of() + private var inputCachedAudioTokens: JsonField = JsonMissing.of() + private var inputCachedImageTokens: JsonField = JsonMissing.of() + private var inputCachedTextTokens: JsonField = JsonMissing.of() private var inputCachedTokens: JsonField = JsonMissing.of() + private var inputImageTokens: JsonField = JsonMissing.of() + private var inputTextTokens: JsonField = JsonMissing.of() + private var inputUncachedTokens: JsonField = JsonMissing.of() private var model: JsonField = JsonMissing.of() private var outputAudioTokens: JsonField = JsonMissing.of() + private var outputImageTokens: JsonField = JsonMissing.of() + private var outputTextTokens: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var serviceTier: JsonField = JsonMissing.of() private var userId: JsonField = JsonMissing.of() @@ -1801,9 +2029,22 @@ private constructor( apiKeyId = organizationUsageCompletionsResult.apiKeyId batch = organizationUsageCompletionsResult.batch inputAudioTokens = organizationUsageCompletionsResult.inputAudioTokens + inputCacheWriteTokens = + organizationUsageCompletionsResult.inputCacheWriteTokens + inputCachedAudioTokens = + organizationUsageCompletionsResult.inputCachedAudioTokens + inputCachedImageTokens = + organizationUsageCompletionsResult.inputCachedImageTokens + inputCachedTextTokens = + organizationUsageCompletionsResult.inputCachedTextTokens inputCachedTokens = organizationUsageCompletionsResult.inputCachedTokens + inputImageTokens = organizationUsageCompletionsResult.inputImageTokens + inputTextTokens = organizationUsageCompletionsResult.inputTextTokens + inputUncachedTokens = organizationUsageCompletionsResult.inputUncachedTokens model = organizationUsageCompletionsResult.model outputAudioTokens = organizationUsageCompletionsResult.outputAudioTokens + outputImageTokens = organizationUsageCompletionsResult.outputImageTokens + outputTextTokens = organizationUsageCompletionsResult.outputTextTokens projectId = organizationUsageCompletionsResult.projectId serviceTier = organizationUsageCompletionsResult.serviceTier userId = organizationUsageCompletionsResult.userId @@ -1812,8 +2053,9 @@ private constructor( } /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed + * to Scale Tier, this includes Scale Tier tokens. */ fun inputTokens(inputTokens: Long) = inputTokens(JsonField.of(inputTokens)) @@ -1858,8 +2100,9 @@ private constructor( fun object_(object_: JsonValue) = apply { this.object_ = object_ } /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier + * tokens. */ fun outputTokens(outputTokens: Long) = outputTokens(JsonField.of(outputTokens)) @@ -1917,9 +2160,7 @@ private constructor( */ fun batch(batch: JsonField) = apply { this.batch = batch } - /** - * The aggregated number of audio input tokens used, including cached tokens. - */ + /** The aggregated number of uncached audio input tokens used. */ fun inputAudioTokens(inputAudioTokens: Long) = inputAudioTokens(JsonField.of(inputAudioTokens)) @@ -1934,10 +2175,70 @@ private constructor( this.inputAudioTokens = inputAudioTokens } + /** The aggregated number of input tokens written to the cache. */ + fun inputCacheWriteTokens(inputCacheWriteTokens: Long) = + inputCacheWriteTokens(JsonField.of(inputCacheWriteTokens)) + /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier - * tokens. + * Sets [Builder.inputCacheWriteTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCacheWriteTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCacheWriteTokens(inputCacheWriteTokens: JsonField) = apply { + this.inputCacheWriteTokens = inputCacheWriteTokens + } + + /** The aggregated number of cached audio input tokens used. */ + fun inputCachedAudioTokens(inputCachedAudioTokens: Long) = + inputCachedAudioTokens(JsonField.of(inputCachedAudioTokens)) + + /** + * Sets [Builder.inputCachedAudioTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedAudioTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedAudioTokens(inputCachedAudioTokens: JsonField) = apply { + this.inputCachedAudioTokens = inputCachedAudioTokens + } + + /** The aggregated number of cached image input tokens used. */ + fun inputCachedImageTokens(inputCachedImageTokens: Long) = + inputCachedImageTokens(JsonField.of(inputCachedImageTokens)) + + /** + * Sets [Builder.inputCachedImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedImageTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedImageTokens(inputCachedImageTokens: JsonField) = apply { + this.inputCachedImageTokens = inputCachedImageTokens + } + + /** The aggregated number of cached text input tokens used. */ + fun inputCachedTextTokens(inputCachedTextTokens: Long) = + inputCachedTextTokens(JsonField.of(inputCachedTextTokens)) + + /** + * Sets [Builder.inputCachedTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedTextTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedTextTokens(inputCachedTextTokens: JsonField) = apply { + this.inputCachedTextTokens = inputCachedTextTokens + } + + /** + * The aggregated number of cached input tokens used across text, audio, and + * image inputs. For customers subscribed to Scale Tier, this includes Scale + * Tier tokens. */ fun inputCachedTokens(inputCachedTokens: Long) = inputCachedTokens(JsonField.of(inputCachedTokens)) @@ -1953,6 +2254,57 @@ private constructor( this.inputCachedTokens = inputCachedTokens } + /** The aggregated number of uncached image input tokens used. */ + fun inputImageTokens(inputImageTokens: Long) = + inputImageTokens(JsonField.of(inputImageTokens)) + + /** + * Sets [Builder.inputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputImageTokens(inputImageTokens: JsonField) = apply { + this.inputImageTokens = inputImageTokens + } + + /** + * The aggregated number of uncached text input tokens used, excluding + * cache-write tokens. + */ + fun inputTextTokens(inputTextTokens: Long) = + inputTextTokens(JsonField.of(inputTextTokens)) + + /** + * Sets [Builder.inputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputTextTokens(inputTextTokens: JsonField) = apply { + this.inputTextTokens = inputTextTokens + } + + /** + * The aggregated number of uncached input tokens used across text, audio, and + * image inputs, excluding cache-write tokens. + */ + fun inputUncachedTokens(inputUncachedTokens: Long) = + inputUncachedTokens(JsonField.of(inputUncachedTokens)) + + /** + * Sets [Builder.inputUncachedTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputUncachedTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputUncachedTokens(inputUncachedTokens: JsonField) = apply { + this.inputUncachedTokens = inputUncachedTokens + } + /** * When `group_by=model`, this field provides the model name of the grouped * usage result. @@ -1986,6 +2338,36 @@ private constructor( this.outputAudioTokens = outputAudioTokens } + /** The aggregated number of image output tokens used. */ + fun outputImageTokens(outputImageTokens: Long) = + outputImageTokens(JsonField.of(outputImageTokens)) + + /** + * Sets [Builder.outputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputImageTokens(outputImageTokens: JsonField) = apply { + this.outputImageTokens = outputImageTokens + } + + /** The aggregated number of text output tokens used. */ + fun outputTextTokens(outputTextTokens: Long) = + outputTextTokens(JsonField.of(outputTextTokens)) + + /** + * Sets [Builder.outputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputTextTokens(outputTextTokens: JsonField) = apply { + this.outputTextTokens = outputTextTokens + } + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -2091,9 +2473,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2129,9 +2520,18 @@ private constructor( apiKeyId() batch() inputAudioTokens() + inputCacheWriteTokens() + inputCachedAudioTokens() + inputCachedImageTokens() + inputCachedTextTokens() inputCachedTokens() + inputImageTokens() + inputTextTokens() + inputUncachedTokens() model() outputAudioTokens() + outputImageTokens() + outputTextTokens() projectId() serviceTier() userId() @@ -2164,9 +2564,18 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (batch.asKnown().isPresent) 1 else 0) + (if (inputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCacheWriteTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedTextTokens.asKnown().isPresent) 1 else 0) + (if (inputCachedTokens.asKnown().isPresent) 1 else 0) + + (if (inputImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputTextTokens.asKnown().isPresent) 1 else 0) + + (if (inputUncachedTokens.asKnown().isPresent) 1 else 0) + (if (model.asKnown().isPresent) 1 else 0) + (if (outputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (outputImageTokens.asKnown().isPresent) 1 else 0) + + (if (outputTextTokens.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + (if (serviceTier.asKnown().isPresent) 1 else 0) + (if (userId.asKnown().isPresent) 1 else 0) @@ -2184,9 +2593,18 @@ private constructor( apiKeyId == other.apiKeyId && batch == other.batch && inputAudioTokens == other.inputAudioTokens && + inputCacheWriteTokens == other.inputCacheWriteTokens && + inputCachedAudioTokens == other.inputCachedAudioTokens && + inputCachedImageTokens == other.inputCachedImageTokens && + inputCachedTextTokens == other.inputCachedTextTokens && inputCachedTokens == other.inputCachedTokens && + inputImageTokens == other.inputImageTokens && + inputTextTokens == other.inputTextTokens && + inputUncachedTokens == other.inputUncachedTokens && model == other.model && outputAudioTokens == other.outputAudioTokens && + outputImageTokens == other.outputImageTokens && + outputTextTokens == other.outputTextTokens && projectId == other.projectId && serviceTier == other.serviceTier && userId == other.userId && @@ -2202,9 +2620,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2215,7 +2642,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCachedTokens=$inputCachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" + "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCacheWriteTokens=$inputCacheWriteTokens, inputCachedAudioTokens=$inputCachedAudioTokens, inputCachedImageTokens=$inputCachedImageTokens, inputCachedTextTokens=$inputCachedTextTokens, inputCachedTokens=$inputCachedTokens, inputImageTokens=$inputImageTokens, inputTextTokens=$inputTextTokens, inputUncachedTokens=$inputUncachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, outputImageTokens=$outputImageTokens, outputTextTokens=$outputTextTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" } /** The aggregated embeddings usage details of the specific time bucket. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponse.kt index 04edc654a..6277e308a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponse.kt @@ -1442,9 +1442,18 @@ private constructor( private val apiKeyId: JsonField, private val batch: JsonField, private val inputAudioTokens: JsonField, + private val inputCacheWriteTokens: JsonField, + private val inputCachedAudioTokens: JsonField, + private val inputCachedImageTokens: JsonField, + private val inputCachedTextTokens: JsonField, private val inputCachedTokens: JsonField, + private val inputImageTokens: JsonField, + private val inputTextTokens: JsonField, + private val inputUncachedTokens: JsonField, private val model: JsonField, private val outputAudioTokens: JsonField, + private val outputImageTokens: JsonField, + private val outputTextTokens: JsonField, private val projectId: JsonField, private val serviceTier: JsonField, private val userId: JsonField, @@ -1472,15 +1481,42 @@ private constructor( @JsonProperty("input_audio_tokens") @ExcludeMissing inputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + inputCacheWriteTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + inputCachedAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + inputCachedImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + inputCachedTextTokens: JsonField = JsonMissing.of(), @JsonProperty("input_cached_tokens") @ExcludeMissing inputCachedTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_image_tokens") + @ExcludeMissing + inputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_text_tokens") + @ExcludeMissing + inputTextTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + inputUncachedTokens: JsonField = JsonMissing.of(), @JsonProperty("model") @ExcludeMissing model: JsonField = JsonMissing.of(), @JsonProperty("output_audio_tokens") @ExcludeMissing outputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_image_tokens") + @ExcludeMissing + outputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_text_tokens") + @ExcludeMissing + outputTextTokens: JsonField = JsonMissing.of(), @JsonProperty("project_id") @ExcludeMissing projectId: JsonField = JsonMissing.of(), @@ -1498,9 +1534,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -1508,8 +1553,9 @@ private constructor( ) /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed to + * Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1538,8 +1584,8 @@ private constructor( @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1566,7 +1612,7 @@ private constructor( fun batch(): Optional = batch.getOptional("batch") /** - * The aggregated number of audio input tokens used, including cached tokens. + * The aggregated number of uncached audio input tokens used. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1575,8 +1621,44 @@ private constructor( inputAudioTokens.getOptional("input_audio_tokens") /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens written to the cache. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCacheWriteTokens(): Optional = + inputCacheWriteTokens.getOptional("input_cache_write_tokens") + + /** + * The aggregated number of cached audio input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedAudioTokens(): Optional = + inputCachedAudioTokens.getOptional("input_cached_audio_tokens") + + /** + * The aggregated number of cached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedImageTokens(): Optional = + inputCachedImageTokens.getOptional("input_cached_image_tokens") + + /** + * The aggregated number of cached text input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedTextTokens(): Optional = + inputCachedTextTokens.getOptional("input_cached_text_tokens") + + /** + * The aggregated number of cached input tokens used across text, audio, and image + * inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1584,6 +1666,35 @@ private constructor( fun inputCachedTokens(): Optional = inputCachedTokens.getOptional("input_cached_tokens") + /** + * The aggregated number of uncached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputImageTokens(): Optional = + inputImageTokens.getOptional("input_image_tokens") + + /** + * The aggregated number of uncached text input tokens used, excluding cache-write + * tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputTextTokens(): Optional = + inputTextTokens.getOptional("input_text_tokens") + + /** + * The aggregated number of uncached input tokens used across text, audio, and image + * inputs, excluding cache-write tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputUncachedTokens(): Optional = + inputUncachedTokens.getOptional("input_uncached_tokens") + /** * When `group_by=model`, this field provides the model name of the grouped usage * result. @@ -1602,6 +1713,24 @@ private constructor( fun outputAudioTokens(): Optional = outputAudioTokens.getOptional("output_audio_tokens") + /** + * The aggregated number of image output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputImageTokens(): Optional = + outputImageTokens.getOptional("output_image_tokens") + + /** + * The aggregated number of text output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputTextTokens(): Optional = + outputTextTokens.getOptional("output_text_tokens") + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -1687,6 +1816,46 @@ private constructor( @ExcludeMissing fun _inputAudioTokens(): JsonField = inputAudioTokens + /** + * Returns the raw JSON value of [inputCacheWriteTokens]. + * + * Unlike [inputCacheWriteTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + fun _inputCacheWriteTokens(): JsonField = inputCacheWriteTokens + + /** + * Returns the raw JSON value of [inputCachedAudioTokens]. + * + * Unlike [inputCachedAudioTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + fun _inputCachedAudioTokens(): JsonField = inputCachedAudioTokens + + /** + * Returns the raw JSON value of [inputCachedImageTokens]. + * + * Unlike [inputCachedImageTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + fun _inputCachedImageTokens(): JsonField = inputCachedImageTokens + + /** + * Returns the raw JSON value of [inputCachedTextTokens]. + * + * Unlike [inputCachedTextTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + fun _inputCachedTextTokens(): JsonField = inputCachedTextTokens + /** * Returns the raw JSON value of [inputCachedTokens]. * @@ -1697,6 +1866,36 @@ private constructor( @ExcludeMissing fun _inputCachedTokens(): JsonField = inputCachedTokens + /** + * Returns the raw JSON value of [inputImageTokens]. + * + * Unlike [inputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_image_tokens") + @ExcludeMissing + fun _inputImageTokens(): JsonField = inputImageTokens + + /** + * Returns the raw JSON value of [inputTextTokens]. + * + * Unlike [inputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_text_tokens") + @ExcludeMissing + fun _inputTextTokens(): JsonField = inputTextTokens + + /** + * Returns the raw JSON value of [inputUncachedTokens]. + * + * Unlike [inputUncachedTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + fun _inputUncachedTokens(): JsonField = inputUncachedTokens + /** * Returns the raw JSON value of [model]. * @@ -1715,6 +1914,26 @@ private constructor( @ExcludeMissing fun _outputAudioTokens(): JsonField = outputAudioTokens + /** + * Returns the raw JSON value of [outputImageTokens]. + * + * Unlike [outputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_image_tokens") + @ExcludeMissing + fun _outputImageTokens(): JsonField = outputImageTokens + + /** + * Returns the raw JSON value of [outputTextTokens]. + * + * Unlike [outputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_text_tokens") + @ExcludeMissing + fun _outputTextTokens(): JsonField = outputTextTokens + /** * Returns the raw JSON value of [projectId]. * @@ -1782,9 +2001,18 @@ private constructor( private var apiKeyId: JsonField = JsonMissing.of() private var batch: JsonField = JsonMissing.of() private var inputAudioTokens: JsonField = JsonMissing.of() + private var inputCacheWriteTokens: JsonField = JsonMissing.of() + private var inputCachedAudioTokens: JsonField = JsonMissing.of() + private var inputCachedImageTokens: JsonField = JsonMissing.of() + private var inputCachedTextTokens: JsonField = JsonMissing.of() private var inputCachedTokens: JsonField = JsonMissing.of() + private var inputImageTokens: JsonField = JsonMissing.of() + private var inputTextTokens: JsonField = JsonMissing.of() + private var inputUncachedTokens: JsonField = JsonMissing.of() private var model: JsonField = JsonMissing.of() private var outputAudioTokens: JsonField = JsonMissing.of() + private var outputImageTokens: JsonField = JsonMissing.of() + private var outputTextTokens: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var serviceTier: JsonField = JsonMissing.of() private var userId: JsonField = JsonMissing.of() @@ -1801,9 +2029,22 @@ private constructor( apiKeyId = organizationUsageCompletionsResult.apiKeyId batch = organizationUsageCompletionsResult.batch inputAudioTokens = organizationUsageCompletionsResult.inputAudioTokens + inputCacheWriteTokens = + organizationUsageCompletionsResult.inputCacheWriteTokens + inputCachedAudioTokens = + organizationUsageCompletionsResult.inputCachedAudioTokens + inputCachedImageTokens = + organizationUsageCompletionsResult.inputCachedImageTokens + inputCachedTextTokens = + organizationUsageCompletionsResult.inputCachedTextTokens inputCachedTokens = organizationUsageCompletionsResult.inputCachedTokens + inputImageTokens = organizationUsageCompletionsResult.inputImageTokens + inputTextTokens = organizationUsageCompletionsResult.inputTextTokens + inputUncachedTokens = organizationUsageCompletionsResult.inputUncachedTokens model = organizationUsageCompletionsResult.model outputAudioTokens = organizationUsageCompletionsResult.outputAudioTokens + outputImageTokens = organizationUsageCompletionsResult.outputImageTokens + outputTextTokens = organizationUsageCompletionsResult.outputTextTokens projectId = organizationUsageCompletionsResult.projectId serviceTier = organizationUsageCompletionsResult.serviceTier userId = organizationUsageCompletionsResult.userId @@ -1812,8 +2053,9 @@ private constructor( } /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed + * to Scale Tier, this includes Scale Tier tokens. */ fun inputTokens(inputTokens: Long) = inputTokens(JsonField.of(inputTokens)) @@ -1858,8 +2100,9 @@ private constructor( fun object_(object_: JsonValue) = apply { this.object_ = object_ } /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier + * tokens. */ fun outputTokens(outputTokens: Long) = outputTokens(JsonField.of(outputTokens)) @@ -1917,9 +2160,7 @@ private constructor( */ fun batch(batch: JsonField) = apply { this.batch = batch } - /** - * The aggregated number of audio input tokens used, including cached tokens. - */ + /** The aggregated number of uncached audio input tokens used. */ fun inputAudioTokens(inputAudioTokens: Long) = inputAudioTokens(JsonField.of(inputAudioTokens)) @@ -1934,10 +2175,70 @@ private constructor( this.inputAudioTokens = inputAudioTokens } + /** The aggregated number of input tokens written to the cache. */ + fun inputCacheWriteTokens(inputCacheWriteTokens: Long) = + inputCacheWriteTokens(JsonField.of(inputCacheWriteTokens)) + /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier - * tokens. + * Sets [Builder.inputCacheWriteTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCacheWriteTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCacheWriteTokens(inputCacheWriteTokens: JsonField) = apply { + this.inputCacheWriteTokens = inputCacheWriteTokens + } + + /** The aggregated number of cached audio input tokens used. */ + fun inputCachedAudioTokens(inputCachedAudioTokens: Long) = + inputCachedAudioTokens(JsonField.of(inputCachedAudioTokens)) + + /** + * Sets [Builder.inputCachedAudioTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedAudioTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedAudioTokens(inputCachedAudioTokens: JsonField) = apply { + this.inputCachedAudioTokens = inputCachedAudioTokens + } + + /** The aggregated number of cached image input tokens used. */ + fun inputCachedImageTokens(inputCachedImageTokens: Long) = + inputCachedImageTokens(JsonField.of(inputCachedImageTokens)) + + /** + * Sets [Builder.inputCachedImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedImageTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedImageTokens(inputCachedImageTokens: JsonField) = apply { + this.inputCachedImageTokens = inputCachedImageTokens + } + + /** The aggregated number of cached text input tokens used. */ + fun inputCachedTextTokens(inputCachedTextTokens: Long) = + inputCachedTextTokens(JsonField.of(inputCachedTextTokens)) + + /** + * Sets [Builder.inputCachedTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedTextTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedTextTokens(inputCachedTextTokens: JsonField) = apply { + this.inputCachedTextTokens = inputCachedTextTokens + } + + /** + * The aggregated number of cached input tokens used across text, audio, and + * image inputs. For customers subscribed to Scale Tier, this includes Scale + * Tier tokens. */ fun inputCachedTokens(inputCachedTokens: Long) = inputCachedTokens(JsonField.of(inputCachedTokens)) @@ -1953,6 +2254,57 @@ private constructor( this.inputCachedTokens = inputCachedTokens } + /** The aggregated number of uncached image input tokens used. */ + fun inputImageTokens(inputImageTokens: Long) = + inputImageTokens(JsonField.of(inputImageTokens)) + + /** + * Sets [Builder.inputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputImageTokens(inputImageTokens: JsonField) = apply { + this.inputImageTokens = inputImageTokens + } + + /** + * The aggregated number of uncached text input tokens used, excluding + * cache-write tokens. + */ + fun inputTextTokens(inputTextTokens: Long) = + inputTextTokens(JsonField.of(inputTextTokens)) + + /** + * Sets [Builder.inputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputTextTokens(inputTextTokens: JsonField) = apply { + this.inputTextTokens = inputTextTokens + } + + /** + * The aggregated number of uncached input tokens used across text, audio, and + * image inputs, excluding cache-write tokens. + */ + fun inputUncachedTokens(inputUncachedTokens: Long) = + inputUncachedTokens(JsonField.of(inputUncachedTokens)) + + /** + * Sets [Builder.inputUncachedTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputUncachedTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputUncachedTokens(inputUncachedTokens: JsonField) = apply { + this.inputUncachedTokens = inputUncachedTokens + } + /** * When `group_by=model`, this field provides the model name of the grouped * usage result. @@ -1986,6 +2338,36 @@ private constructor( this.outputAudioTokens = outputAudioTokens } + /** The aggregated number of image output tokens used. */ + fun outputImageTokens(outputImageTokens: Long) = + outputImageTokens(JsonField.of(outputImageTokens)) + + /** + * Sets [Builder.outputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputImageTokens(outputImageTokens: JsonField) = apply { + this.outputImageTokens = outputImageTokens + } + + /** The aggregated number of text output tokens used. */ + fun outputTextTokens(outputTextTokens: Long) = + outputTextTokens(JsonField.of(outputTextTokens)) + + /** + * Sets [Builder.outputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputTextTokens(outputTextTokens: JsonField) = apply { + this.outputTextTokens = outputTextTokens + } + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -2091,9 +2473,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2129,9 +2520,18 @@ private constructor( apiKeyId() batch() inputAudioTokens() + inputCacheWriteTokens() + inputCachedAudioTokens() + inputCachedImageTokens() + inputCachedTextTokens() inputCachedTokens() + inputImageTokens() + inputTextTokens() + inputUncachedTokens() model() outputAudioTokens() + outputImageTokens() + outputTextTokens() projectId() serviceTier() userId() @@ -2164,9 +2564,18 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (batch.asKnown().isPresent) 1 else 0) + (if (inputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCacheWriteTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedTextTokens.asKnown().isPresent) 1 else 0) + (if (inputCachedTokens.asKnown().isPresent) 1 else 0) + + (if (inputImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputTextTokens.asKnown().isPresent) 1 else 0) + + (if (inputUncachedTokens.asKnown().isPresent) 1 else 0) + (if (model.asKnown().isPresent) 1 else 0) + (if (outputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (outputImageTokens.asKnown().isPresent) 1 else 0) + + (if (outputTextTokens.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + (if (serviceTier.asKnown().isPresent) 1 else 0) + (if (userId.asKnown().isPresent) 1 else 0) @@ -2184,9 +2593,18 @@ private constructor( apiKeyId == other.apiKeyId && batch == other.batch && inputAudioTokens == other.inputAudioTokens && + inputCacheWriteTokens == other.inputCacheWriteTokens && + inputCachedAudioTokens == other.inputCachedAudioTokens && + inputCachedImageTokens == other.inputCachedImageTokens && + inputCachedTextTokens == other.inputCachedTextTokens && inputCachedTokens == other.inputCachedTokens && + inputImageTokens == other.inputImageTokens && + inputTextTokens == other.inputTextTokens && + inputUncachedTokens == other.inputUncachedTokens && model == other.model && outputAudioTokens == other.outputAudioTokens && + outputImageTokens == other.outputImageTokens && + outputTextTokens == other.outputTextTokens && projectId == other.projectId && serviceTier == other.serviceTier && userId == other.userId && @@ -2202,9 +2620,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2215,7 +2642,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCachedTokens=$inputCachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" + "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCacheWriteTokens=$inputCacheWriteTokens, inputCachedAudioTokens=$inputCachedAudioTokens, inputCachedImageTokens=$inputCachedImageTokens, inputCachedTextTokens=$inputCachedTextTokens, inputCachedTokens=$inputCachedTokens, inputImageTokens=$inputImageTokens, inputTextTokens=$inputTextTokens, inputUncachedTokens=$inputUncachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, outputImageTokens=$outputImageTokens, outputTextTokens=$outputTextTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" } /** The aggregated embeddings usage details of the specific time bucket. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponse.kt index 5d531f2f2..143b89f2f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponse.kt @@ -1442,9 +1442,18 @@ private constructor( private val apiKeyId: JsonField, private val batch: JsonField, private val inputAudioTokens: JsonField, + private val inputCacheWriteTokens: JsonField, + private val inputCachedAudioTokens: JsonField, + private val inputCachedImageTokens: JsonField, + private val inputCachedTextTokens: JsonField, private val inputCachedTokens: JsonField, + private val inputImageTokens: JsonField, + private val inputTextTokens: JsonField, + private val inputUncachedTokens: JsonField, private val model: JsonField, private val outputAudioTokens: JsonField, + private val outputImageTokens: JsonField, + private val outputTextTokens: JsonField, private val projectId: JsonField, private val serviceTier: JsonField, private val userId: JsonField, @@ -1472,15 +1481,42 @@ private constructor( @JsonProperty("input_audio_tokens") @ExcludeMissing inputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + inputCacheWriteTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + inputCachedAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + inputCachedImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + inputCachedTextTokens: JsonField = JsonMissing.of(), @JsonProperty("input_cached_tokens") @ExcludeMissing inputCachedTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_image_tokens") + @ExcludeMissing + inputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_text_tokens") + @ExcludeMissing + inputTextTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + inputUncachedTokens: JsonField = JsonMissing.of(), @JsonProperty("model") @ExcludeMissing model: JsonField = JsonMissing.of(), @JsonProperty("output_audio_tokens") @ExcludeMissing outputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_image_tokens") + @ExcludeMissing + outputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_text_tokens") + @ExcludeMissing + outputTextTokens: JsonField = JsonMissing.of(), @JsonProperty("project_id") @ExcludeMissing projectId: JsonField = JsonMissing.of(), @@ -1498,9 +1534,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -1508,8 +1553,9 @@ private constructor( ) /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed to + * Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1538,8 +1584,8 @@ private constructor( @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1566,7 +1612,7 @@ private constructor( fun batch(): Optional = batch.getOptional("batch") /** - * The aggregated number of audio input tokens used, including cached tokens. + * The aggregated number of uncached audio input tokens used. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1575,8 +1621,44 @@ private constructor( inputAudioTokens.getOptional("input_audio_tokens") /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens written to the cache. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCacheWriteTokens(): Optional = + inputCacheWriteTokens.getOptional("input_cache_write_tokens") + + /** + * The aggregated number of cached audio input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedAudioTokens(): Optional = + inputCachedAudioTokens.getOptional("input_cached_audio_tokens") + + /** + * The aggregated number of cached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedImageTokens(): Optional = + inputCachedImageTokens.getOptional("input_cached_image_tokens") + + /** + * The aggregated number of cached text input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedTextTokens(): Optional = + inputCachedTextTokens.getOptional("input_cached_text_tokens") + + /** + * The aggregated number of cached input tokens used across text, audio, and image + * inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1584,6 +1666,35 @@ private constructor( fun inputCachedTokens(): Optional = inputCachedTokens.getOptional("input_cached_tokens") + /** + * The aggregated number of uncached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputImageTokens(): Optional = + inputImageTokens.getOptional("input_image_tokens") + + /** + * The aggregated number of uncached text input tokens used, excluding cache-write + * tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputTextTokens(): Optional = + inputTextTokens.getOptional("input_text_tokens") + + /** + * The aggregated number of uncached input tokens used across text, audio, and image + * inputs, excluding cache-write tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputUncachedTokens(): Optional = + inputUncachedTokens.getOptional("input_uncached_tokens") + /** * When `group_by=model`, this field provides the model name of the grouped usage * result. @@ -1602,6 +1713,24 @@ private constructor( fun outputAudioTokens(): Optional = outputAudioTokens.getOptional("output_audio_tokens") + /** + * The aggregated number of image output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputImageTokens(): Optional = + outputImageTokens.getOptional("output_image_tokens") + + /** + * The aggregated number of text output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputTextTokens(): Optional = + outputTextTokens.getOptional("output_text_tokens") + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -1687,6 +1816,46 @@ private constructor( @ExcludeMissing fun _inputAudioTokens(): JsonField = inputAudioTokens + /** + * Returns the raw JSON value of [inputCacheWriteTokens]. + * + * Unlike [inputCacheWriteTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + fun _inputCacheWriteTokens(): JsonField = inputCacheWriteTokens + + /** + * Returns the raw JSON value of [inputCachedAudioTokens]. + * + * Unlike [inputCachedAudioTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + fun _inputCachedAudioTokens(): JsonField = inputCachedAudioTokens + + /** + * Returns the raw JSON value of [inputCachedImageTokens]. + * + * Unlike [inputCachedImageTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + fun _inputCachedImageTokens(): JsonField = inputCachedImageTokens + + /** + * Returns the raw JSON value of [inputCachedTextTokens]. + * + * Unlike [inputCachedTextTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + fun _inputCachedTextTokens(): JsonField = inputCachedTextTokens + /** * Returns the raw JSON value of [inputCachedTokens]. * @@ -1697,6 +1866,36 @@ private constructor( @ExcludeMissing fun _inputCachedTokens(): JsonField = inputCachedTokens + /** + * Returns the raw JSON value of [inputImageTokens]. + * + * Unlike [inputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_image_tokens") + @ExcludeMissing + fun _inputImageTokens(): JsonField = inputImageTokens + + /** + * Returns the raw JSON value of [inputTextTokens]. + * + * Unlike [inputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_text_tokens") + @ExcludeMissing + fun _inputTextTokens(): JsonField = inputTextTokens + + /** + * Returns the raw JSON value of [inputUncachedTokens]. + * + * Unlike [inputUncachedTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + fun _inputUncachedTokens(): JsonField = inputUncachedTokens + /** * Returns the raw JSON value of [model]. * @@ -1715,6 +1914,26 @@ private constructor( @ExcludeMissing fun _outputAudioTokens(): JsonField = outputAudioTokens + /** + * Returns the raw JSON value of [outputImageTokens]. + * + * Unlike [outputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_image_tokens") + @ExcludeMissing + fun _outputImageTokens(): JsonField = outputImageTokens + + /** + * Returns the raw JSON value of [outputTextTokens]. + * + * Unlike [outputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_text_tokens") + @ExcludeMissing + fun _outputTextTokens(): JsonField = outputTextTokens + /** * Returns the raw JSON value of [projectId]. * @@ -1782,9 +2001,18 @@ private constructor( private var apiKeyId: JsonField = JsonMissing.of() private var batch: JsonField = JsonMissing.of() private var inputAudioTokens: JsonField = JsonMissing.of() + private var inputCacheWriteTokens: JsonField = JsonMissing.of() + private var inputCachedAudioTokens: JsonField = JsonMissing.of() + private var inputCachedImageTokens: JsonField = JsonMissing.of() + private var inputCachedTextTokens: JsonField = JsonMissing.of() private var inputCachedTokens: JsonField = JsonMissing.of() + private var inputImageTokens: JsonField = JsonMissing.of() + private var inputTextTokens: JsonField = JsonMissing.of() + private var inputUncachedTokens: JsonField = JsonMissing.of() private var model: JsonField = JsonMissing.of() private var outputAudioTokens: JsonField = JsonMissing.of() + private var outputImageTokens: JsonField = JsonMissing.of() + private var outputTextTokens: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var serviceTier: JsonField = JsonMissing.of() private var userId: JsonField = JsonMissing.of() @@ -1801,9 +2029,22 @@ private constructor( apiKeyId = organizationUsageCompletionsResult.apiKeyId batch = organizationUsageCompletionsResult.batch inputAudioTokens = organizationUsageCompletionsResult.inputAudioTokens + inputCacheWriteTokens = + organizationUsageCompletionsResult.inputCacheWriteTokens + inputCachedAudioTokens = + organizationUsageCompletionsResult.inputCachedAudioTokens + inputCachedImageTokens = + organizationUsageCompletionsResult.inputCachedImageTokens + inputCachedTextTokens = + organizationUsageCompletionsResult.inputCachedTextTokens inputCachedTokens = organizationUsageCompletionsResult.inputCachedTokens + inputImageTokens = organizationUsageCompletionsResult.inputImageTokens + inputTextTokens = organizationUsageCompletionsResult.inputTextTokens + inputUncachedTokens = organizationUsageCompletionsResult.inputUncachedTokens model = organizationUsageCompletionsResult.model outputAudioTokens = organizationUsageCompletionsResult.outputAudioTokens + outputImageTokens = organizationUsageCompletionsResult.outputImageTokens + outputTextTokens = organizationUsageCompletionsResult.outputTextTokens projectId = organizationUsageCompletionsResult.projectId serviceTier = organizationUsageCompletionsResult.serviceTier userId = organizationUsageCompletionsResult.userId @@ -1812,8 +2053,9 @@ private constructor( } /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed + * to Scale Tier, this includes Scale Tier tokens. */ fun inputTokens(inputTokens: Long) = inputTokens(JsonField.of(inputTokens)) @@ -1858,8 +2100,9 @@ private constructor( fun object_(object_: JsonValue) = apply { this.object_ = object_ } /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier + * tokens. */ fun outputTokens(outputTokens: Long) = outputTokens(JsonField.of(outputTokens)) @@ -1917,9 +2160,7 @@ private constructor( */ fun batch(batch: JsonField) = apply { this.batch = batch } - /** - * The aggregated number of audio input tokens used, including cached tokens. - */ + /** The aggregated number of uncached audio input tokens used. */ fun inputAudioTokens(inputAudioTokens: Long) = inputAudioTokens(JsonField.of(inputAudioTokens)) @@ -1934,10 +2175,70 @@ private constructor( this.inputAudioTokens = inputAudioTokens } + /** The aggregated number of input tokens written to the cache. */ + fun inputCacheWriteTokens(inputCacheWriteTokens: Long) = + inputCacheWriteTokens(JsonField.of(inputCacheWriteTokens)) + /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier - * tokens. + * Sets [Builder.inputCacheWriteTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCacheWriteTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCacheWriteTokens(inputCacheWriteTokens: JsonField) = apply { + this.inputCacheWriteTokens = inputCacheWriteTokens + } + + /** The aggregated number of cached audio input tokens used. */ + fun inputCachedAudioTokens(inputCachedAudioTokens: Long) = + inputCachedAudioTokens(JsonField.of(inputCachedAudioTokens)) + + /** + * Sets [Builder.inputCachedAudioTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedAudioTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedAudioTokens(inputCachedAudioTokens: JsonField) = apply { + this.inputCachedAudioTokens = inputCachedAudioTokens + } + + /** The aggregated number of cached image input tokens used. */ + fun inputCachedImageTokens(inputCachedImageTokens: Long) = + inputCachedImageTokens(JsonField.of(inputCachedImageTokens)) + + /** + * Sets [Builder.inputCachedImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedImageTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedImageTokens(inputCachedImageTokens: JsonField) = apply { + this.inputCachedImageTokens = inputCachedImageTokens + } + + /** The aggregated number of cached text input tokens used. */ + fun inputCachedTextTokens(inputCachedTextTokens: Long) = + inputCachedTextTokens(JsonField.of(inputCachedTextTokens)) + + /** + * Sets [Builder.inputCachedTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedTextTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedTextTokens(inputCachedTextTokens: JsonField) = apply { + this.inputCachedTextTokens = inputCachedTextTokens + } + + /** + * The aggregated number of cached input tokens used across text, audio, and + * image inputs. For customers subscribed to Scale Tier, this includes Scale + * Tier tokens. */ fun inputCachedTokens(inputCachedTokens: Long) = inputCachedTokens(JsonField.of(inputCachedTokens)) @@ -1953,6 +2254,57 @@ private constructor( this.inputCachedTokens = inputCachedTokens } + /** The aggregated number of uncached image input tokens used. */ + fun inputImageTokens(inputImageTokens: Long) = + inputImageTokens(JsonField.of(inputImageTokens)) + + /** + * Sets [Builder.inputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputImageTokens(inputImageTokens: JsonField) = apply { + this.inputImageTokens = inputImageTokens + } + + /** + * The aggregated number of uncached text input tokens used, excluding + * cache-write tokens. + */ + fun inputTextTokens(inputTextTokens: Long) = + inputTextTokens(JsonField.of(inputTextTokens)) + + /** + * Sets [Builder.inputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputTextTokens(inputTextTokens: JsonField) = apply { + this.inputTextTokens = inputTextTokens + } + + /** + * The aggregated number of uncached input tokens used across text, audio, and + * image inputs, excluding cache-write tokens. + */ + fun inputUncachedTokens(inputUncachedTokens: Long) = + inputUncachedTokens(JsonField.of(inputUncachedTokens)) + + /** + * Sets [Builder.inputUncachedTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputUncachedTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputUncachedTokens(inputUncachedTokens: JsonField) = apply { + this.inputUncachedTokens = inputUncachedTokens + } + /** * When `group_by=model`, this field provides the model name of the grouped * usage result. @@ -1986,6 +2338,36 @@ private constructor( this.outputAudioTokens = outputAudioTokens } + /** The aggregated number of image output tokens used. */ + fun outputImageTokens(outputImageTokens: Long) = + outputImageTokens(JsonField.of(outputImageTokens)) + + /** + * Sets [Builder.outputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputImageTokens(outputImageTokens: JsonField) = apply { + this.outputImageTokens = outputImageTokens + } + + /** The aggregated number of text output tokens used. */ + fun outputTextTokens(outputTextTokens: Long) = + outputTextTokens(JsonField.of(outputTextTokens)) + + /** + * Sets [Builder.outputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputTextTokens(outputTextTokens: JsonField) = apply { + this.outputTextTokens = outputTextTokens + } + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -2091,9 +2473,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2129,9 +2520,18 @@ private constructor( apiKeyId() batch() inputAudioTokens() + inputCacheWriteTokens() + inputCachedAudioTokens() + inputCachedImageTokens() + inputCachedTextTokens() inputCachedTokens() + inputImageTokens() + inputTextTokens() + inputUncachedTokens() model() outputAudioTokens() + outputImageTokens() + outputTextTokens() projectId() serviceTier() userId() @@ -2164,9 +2564,18 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (batch.asKnown().isPresent) 1 else 0) + (if (inputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCacheWriteTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedTextTokens.asKnown().isPresent) 1 else 0) + (if (inputCachedTokens.asKnown().isPresent) 1 else 0) + + (if (inputImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputTextTokens.asKnown().isPresent) 1 else 0) + + (if (inputUncachedTokens.asKnown().isPresent) 1 else 0) + (if (model.asKnown().isPresent) 1 else 0) + (if (outputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (outputImageTokens.asKnown().isPresent) 1 else 0) + + (if (outputTextTokens.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + (if (serviceTier.asKnown().isPresent) 1 else 0) + (if (userId.asKnown().isPresent) 1 else 0) @@ -2184,9 +2593,18 @@ private constructor( apiKeyId == other.apiKeyId && batch == other.batch && inputAudioTokens == other.inputAudioTokens && + inputCacheWriteTokens == other.inputCacheWriteTokens && + inputCachedAudioTokens == other.inputCachedAudioTokens && + inputCachedImageTokens == other.inputCachedImageTokens && + inputCachedTextTokens == other.inputCachedTextTokens && inputCachedTokens == other.inputCachedTokens && + inputImageTokens == other.inputImageTokens && + inputTextTokens == other.inputTextTokens && + inputUncachedTokens == other.inputUncachedTokens && model == other.model && outputAudioTokens == other.outputAudioTokens && + outputImageTokens == other.outputImageTokens && + outputTextTokens == other.outputTextTokens && projectId == other.projectId && serviceTier == other.serviceTier && userId == other.userId && @@ -2202,9 +2620,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2215,7 +2642,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCachedTokens=$inputCachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" + "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCacheWriteTokens=$inputCacheWriteTokens, inputCachedAudioTokens=$inputCachedAudioTokens, inputCachedImageTokens=$inputCachedImageTokens, inputCachedTextTokens=$inputCachedTextTokens, inputCachedTokens=$inputCachedTokens, inputImageTokens=$inputImageTokens, inputTextTokens=$inputTextTokens, inputUncachedTokens=$inputUncachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, outputImageTokens=$outputImageTokens, outputTextTokens=$outputTextTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" } /** The aggregated embeddings usage details of the specific time bucket. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponse.kt index 5854221b3..0d5dce938 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponse.kt @@ -1442,9 +1442,18 @@ private constructor( private val apiKeyId: JsonField, private val batch: JsonField, private val inputAudioTokens: JsonField, + private val inputCacheWriteTokens: JsonField, + private val inputCachedAudioTokens: JsonField, + private val inputCachedImageTokens: JsonField, + private val inputCachedTextTokens: JsonField, private val inputCachedTokens: JsonField, + private val inputImageTokens: JsonField, + private val inputTextTokens: JsonField, + private val inputUncachedTokens: JsonField, private val model: JsonField, private val outputAudioTokens: JsonField, + private val outputImageTokens: JsonField, + private val outputTextTokens: JsonField, private val projectId: JsonField, private val serviceTier: JsonField, private val userId: JsonField, @@ -1472,15 +1481,42 @@ private constructor( @JsonProperty("input_audio_tokens") @ExcludeMissing inputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + inputCacheWriteTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + inputCachedAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + inputCachedImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + inputCachedTextTokens: JsonField = JsonMissing.of(), @JsonProperty("input_cached_tokens") @ExcludeMissing inputCachedTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_image_tokens") + @ExcludeMissing + inputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_text_tokens") + @ExcludeMissing + inputTextTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + inputUncachedTokens: JsonField = JsonMissing.of(), @JsonProperty("model") @ExcludeMissing model: JsonField = JsonMissing.of(), @JsonProperty("output_audio_tokens") @ExcludeMissing outputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_image_tokens") + @ExcludeMissing + outputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_text_tokens") + @ExcludeMissing + outputTextTokens: JsonField = JsonMissing.of(), @JsonProperty("project_id") @ExcludeMissing projectId: JsonField = JsonMissing.of(), @@ -1498,9 +1534,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -1508,8 +1553,9 @@ private constructor( ) /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed to + * Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1538,8 +1584,8 @@ private constructor( @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1566,7 +1612,7 @@ private constructor( fun batch(): Optional = batch.getOptional("batch") /** - * The aggregated number of audio input tokens used, including cached tokens. + * The aggregated number of uncached audio input tokens used. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1575,8 +1621,44 @@ private constructor( inputAudioTokens.getOptional("input_audio_tokens") /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens written to the cache. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCacheWriteTokens(): Optional = + inputCacheWriteTokens.getOptional("input_cache_write_tokens") + + /** + * The aggregated number of cached audio input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedAudioTokens(): Optional = + inputCachedAudioTokens.getOptional("input_cached_audio_tokens") + + /** + * The aggregated number of cached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedImageTokens(): Optional = + inputCachedImageTokens.getOptional("input_cached_image_tokens") + + /** + * The aggregated number of cached text input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedTextTokens(): Optional = + inputCachedTextTokens.getOptional("input_cached_text_tokens") + + /** + * The aggregated number of cached input tokens used across text, audio, and image + * inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1584,6 +1666,35 @@ private constructor( fun inputCachedTokens(): Optional = inputCachedTokens.getOptional("input_cached_tokens") + /** + * The aggregated number of uncached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputImageTokens(): Optional = + inputImageTokens.getOptional("input_image_tokens") + + /** + * The aggregated number of uncached text input tokens used, excluding cache-write + * tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputTextTokens(): Optional = + inputTextTokens.getOptional("input_text_tokens") + + /** + * The aggregated number of uncached input tokens used across text, audio, and image + * inputs, excluding cache-write tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputUncachedTokens(): Optional = + inputUncachedTokens.getOptional("input_uncached_tokens") + /** * When `group_by=model`, this field provides the model name of the grouped usage * result. @@ -1602,6 +1713,24 @@ private constructor( fun outputAudioTokens(): Optional = outputAudioTokens.getOptional("output_audio_tokens") + /** + * The aggregated number of image output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputImageTokens(): Optional = + outputImageTokens.getOptional("output_image_tokens") + + /** + * The aggregated number of text output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputTextTokens(): Optional = + outputTextTokens.getOptional("output_text_tokens") + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -1687,6 +1816,46 @@ private constructor( @ExcludeMissing fun _inputAudioTokens(): JsonField = inputAudioTokens + /** + * Returns the raw JSON value of [inputCacheWriteTokens]. + * + * Unlike [inputCacheWriteTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + fun _inputCacheWriteTokens(): JsonField = inputCacheWriteTokens + + /** + * Returns the raw JSON value of [inputCachedAudioTokens]. + * + * Unlike [inputCachedAudioTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + fun _inputCachedAudioTokens(): JsonField = inputCachedAudioTokens + + /** + * Returns the raw JSON value of [inputCachedImageTokens]. + * + * Unlike [inputCachedImageTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + fun _inputCachedImageTokens(): JsonField = inputCachedImageTokens + + /** + * Returns the raw JSON value of [inputCachedTextTokens]. + * + * Unlike [inputCachedTextTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + fun _inputCachedTextTokens(): JsonField = inputCachedTextTokens + /** * Returns the raw JSON value of [inputCachedTokens]. * @@ -1697,6 +1866,36 @@ private constructor( @ExcludeMissing fun _inputCachedTokens(): JsonField = inputCachedTokens + /** + * Returns the raw JSON value of [inputImageTokens]. + * + * Unlike [inputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_image_tokens") + @ExcludeMissing + fun _inputImageTokens(): JsonField = inputImageTokens + + /** + * Returns the raw JSON value of [inputTextTokens]. + * + * Unlike [inputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_text_tokens") + @ExcludeMissing + fun _inputTextTokens(): JsonField = inputTextTokens + + /** + * Returns the raw JSON value of [inputUncachedTokens]. + * + * Unlike [inputUncachedTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + fun _inputUncachedTokens(): JsonField = inputUncachedTokens + /** * Returns the raw JSON value of [model]. * @@ -1715,6 +1914,26 @@ private constructor( @ExcludeMissing fun _outputAudioTokens(): JsonField = outputAudioTokens + /** + * Returns the raw JSON value of [outputImageTokens]. + * + * Unlike [outputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_image_tokens") + @ExcludeMissing + fun _outputImageTokens(): JsonField = outputImageTokens + + /** + * Returns the raw JSON value of [outputTextTokens]. + * + * Unlike [outputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_text_tokens") + @ExcludeMissing + fun _outputTextTokens(): JsonField = outputTextTokens + /** * Returns the raw JSON value of [projectId]. * @@ -1782,9 +2001,18 @@ private constructor( private var apiKeyId: JsonField = JsonMissing.of() private var batch: JsonField = JsonMissing.of() private var inputAudioTokens: JsonField = JsonMissing.of() + private var inputCacheWriteTokens: JsonField = JsonMissing.of() + private var inputCachedAudioTokens: JsonField = JsonMissing.of() + private var inputCachedImageTokens: JsonField = JsonMissing.of() + private var inputCachedTextTokens: JsonField = JsonMissing.of() private var inputCachedTokens: JsonField = JsonMissing.of() + private var inputImageTokens: JsonField = JsonMissing.of() + private var inputTextTokens: JsonField = JsonMissing.of() + private var inputUncachedTokens: JsonField = JsonMissing.of() private var model: JsonField = JsonMissing.of() private var outputAudioTokens: JsonField = JsonMissing.of() + private var outputImageTokens: JsonField = JsonMissing.of() + private var outputTextTokens: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var serviceTier: JsonField = JsonMissing.of() private var userId: JsonField = JsonMissing.of() @@ -1801,9 +2029,22 @@ private constructor( apiKeyId = organizationUsageCompletionsResult.apiKeyId batch = organizationUsageCompletionsResult.batch inputAudioTokens = organizationUsageCompletionsResult.inputAudioTokens + inputCacheWriteTokens = + organizationUsageCompletionsResult.inputCacheWriteTokens + inputCachedAudioTokens = + organizationUsageCompletionsResult.inputCachedAudioTokens + inputCachedImageTokens = + organizationUsageCompletionsResult.inputCachedImageTokens + inputCachedTextTokens = + organizationUsageCompletionsResult.inputCachedTextTokens inputCachedTokens = organizationUsageCompletionsResult.inputCachedTokens + inputImageTokens = organizationUsageCompletionsResult.inputImageTokens + inputTextTokens = organizationUsageCompletionsResult.inputTextTokens + inputUncachedTokens = organizationUsageCompletionsResult.inputUncachedTokens model = organizationUsageCompletionsResult.model outputAudioTokens = organizationUsageCompletionsResult.outputAudioTokens + outputImageTokens = organizationUsageCompletionsResult.outputImageTokens + outputTextTokens = organizationUsageCompletionsResult.outputTextTokens projectId = organizationUsageCompletionsResult.projectId serviceTier = organizationUsageCompletionsResult.serviceTier userId = organizationUsageCompletionsResult.userId @@ -1812,8 +2053,9 @@ private constructor( } /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed + * to Scale Tier, this includes Scale Tier tokens. */ fun inputTokens(inputTokens: Long) = inputTokens(JsonField.of(inputTokens)) @@ -1858,8 +2100,9 @@ private constructor( fun object_(object_: JsonValue) = apply { this.object_ = object_ } /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier + * tokens. */ fun outputTokens(outputTokens: Long) = outputTokens(JsonField.of(outputTokens)) @@ -1917,9 +2160,7 @@ private constructor( */ fun batch(batch: JsonField) = apply { this.batch = batch } - /** - * The aggregated number of audio input tokens used, including cached tokens. - */ + /** The aggregated number of uncached audio input tokens used. */ fun inputAudioTokens(inputAudioTokens: Long) = inputAudioTokens(JsonField.of(inputAudioTokens)) @@ -1934,10 +2175,70 @@ private constructor( this.inputAudioTokens = inputAudioTokens } + /** The aggregated number of input tokens written to the cache. */ + fun inputCacheWriteTokens(inputCacheWriteTokens: Long) = + inputCacheWriteTokens(JsonField.of(inputCacheWriteTokens)) + /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier - * tokens. + * Sets [Builder.inputCacheWriteTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCacheWriteTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCacheWriteTokens(inputCacheWriteTokens: JsonField) = apply { + this.inputCacheWriteTokens = inputCacheWriteTokens + } + + /** The aggregated number of cached audio input tokens used. */ + fun inputCachedAudioTokens(inputCachedAudioTokens: Long) = + inputCachedAudioTokens(JsonField.of(inputCachedAudioTokens)) + + /** + * Sets [Builder.inputCachedAudioTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedAudioTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedAudioTokens(inputCachedAudioTokens: JsonField) = apply { + this.inputCachedAudioTokens = inputCachedAudioTokens + } + + /** The aggregated number of cached image input tokens used. */ + fun inputCachedImageTokens(inputCachedImageTokens: Long) = + inputCachedImageTokens(JsonField.of(inputCachedImageTokens)) + + /** + * Sets [Builder.inputCachedImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedImageTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedImageTokens(inputCachedImageTokens: JsonField) = apply { + this.inputCachedImageTokens = inputCachedImageTokens + } + + /** The aggregated number of cached text input tokens used. */ + fun inputCachedTextTokens(inputCachedTextTokens: Long) = + inputCachedTextTokens(JsonField.of(inputCachedTextTokens)) + + /** + * Sets [Builder.inputCachedTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedTextTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedTextTokens(inputCachedTextTokens: JsonField) = apply { + this.inputCachedTextTokens = inputCachedTextTokens + } + + /** + * The aggregated number of cached input tokens used across text, audio, and + * image inputs. For customers subscribed to Scale Tier, this includes Scale + * Tier tokens. */ fun inputCachedTokens(inputCachedTokens: Long) = inputCachedTokens(JsonField.of(inputCachedTokens)) @@ -1953,6 +2254,57 @@ private constructor( this.inputCachedTokens = inputCachedTokens } + /** The aggregated number of uncached image input tokens used. */ + fun inputImageTokens(inputImageTokens: Long) = + inputImageTokens(JsonField.of(inputImageTokens)) + + /** + * Sets [Builder.inputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputImageTokens(inputImageTokens: JsonField) = apply { + this.inputImageTokens = inputImageTokens + } + + /** + * The aggregated number of uncached text input tokens used, excluding + * cache-write tokens. + */ + fun inputTextTokens(inputTextTokens: Long) = + inputTextTokens(JsonField.of(inputTextTokens)) + + /** + * Sets [Builder.inputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputTextTokens(inputTextTokens: JsonField) = apply { + this.inputTextTokens = inputTextTokens + } + + /** + * The aggregated number of uncached input tokens used across text, audio, and + * image inputs, excluding cache-write tokens. + */ + fun inputUncachedTokens(inputUncachedTokens: Long) = + inputUncachedTokens(JsonField.of(inputUncachedTokens)) + + /** + * Sets [Builder.inputUncachedTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputUncachedTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputUncachedTokens(inputUncachedTokens: JsonField) = apply { + this.inputUncachedTokens = inputUncachedTokens + } + /** * When `group_by=model`, this field provides the model name of the grouped * usage result. @@ -1986,6 +2338,36 @@ private constructor( this.outputAudioTokens = outputAudioTokens } + /** The aggregated number of image output tokens used. */ + fun outputImageTokens(outputImageTokens: Long) = + outputImageTokens(JsonField.of(outputImageTokens)) + + /** + * Sets [Builder.outputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputImageTokens(outputImageTokens: JsonField) = apply { + this.outputImageTokens = outputImageTokens + } + + /** The aggregated number of text output tokens used. */ + fun outputTextTokens(outputTextTokens: Long) = + outputTextTokens(JsonField.of(outputTextTokens)) + + /** + * Sets [Builder.outputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputTextTokens(outputTextTokens: JsonField) = apply { + this.outputTextTokens = outputTextTokens + } + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -2091,9 +2473,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2129,9 +2520,18 @@ private constructor( apiKeyId() batch() inputAudioTokens() + inputCacheWriteTokens() + inputCachedAudioTokens() + inputCachedImageTokens() + inputCachedTextTokens() inputCachedTokens() + inputImageTokens() + inputTextTokens() + inputUncachedTokens() model() outputAudioTokens() + outputImageTokens() + outputTextTokens() projectId() serviceTier() userId() @@ -2164,9 +2564,18 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (batch.asKnown().isPresent) 1 else 0) + (if (inputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCacheWriteTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedTextTokens.asKnown().isPresent) 1 else 0) + (if (inputCachedTokens.asKnown().isPresent) 1 else 0) + + (if (inputImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputTextTokens.asKnown().isPresent) 1 else 0) + + (if (inputUncachedTokens.asKnown().isPresent) 1 else 0) + (if (model.asKnown().isPresent) 1 else 0) + (if (outputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (outputImageTokens.asKnown().isPresent) 1 else 0) + + (if (outputTextTokens.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + (if (serviceTier.asKnown().isPresent) 1 else 0) + (if (userId.asKnown().isPresent) 1 else 0) @@ -2184,9 +2593,18 @@ private constructor( apiKeyId == other.apiKeyId && batch == other.batch && inputAudioTokens == other.inputAudioTokens && + inputCacheWriteTokens == other.inputCacheWriteTokens && + inputCachedAudioTokens == other.inputCachedAudioTokens && + inputCachedImageTokens == other.inputCachedImageTokens && + inputCachedTextTokens == other.inputCachedTextTokens && inputCachedTokens == other.inputCachedTokens && + inputImageTokens == other.inputImageTokens && + inputTextTokens == other.inputTextTokens && + inputUncachedTokens == other.inputUncachedTokens && model == other.model && outputAudioTokens == other.outputAudioTokens && + outputImageTokens == other.outputImageTokens && + outputTextTokens == other.outputTextTokens && projectId == other.projectId && serviceTier == other.serviceTier && userId == other.userId && @@ -2202,9 +2620,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2215,7 +2642,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCachedTokens=$inputCachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" + "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCacheWriteTokens=$inputCacheWriteTokens, inputCachedAudioTokens=$inputCachedAudioTokens, inputCachedImageTokens=$inputCachedImageTokens, inputCachedTextTokens=$inputCachedTextTokens, inputCachedTokens=$inputCachedTokens, inputImageTokens=$inputImageTokens, inputTextTokens=$inputTextTokens, inputUncachedTokens=$inputUncachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, outputImageTokens=$outputImageTokens, outputTextTokens=$outputTextTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" } /** The aggregated embeddings usage details of the specific time bucket. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponse.kt index 4917b040a..eb8a59a8d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponse.kt @@ -1442,9 +1442,18 @@ private constructor( private val apiKeyId: JsonField, private val batch: JsonField, private val inputAudioTokens: JsonField, + private val inputCacheWriteTokens: JsonField, + private val inputCachedAudioTokens: JsonField, + private val inputCachedImageTokens: JsonField, + private val inputCachedTextTokens: JsonField, private val inputCachedTokens: JsonField, + private val inputImageTokens: JsonField, + private val inputTextTokens: JsonField, + private val inputUncachedTokens: JsonField, private val model: JsonField, private val outputAudioTokens: JsonField, + private val outputImageTokens: JsonField, + private val outputTextTokens: JsonField, private val projectId: JsonField, private val serviceTier: JsonField, private val userId: JsonField, @@ -1472,15 +1481,42 @@ private constructor( @JsonProperty("input_audio_tokens") @ExcludeMissing inputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + inputCacheWriteTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + inputCachedAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + inputCachedImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + inputCachedTextTokens: JsonField = JsonMissing.of(), @JsonProperty("input_cached_tokens") @ExcludeMissing inputCachedTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_image_tokens") + @ExcludeMissing + inputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_text_tokens") + @ExcludeMissing + inputTextTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + inputUncachedTokens: JsonField = JsonMissing.of(), @JsonProperty("model") @ExcludeMissing model: JsonField = JsonMissing.of(), @JsonProperty("output_audio_tokens") @ExcludeMissing outputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_image_tokens") + @ExcludeMissing + outputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_text_tokens") + @ExcludeMissing + outputTextTokens: JsonField = JsonMissing.of(), @JsonProperty("project_id") @ExcludeMissing projectId: JsonField = JsonMissing.of(), @@ -1498,9 +1534,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -1508,8 +1553,9 @@ private constructor( ) /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed to + * Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1538,8 +1584,8 @@ private constructor( @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1566,7 +1612,7 @@ private constructor( fun batch(): Optional = batch.getOptional("batch") /** - * The aggregated number of audio input tokens used, including cached tokens. + * The aggregated number of uncached audio input tokens used. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1575,8 +1621,44 @@ private constructor( inputAudioTokens.getOptional("input_audio_tokens") /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens written to the cache. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCacheWriteTokens(): Optional = + inputCacheWriteTokens.getOptional("input_cache_write_tokens") + + /** + * The aggregated number of cached audio input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedAudioTokens(): Optional = + inputCachedAudioTokens.getOptional("input_cached_audio_tokens") + + /** + * The aggregated number of cached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedImageTokens(): Optional = + inputCachedImageTokens.getOptional("input_cached_image_tokens") + + /** + * The aggregated number of cached text input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedTextTokens(): Optional = + inputCachedTextTokens.getOptional("input_cached_text_tokens") + + /** + * The aggregated number of cached input tokens used across text, audio, and image + * inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1584,6 +1666,35 @@ private constructor( fun inputCachedTokens(): Optional = inputCachedTokens.getOptional("input_cached_tokens") + /** + * The aggregated number of uncached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputImageTokens(): Optional = + inputImageTokens.getOptional("input_image_tokens") + + /** + * The aggregated number of uncached text input tokens used, excluding cache-write + * tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputTextTokens(): Optional = + inputTextTokens.getOptional("input_text_tokens") + + /** + * The aggregated number of uncached input tokens used across text, audio, and image + * inputs, excluding cache-write tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputUncachedTokens(): Optional = + inputUncachedTokens.getOptional("input_uncached_tokens") + /** * When `group_by=model`, this field provides the model name of the grouped usage * result. @@ -1602,6 +1713,24 @@ private constructor( fun outputAudioTokens(): Optional = outputAudioTokens.getOptional("output_audio_tokens") + /** + * The aggregated number of image output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputImageTokens(): Optional = + outputImageTokens.getOptional("output_image_tokens") + + /** + * The aggregated number of text output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputTextTokens(): Optional = + outputTextTokens.getOptional("output_text_tokens") + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -1687,6 +1816,46 @@ private constructor( @ExcludeMissing fun _inputAudioTokens(): JsonField = inputAudioTokens + /** + * Returns the raw JSON value of [inputCacheWriteTokens]. + * + * Unlike [inputCacheWriteTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + fun _inputCacheWriteTokens(): JsonField = inputCacheWriteTokens + + /** + * Returns the raw JSON value of [inputCachedAudioTokens]. + * + * Unlike [inputCachedAudioTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + fun _inputCachedAudioTokens(): JsonField = inputCachedAudioTokens + + /** + * Returns the raw JSON value of [inputCachedImageTokens]. + * + * Unlike [inputCachedImageTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + fun _inputCachedImageTokens(): JsonField = inputCachedImageTokens + + /** + * Returns the raw JSON value of [inputCachedTextTokens]. + * + * Unlike [inputCachedTextTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + fun _inputCachedTextTokens(): JsonField = inputCachedTextTokens + /** * Returns the raw JSON value of [inputCachedTokens]. * @@ -1697,6 +1866,36 @@ private constructor( @ExcludeMissing fun _inputCachedTokens(): JsonField = inputCachedTokens + /** + * Returns the raw JSON value of [inputImageTokens]. + * + * Unlike [inputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_image_tokens") + @ExcludeMissing + fun _inputImageTokens(): JsonField = inputImageTokens + + /** + * Returns the raw JSON value of [inputTextTokens]. + * + * Unlike [inputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_text_tokens") + @ExcludeMissing + fun _inputTextTokens(): JsonField = inputTextTokens + + /** + * Returns the raw JSON value of [inputUncachedTokens]. + * + * Unlike [inputUncachedTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + fun _inputUncachedTokens(): JsonField = inputUncachedTokens + /** * Returns the raw JSON value of [model]. * @@ -1715,6 +1914,26 @@ private constructor( @ExcludeMissing fun _outputAudioTokens(): JsonField = outputAudioTokens + /** + * Returns the raw JSON value of [outputImageTokens]. + * + * Unlike [outputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_image_tokens") + @ExcludeMissing + fun _outputImageTokens(): JsonField = outputImageTokens + + /** + * Returns the raw JSON value of [outputTextTokens]. + * + * Unlike [outputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_text_tokens") + @ExcludeMissing + fun _outputTextTokens(): JsonField = outputTextTokens + /** * Returns the raw JSON value of [projectId]. * @@ -1782,9 +2001,18 @@ private constructor( private var apiKeyId: JsonField = JsonMissing.of() private var batch: JsonField = JsonMissing.of() private var inputAudioTokens: JsonField = JsonMissing.of() + private var inputCacheWriteTokens: JsonField = JsonMissing.of() + private var inputCachedAudioTokens: JsonField = JsonMissing.of() + private var inputCachedImageTokens: JsonField = JsonMissing.of() + private var inputCachedTextTokens: JsonField = JsonMissing.of() private var inputCachedTokens: JsonField = JsonMissing.of() + private var inputImageTokens: JsonField = JsonMissing.of() + private var inputTextTokens: JsonField = JsonMissing.of() + private var inputUncachedTokens: JsonField = JsonMissing.of() private var model: JsonField = JsonMissing.of() private var outputAudioTokens: JsonField = JsonMissing.of() + private var outputImageTokens: JsonField = JsonMissing.of() + private var outputTextTokens: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var serviceTier: JsonField = JsonMissing.of() private var userId: JsonField = JsonMissing.of() @@ -1801,9 +2029,22 @@ private constructor( apiKeyId = organizationUsageCompletionsResult.apiKeyId batch = organizationUsageCompletionsResult.batch inputAudioTokens = organizationUsageCompletionsResult.inputAudioTokens + inputCacheWriteTokens = + organizationUsageCompletionsResult.inputCacheWriteTokens + inputCachedAudioTokens = + organizationUsageCompletionsResult.inputCachedAudioTokens + inputCachedImageTokens = + organizationUsageCompletionsResult.inputCachedImageTokens + inputCachedTextTokens = + organizationUsageCompletionsResult.inputCachedTextTokens inputCachedTokens = organizationUsageCompletionsResult.inputCachedTokens + inputImageTokens = organizationUsageCompletionsResult.inputImageTokens + inputTextTokens = organizationUsageCompletionsResult.inputTextTokens + inputUncachedTokens = organizationUsageCompletionsResult.inputUncachedTokens model = organizationUsageCompletionsResult.model outputAudioTokens = organizationUsageCompletionsResult.outputAudioTokens + outputImageTokens = organizationUsageCompletionsResult.outputImageTokens + outputTextTokens = organizationUsageCompletionsResult.outputTextTokens projectId = organizationUsageCompletionsResult.projectId serviceTier = organizationUsageCompletionsResult.serviceTier userId = organizationUsageCompletionsResult.userId @@ -1812,8 +2053,9 @@ private constructor( } /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed + * to Scale Tier, this includes Scale Tier tokens. */ fun inputTokens(inputTokens: Long) = inputTokens(JsonField.of(inputTokens)) @@ -1858,8 +2100,9 @@ private constructor( fun object_(object_: JsonValue) = apply { this.object_ = object_ } /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier + * tokens. */ fun outputTokens(outputTokens: Long) = outputTokens(JsonField.of(outputTokens)) @@ -1917,9 +2160,7 @@ private constructor( */ fun batch(batch: JsonField) = apply { this.batch = batch } - /** - * The aggregated number of audio input tokens used, including cached tokens. - */ + /** The aggregated number of uncached audio input tokens used. */ fun inputAudioTokens(inputAudioTokens: Long) = inputAudioTokens(JsonField.of(inputAudioTokens)) @@ -1934,10 +2175,70 @@ private constructor( this.inputAudioTokens = inputAudioTokens } + /** The aggregated number of input tokens written to the cache. */ + fun inputCacheWriteTokens(inputCacheWriteTokens: Long) = + inputCacheWriteTokens(JsonField.of(inputCacheWriteTokens)) + /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier - * tokens. + * Sets [Builder.inputCacheWriteTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCacheWriteTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCacheWriteTokens(inputCacheWriteTokens: JsonField) = apply { + this.inputCacheWriteTokens = inputCacheWriteTokens + } + + /** The aggregated number of cached audio input tokens used. */ + fun inputCachedAudioTokens(inputCachedAudioTokens: Long) = + inputCachedAudioTokens(JsonField.of(inputCachedAudioTokens)) + + /** + * Sets [Builder.inputCachedAudioTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedAudioTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedAudioTokens(inputCachedAudioTokens: JsonField) = apply { + this.inputCachedAudioTokens = inputCachedAudioTokens + } + + /** The aggregated number of cached image input tokens used. */ + fun inputCachedImageTokens(inputCachedImageTokens: Long) = + inputCachedImageTokens(JsonField.of(inputCachedImageTokens)) + + /** + * Sets [Builder.inputCachedImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedImageTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedImageTokens(inputCachedImageTokens: JsonField) = apply { + this.inputCachedImageTokens = inputCachedImageTokens + } + + /** The aggregated number of cached text input tokens used. */ + fun inputCachedTextTokens(inputCachedTextTokens: Long) = + inputCachedTextTokens(JsonField.of(inputCachedTextTokens)) + + /** + * Sets [Builder.inputCachedTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedTextTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedTextTokens(inputCachedTextTokens: JsonField) = apply { + this.inputCachedTextTokens = inputCachedTextTokens + } + + /** + * The aggregated number of cached input tokens used across text, audio, and + * image inputs. For customers subscribed to Scale Tier, this includes Scale + * Tier tokens. */ fun inputCachedTokens(inputCachedTokens: Long) = inputCachedTokens(JsonField.of(inputCachedTokens)) @@ -1953,6 +2254,57 @@ private constructor( this.inputCachedTokens = inputCachedTokens } + /** The aggregated number of uncached image input tokens used. */ + fun inputImageTokens(inputImageTokens: Long) = + inputImageTokens(JsonField.of(inputImageTokens)) + + /** + * Sets [Builder.inputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputImageTokens(inputImageTokens: JsonField) = apply { + this.inputImageTokens = inputImageTokens + } + + /** + * The aggregated number of uncached text input tokens used, excluding + * cache-write tokens. + */ + fun inputTextTokens(inputTextTokens: Long) = + inputTextTokens(JsonField.of(inputTextTokens)) + + /** + * Sets [Builder.inputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputTextTokens(inputTextTokens: JsonField) = apply { + this.inputTextTokens = inputTextTokens + } + + /** + * The aggregated number of uncached input tokens used across text, audio, and + * image inputs, excluding cache-write tokens. + */ + fun inputUncachedTokens(inputUncachedTokens: Long) = + inputUncachedTokens(JsonField.of(inputUncachedTokens)) + + /** + * Sets [Builder.inputUncachedTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputUncachedTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputUncachedTokens(inputUncachedTokens: JsonField) = apply { + this.inputUncachedTokens = inputUncachedTokens + } + /** * When `group_by=model`, this field provides the model name of the grouped * usage result. @@ -1986,6 +2338,36 @@ private constructor( this.outputAudioTokens = outputAudioTokens } + /** The aggregated number of image output tokens used. */ + fun outputImageTokens(outputImageTokens: Long) = + outputImageTokens(JsonField.of(outputImageTokens)) + + /** + * Sets [Builder.outputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputImageTokens(outputImageTokens: JsonField) = apply { + this.outputImageTokens = outputImageTokens + } + + /** The aggregated number of text output tokens used. */ + fun outputTextTokens(outputTextTokens: Long) = + outputTextTokens(JsonField.of(outputTextTokens)) + + /** + * Sets [Builder.outputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputTextTokens(outputTextTokens: JsonField) = apply { + this.outputTextTokens = outputTextTokens + } + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -2091,9 +2473,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2129,9 +2520,18 @@ private constructor( apiKeyId() batch() inputAudioTokens() + inputCacheWriteTokens() + inputCachedAudioTokens() + inputCachedImageTokens() + inputCachedTextTokens() inputCachedTokens() + inputImageTokens() + inputTextTokens() + inputUncachedTokens() model() outputAudioTokens() + outputImageTokens() + outputTextTokens() projectId() serviceTier() userId() @@ -2164,9 +2564,18 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (batch.asKnown().isPresent) 1 else 0) + (if (inputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCacheWriteTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedTextTokens.asKnown().isPresent) 1 else 0) + (if (inputCachedTokens.asKnown().isPresent) 1 else 0) + + (if (inputImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputTextTokens.asKnown().isPresent) 1 else 0) + + (if (inputUncachedTokens.asKnown().isPresent) 1 else 0) + (if (model.asKnown().isPresent) 1 else 0) + (if (outputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (outputImageTokens.asKnown().isPresent) 1 else 0) + + (if (outputTextTokens.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + (if (serviceTier.asKnown().isPresent) 1 else 0) + (if (userId.asKnown().isPresent) 1 else 0) @@ -2184,9 +2593,18 @@ private constructor( apiKeyId == other.apiKeyId && batch == other.batch && inputAudioTokens == other.inputAudioTokens && + inputCacheWriteTokens == other.inputCacheWriteTokens && + inputCachedAudioTokens == other.inputCachedAudioTokens && + inputCachedImageTokens == other.inputCachedImageTokens && + inputCachedTextTokens == other.inputCachedTextTokens && inputCachedTokens == other.inputCachedTokens && + inputImageTokens == other.inputImageTokens && + inputTextTokens == other.inputTextTokens && + inputUncachedTokens == other.inputUncachedTokens && model == other.model && outputAudioTokens == other.outputAudioTokens && + outputImageTokens == other.outputImageTokens && + outputTextTokens == other.outputTextTokens && projectId == other.projectId && serviceTier == other.serviceTier && userId == other.userId && @@ -2202,9 +2620,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2215,7 +2642,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCachedTokens=$inputCachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" + "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCacheWriteTokens=$inputCacheWriteTokens, inputCachedAudioTokens=$inputCachedAudioTokens, inputCachedImageTokens=$inputCachedImageTokens, inputCachedTextTokens=$inputCachedTextTokens, inputCachedTokens=$inputCachedTokens, inputImageTokens=$inputImageTokens, inputTextTokens=$inputTextTokens, inputUncachedTokens=$inputUncachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, outputImageTokens=$outputImageTokens, outputTextTokens=$outputTextTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" } /** The aggregated embeddings usage details of the specific time bucket. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponse.kt index f832f5474..31a110bd7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponse.kt @@ -1442,9 +1442,18 @@ private constructor( private val apiKeyId: JsonField, private val batch: JsonField, private val inputAudioTokens: JsonField, + private val inputCacheWriteTokens: JsonField, + private val inputCachedAudioTokens: JsonField, + private val inputCachedImageTokens: JsonField, + private val inputCachedTextTokens: JsonField, private val inputCachedTokens: JsonField, + private val inputImageTokens: JsonField, + private val inputTextTokens: JsonField, + private val inputUncachedTokens: JsonField, private val model: JsonField, private val outputAudioTokens: JsonField, + private val outputImageTokens: JsonField, + private val outputTextTokens: JsonField, private val projectId: JsonField, private val serviceTier: JsonField, private val userId: JsonField, @@ -1472,15 +1481,42 @@ private constructor( @JsonProperty("input_audio_tokens") @ExcludeMissing inputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + inputCacheWriteTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + inputCachedAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + inputCachedImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + inputCachedTextTokens: JsonField = JsonMissing.of(), @JsonProperty("input_cached_tokens") @ExcludeMissing inputCachedTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_image_tokens") + @ExcludeMissing + inputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_text_tokens") + @ExcludeMissing + inputTextTokens: JsonField = JsonMissing.of(), + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + inputUncachedTokens: JsonField = JsonMissing.of(), @JsonProperty("model") @ExcludeMissing model: JsonField = JsonMissing.of(), @JsonProperty("output_audio_tokens") @ExcludeMissing outputAudioTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_image_tokens") + @ExcludeMissing + outputImageTokens: JsonField = JsonMissing.of(), + @JsonProperty("output_text_tokens") + @ExcludeMissing + outputTextTokens: JsonField = JsonMissing.of(), @JsonProperty("project_id") @ExcludeMissing projectId: JsonField = JsonMissing.of(), @@ -1498,9 +1534,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -1508,8 +1553,9 @@ private constructor( ) /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed to + * Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1538,8 +1584,8 @@ private constructor( @JsonProperty("object") @ExcludeMissing fun _object_(): JsonValue = object_ /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -1566,7 +1612,7 @@ private constructor( fun batch(): Optional = batch.getOptional("batch") /** - * The aggregated number of audio input tokens used, including cached tokens. + * The aggregated number of uncached audio input tokens used. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1575,8 +1621,44 @@ private constructor( inputAudioTokens.getOptional("input_audio_tokens") /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens written to the cache. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCacheWriteTokens(): Optional = + inputCacheWriteTokens.getOptional("input_cache_write_tokens") + + /** + * The aggregated number of cached audio input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedAudioTokens(): Optional = + inputCachedAudioTokens.getOptional("input_cached_audio_tokens") + + /** + * The aggregated number of cached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedImageTokens(): Optional = + inputCachedImageTokens.getOptional("input_cached_image_tokens") + + /** + * The aggregated number of cached text input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputCachedTextTokens(): Optional = + inputCachedTextTokens.getOptional("input_cached_text_tokens") + + /** + * The aggregated number of cached input tokens used across text, audio, and image + * inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1584,6 +1666,35 @@ private constructor( fun inputCachedTokens(): Optional = inputCachedTokens.getOptional("input_cached_tokens") + /** + * The aggregated number of uncached image input tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputImageTokens(): Optional = + inputImageTokens.getOptional("input_image_tokens") + + /** + * The aggregated number of uncached text input tokens used, excluding cache-write + * tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputTextTokens(): Optional = + inputTextTokens.getOptional("input_text_tokens") + + /** + * The aggregated number of uncached input tokens used across text, audio, and image + * inputs, excluding cache-write tokens. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun inputUncachedTokens(): Optional = + inputUncachedTokens.getOptional("input_uncached_tokens") + /** * When `group_by=model`, this field provides the model name of the grouped usage * result. @@ -1602,6 +1713,24 @@ private constructor( fun outputAudioTokens(): Optional = outputAudioTokens.getOptional("output_audio_tokens") + /** + * The aggregated number of image output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputImageTokens(): Optional = + outputImageTokens.getOptional("output_image_tokens") + + /** + * The aggregated number of text output tokens used. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun outputTextTokens(): Optional = + outputTextTokens.getOptional("output_text_tokens") + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -1687,6 +1816,46 @@ private constructor( @ExcludeMissing fun _inputAudioTokens(): JsonField = inputAudioTokens + /** + * Returns the raw JSON value of [inputCacheWriteTokens]. + * + * Unlike [inputCacheWriteTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cache_write_tokens") + @ExcludeMissing + fun _inputCacheWriteTokens(): JsonField = inputCacheWriteTokens + + /** + * Returns the raw JSON value of [inputCachedAudioTokens]. + * + * Unlike [inputCachedAudioTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_audio_tokens") + @ExcludeMissing + fun _inputCachedAudioTokens(): JsonField = inputCachedAudioTokens + + /** + * Returns the raw JSON value of [inputCachedImageTokens]. + * + * Unlike [inputCachedImageTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_image_tokens") + @ExcludeMissing + fun _inputCachedImageTokens(): JsonField = inputCachedImageTokens + + /** + * Returns the raw JSON value of [inputCachedTextTokens]. + * + * Unlike [inputCachedTextTokens], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("input_cached_text_tokens") + @ExcludeMissing + fun _inputCachedTextTokens(): JsonField = inputCachedTextTokens + /** * Returns the raw JSON value of [inputCachedTokens]. * @@ -1697,6 +1866,36 @@ private constructor( @ExcludeMissing fun _inputCachedTokens(): JsonField = inputCachedTokens + /** + * Returns the raw JSON value of [inputImageTokens]. + * + * Unlike [inputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_image_tokens") + @ExcludeMissing + fun _inputImageTokens(): JsonField = inputImageTokens + + /** + * Returns the raw JSON value of [inputTextTokens]. + * + * Unlike [inputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_text_tokens") + @ExcludeMissing + fun _inputTextTokens(): JsonField = inputTextTokens + + /** + * Returns the raw JSON value of [inputUncachedTokens]. + * + * Unlike [inputUncachedTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("input_uncached_tokens") + @ExcludeMissing + fun _inputUncachedTokens(): JsonField = inputUncachedTokens + /** * Returns the raw JSON value of [model]. * @@ -1715,6 +1914,26 @@ private constructor( @ExcludeMissing fun _outputAudioTokens(): JsonField = outputAudioTokens + /** + * Returns the raw JSON value of [outputImageTokens]. + * + * Unlike [outputImageTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_image_tokens") + @ExcludeMissing + fun _outputImageTokens(): JsonField = outputImageTokens + + /** + * Returns the raw JSON value of [outputTextTokens]. + * + * Unlike [outputTextTokens], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("output_text_tokens") + @ExcludeMissing + fun _outputTextTokens(): JsonField = outputTextTokens + /** * Returns the raw JSON value of [projectId]. * @@ -1782,9 +2001,18 @@ private constructor( private var apiKeyId: JsonField = JsonMissing.of() private var batch: JsonField = JsonMissing.of() private var inputAudioTokens: JsonField = JsonMissing.of() + private var inputCacheWriteTokens: JsonField = JsonMissing.of() + private var inputCachedAudioTokens: JsonField = JsonMissing.of() + private var inputCachedImageTokens: JsonField = JsonMissing.of() + private var inputCachedTextTokens: JsonField = JsonMissing.of() private var inputCachedTokens: JsonField = JsonMissing.of() + private var inputImageTokens: JsonField = JsonMissing.of() + private var inputTextTokens: JsonField = JsonMissing.of() + private var inputUncachedTokens: JsonField = JsonMissing.of() private var model: JsonField = JsonMissing.of() private var outputAudioTokens: JsonField = JsonMissing.of() + private var outputImageTokens: JsonField = JsonMissing.of() + private var outputTextTokens: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var serviceTier: JsonField = JsonMissing.of() private var userId: JsonField = JsonMissing.of() @@ -1801,9 +2029,22 @@ private constructor( apiKeyId = organizationUsageCompletionsResult.apiKeyId batch = organizationUsageCompletionsResult.batch inputAudioTokens = organizationUsageCompletionsResult.inputAudioTokens + inputCacheWriteTokens = + organizationUsageCompletionsResult.inputCacheWriteTokens + inputCachedAudioTokens = + organizationUsageCompletionsResult.inputCachedAudioTokens + inputCachedImageTokens = + organizationUsageCompletionsResult.inputCachedImageTokens + inputCachedTextTokens = + organizationUsageCompletionsResult.inputCachedTextTokens inputCachedTokens = organizationUsageCompletionsResult.inputCachedTokens + inputImageTokens = organizationUsageCompletionsResult.inputImageTokens + inputTextTokens = organizationUsageCompletionsResult.inputTextTokens + inputUncachedTokens = organizationUsageCompletionsResult.inputUncachedTokens model = organizationUsageCompletionsResult.model outputAudioTokens = organizationUsageCompletionsResult.outputAudioTokens + outputImageTokens = organizationUsageCompletionsResult.outputImageTokens + outputTextTokens = organizationUsageCompletionsResult.outputTextTokens projectId = organizationUsageCompletionsResult.projectId serviceTier = organizationUsageCompletionsResult.serviceTier userId = organizationUsageCompletionsResult.userId @@ -1812,8 +2053,9 @@ private constructor( } /** - * The aggregated number of text input tokens used, including cached tokens. For - * customers subscribe to scale tier, this includes scale tier tokens. + * The aggregated number of input tokens used, including cached and cache-write + * tokens. This includes text, audio, and image tokens. For customers subscribed + * to Scale Tier, this includes Scale Tier tokens. */ fun inputTokens(inputTokens: Long) = inputTokens(JsonField.of(inputTokens)) @@ -1858,8 +2100,9 @@ private constructor( fun object_(object_: JsonValue) = apply { this.object_ = object_ } /** - * The aggregated number of text output tokens used. For customers subscribe to - * scale tier, this includes scale tier tokens. + * The aggregated number of output tokens used across text, audio, and image + * outputs. For customers subscribed to Scale Tier, this includes Scale Tier + * tokens. */ fun outputTokens(outputTokens: Long) = outputTokens(JsonField.of(outputTokens)) @@ -1917,9 +2160,7 @@ private constructor( */ fun batch(batch: JsonField) = apply { this.batch = batch } - /** - * The aggregated number of audio input tokens used, including cached tokens. - */ + /** The aggregated number of uncached audio input tokens used. */ fun inputAudioTokens(inputAudioTokens: Long) = inputAudioTokens(JsonField.of(inputAudioTokens)) @@ -1934,10 +2175,70 @@ private constructor( this.inputAudioTokens = inputAudioTokens } + /** The aggregated number of input tokens written to the cache. */ + fun inputCacheWriteTokens(inputCacheWriteTokens: Long) = + inputCacheWriteTokens(JsonField.of(inputCacheWriteTokens)) + /** - * The aggregated number of text input tokens that has been cached from previous - * requests. For customers subscribe to scale tier, this includes scale tier - * tokens. + * Sets [Builder.inputCacheWriteTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCacheWriteTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCacheWriteTokens(inputCacheWriteTokens: JsonField) = apply { + this.inputCacheWriteTokens = inputCacheWriteTokens + } + + /** The aggregated number of cached audio input tokens used. */ + fun inputCachedAudioTokens(inputCachedAudioTokens: Long) = + inputCachedAudioTokens(JsonField.of(inputCachedAudioTokens)) + + /** + * Sets [Builder.inputCachedAudioTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedAudioTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedAudioTokens(inputCachedAudioTokens: JsonField) = apply { + this.inputCachedAudioTokens = inputCachedAudioTokens + } + + /** The aggregated number of cached image input tokens used. */ + fun inputCachedImageTokens(inputCachedImageTokens: Long) = + inputCachedImageTokens(JsonField.of(inputCachedImageTokens)) + + /** + * Sets [Builder.inputCachedImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedImageTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedImageTokens(inputCachedImageTokens: JsonField) = apply { + this.inputCachedImageTokens = inputCachedImageTokens + } + + /** The aggregated number of cached text input tokens used. */ + fun inputCachedTextTokens(inputCachedTextTokens: Long) = + inputCachedTextTokens(JsonField.of(inputCachedTextTokens)) + + /** + * Sets [Builder.inputCachedTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputCachedTextTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputCachedTextTokens(inputCachedTextTokens: JsonField) = apply { + this.inputCachedTextTokens = inputCachedTextTokens + } + + /** + * The aggregated number of cached input tokens used across text, audio, and + * image inputs. For customers subscribed to Scale Tier, this includes Scale + * Tier tokens. */ fun inputCachedTokens(inputCachedTokens: Long) = inputCachedTokens(JsonField.of(inputCachedTokens)) @@ -1953,6 +2254,57 @@ private constructor( this.inputCachedTokens = inputCachedTokens } + /** The aggregated number of uncached image input tokens used. */ + fun inputImageTokens(inputImageTokens: Long) = + inputImageTokens(JsonField.of(inputImageTokens)) + + /** + * Sets [Builder.inputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputImageTokens(inputImageTokens: JsonField) = apply { + this.inputImageTokens = inputImageTokens + } + + /** + * The aggregated number of uncached text input tokens used, excluding + * cache-write tokens. + */ + fun inputTextTokens(inputTextTokens: Long) = + inputTextTokens(JsonField.of(inputTextTokens)) + + /** + * Sets [Builder.inputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputTextTokens(inputTextTokens: JsonField) = apply { + this.inputTextTokens = inputTextTokens + } + + /** + * The aggregated number of uncached input tokens used across text, audio, and + * image inputs, excluding cache-write tokens. + */ + fun inputUncachedTokens(inputUncachedTokens: Long) = + inputUncachedTokens(JsonField.of(inputUncachedTokens)) + + /** + * Sets [Builder.inputUncachedTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.inputUncachedTokens] with a well-typed + * [Long] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun inputUncachedTokens(inputUncachedTokens: JsonField) = apply { + this.inputUncachedTokens = inputUncachedTokens + } + /** * When `group_by=model`, this field provides the model name of the grouped * usage result. @@ -1986,6 +2338,36 @@ private constructor( this.outputAudioTokens = outputAudioTokens } + /** The aggregated number of image output tokens used. */ + fun outputImageTokens(outputImageTokens: Long) = + outputImageTokens(JsonField.of(outputImageTokens)) + + /** + * Sets [Builder.outputImageTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputImageTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputImageTokens(outputImageTokens: JsonField) = apply { + this.outputImageTokens = outputImageTokens + } + + /** The aggregated number of text output tokens used. */ + fun outputTextTokens(outputTextTokens: Long) = + outputTextTokens(JsonField.of(outputTextTokens)) + + /** + * Sets [Builder.outputTextTokens] to an arbitrary JSON value. + * + * You should usually call [Builder.outputTextTokens] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun outputTextTokens(outputTextTokens: JsonField) = apply { + this.outputTextTokens = outputTextTokens + } + /** * When `group_by=project_id`, this field provides the project ID of the grouped * usage result. @@ -2091,9 +2473,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2129,9 +2520,18 @@ private constructor( apiKeyId() batch() inputAudioTokens() + inputCacheWriteTokens() + inputCachedAudioTokens() + inputCachedImageTokens() + inputCachedTextTokens() inputCachedTokens() + inputImageTokens() + inputTextTokens() + inputUncachedTokens() model() outputAudioTokens() + outputImageTokens() + outputTextTokens() projectId() serviceTier() userId() @@ -2164,9 +2564,18 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (batch.asKnown().isPresent) 1 else 0) + (if (inputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCacheWriteTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedAudioTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputCachedTextTokens.asKnown().isPresent) 1 else 0) + (if (inputCachedTokens.asKnown().isPresent) 1 else 0) + + (if (inputImageTokens.asKnown().isPresent) 1 else 0) + + (if (inputTextTokens.asKnown().isPresent) 1 else 0) + + (if (inputUncachedTokens.asKnown().isPresent) 1 else 0) + (if (model.asKnown().isPresent) 1 else 0) + (if (outputAudioTokens.asKnown().isPresent) 1 else 0) + + (if (outputImageTokens.asKnown().isPresent) 1 else 0) + + (if (outputTextTokens.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + (if (serviceTier.asKnown().isPresent) 1 else 0) + (if (userId.asKnown().isPresent) 1 else 0) @@ -2184,9 +2593,18 @@ private constructor( apiKeyId == other.apiKeyId && batch == other.batch && inputAudioTokens == other.inputAudioTokens && + inputCacheWriteTokens == other.inputCacheWriteTokens && + inputCachedAudioTokens == other.inputCachedAudioTokens && + inputCachedImageTokens == other.inputCachedImageTokens && + inputCachedTextTokens == other.inputCachedTextTokens && inputCachedTokens == other.inputCachedTokens && + inputImageTokens == other.inputImageTokens && + inputTextTokens == other.inputTextTokens && + inputUncachedTokens == other.inputUncachedTokens && model == other.model && outputAudioTokens == other.outputAudioTokens && + outputImageTokens == other.outputImageTokens && + outputTextTokens == other.outputTextTokens && projectId == other.projectId && serviceTier == other.serviceTier && userId == other.userId && @@ -2202,9 +2620,18 @@ private constructor( apiKeyId, batch, inputAudioTokens, + inputCacheWriteTokens, + inputCachedAudioTokens, + inputCachedImageTokens, + inputCachedTextTokens, inputCachedTokens, + inputImageTokens, + inputTextTokens, + inputUncachedTokens, model, outputAudioTokens, + outputImageTokens, + outputTextTokens, projectId, serviceTier, userId, @@ -2215,7 +2642,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCachedTokens=$inputCachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" + "OrganizationUsageCompletionsResult{inputTokens=$inputTokens, numModelRequests=$numModelRequests, object_=$object_, outputTokens=$outputTokens, apiKeyId=$apiKeyId, batch=$batch, inputAudioTokens=$inputAudioTokens, inputCacheWriteTokens=$inputCacheWriteTokens, inputCachedAudioTokens=$inputCachedAudioTokens, inputCachedImageTokens=$inputCachedImageTokens, inputCachedTextTokens=$inputCachedTextTokens, inputCachedTokens=$inputCachedTokens, inputImageTokens=$inputImageTokens, inputTextTokens=$inputTextTokens, inputUncachedTokens=$inputUncachedTokens, model=$model, outputAudioTokens=$outputAudioTokens, outputImageTokens=$outputImageTokens, outputTextTokens=$outputTextTokens, projectId=$projectId, serviceTier=$serviceTier, userId=$userId, additionalProperties=$additionalProperties}" } /** The aggregated embeddings usage details of the specific time bucket. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputItem.kt b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputItem.kt index 9c0240999..91b4ac0b1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputItem.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInputItem.kt @@ -7403,7 +7403,7 @@ private constructor( private constructor( private val text: JsonField, private val type: JsonValue, - private val annotations: JsonField, + private val annotations: JsonField>, private val additionalProperties: MutableMap, ) { @@ -7413,7 +7413,7 @@ private constructor( @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(), @JsonProperty("annotations") @ExcludeMissing - annotations: JsonField = JsonMissing.of(), + annotations: JsonField> = JsonMissing.of(), ) : this(text, type, annotations, mutableMapOf()) /** @@ -7444,7 +7444,7 @@ private constructor( * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ - fun annotations(): Optional = annotations.getOptional("annotations") + fun annotations(): Optional> = annotations.getOptional("annotations") /** * Returns the raw JSON value of [text]. @@ -7461,7 +7461,7 @@ private constructor( */ @JsonProperty("annotations") @ExcludeMissing - fun _annotations(): JsonField = annotations + fun _annotations(): JsonField> = annotations @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -7493,14 +7493,14 @@ private constructor( private var text: JsonField? = null private var type: JsonValue = JsonValue.from("output_text") - private var annotations: JsonField = JsonMissing.of() + private var annotations: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(output: Output) = apply { text = output.text type = output.type - annotations = output.annotations + annotations = output.annotations.map { it.toMutableList() } additionalProperties = output.additionalProperties.toMutableMap() } @@ -7531,48 +7531,50 @@ private constructor( fun type(type: JsonValue) = apply { this.type = type } /** Citations associated with the text content. */ - fun annotations(annotations: Annotations) = annotations(JsonField.of(annotations)) + fun annotations(annotations: List) = + annotations(JsonField.of(annotations)) /** * Sets [Builder.annotations] to an arbitrary JSON value. * - * You should usually call [Builder.annotations] with a well-typed [Annotations] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. + * You should usually call [Builder.annotations] with a well-typed + * `List` value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. */ - fun annotations(annotations: JsonField) = apply { - this.annotations = annotations + fun annotations(annotations: JsonField>) = apply { + this.annotations = annotations.map { it.toMutableList() } } /** - * Alias for calling [annotations] with - * `Annotations.ofBetaFileCitationParams(betaFileCitationParams)`. + * Adds a single [Annotation] to [annotations]. + * + * @throws IllegalStateException if the field was previously set to a non-list. */ - fun annotationsOfBetaFileCitationParams( - betaFileCitationParams: List - ) = annotations(Annotations.ofBetaFileCitationParams(betaFileCitationParams)) + fun addAnnotation(annotation: Annotation) = apply { + annotations = + (annotations ?: JsonField.of(mutableListOf())).also { + checkKnown("annotations", it).add(annotation) + } + } /** - * Alias for calling [annotations] with - * `Annotations.ofBetaUrlCitationParams(betaUrlCitationParams)`. + * Alias for calling [addAnnotation] with `Annotation.ofFileCitation(fileCitation)`. */ - fun annotationsOfBetaUrlCitationParams( - betaUrlCitationParams: List - ) = annotations(Annotations.ofBetaUrlCitationParams(betaUrlCitationParams)) + fun addAnnotation(fileCitation: Annotation.FileCitation) = + addAnnotation(Annotation.ofFileCitation(fileCitation)) /** - * Alias for calling [annotations] with - * `Annotations.ofBetaContainerFileCitationParams(betaContainerFileCitationParams)`. + * Alias for calling [addAnnotation] with `Annotation.ofUrlCitation(urlCitation)`. */ - fun annotationsOfBetaContainerFileCitationParams( - betaContainerFileCitationParams: - List - ) = - annotations( - Annotations.ofBetaContainerFileCitationParams( - betaContainerFileCitationParams - ) - ) + fun addAnnotation(urlCitation: Annotation.UrlCitation) = + addAnnotation(Annotation.ofUrlCitation(urlCitation)) + + /** + * Alias for calling [addAnnotation] with + * `Annotation.ofContainerFileCitation(containerFileCitation)`. + */ + fun addAnnotation(containerFileCitation: Annotation.ContainerFileCitation) = + addAnnotation(Annotation.ofContainerFileCitation(containerFileCitation)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -7612,7 +7614,7 @@ private constructor( Output( checkRequired("text", text), type, - annotations, + (annotations ?: JsonMissing.of()).map { it.toImmutable() }, additionalProperties.toMutableMap(), ) } @@ -7640,7 +7642,7 @@ private constructor( throw OpenAIInvalidDataException("'type' is invalid, received $it") } } - annotations().ifPresent { it.validate() } + annotations().ifPresent { it.forEach { it.validate() } } validated = true } @@ -7662,45 +7664,37 @@ private constructor( internal fun validity(): Int = (if (text.asKnown().isPresent) 1 else 0) + type.let { if (it == JsonValue.from("output_text")) 1 else 0 } + - (annotations.asKnown().getOrNull()?.validity() ?: 0) + (annotations.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) - /** Citations associated with the text content. */ - @JsonDeserialize(using = Annotations.Deserializer::class) - @JsonSerialize(using = Annotations.Serializer::class) - class Annotations + @JsonDeserialize(using = Annotation.Deserializer::class) + @JsonSerialize(using = Annotation.Serializer::class) + class Annotation private constructor( - private val betaFileCitationParams: List? = null, - private val betaUrlCitationParams: List? = null, - private val betaContainerFileCitationParams: List? = - null, + private val fileCitation: FileCitation? = null, + private val urlCitation: UrlCitation? = null, + private val containerFileCitation: ContainerFileCitation? = null, private val _json: JsonValue? = null, ) { - fun betaFileCitationParams(): Optional> = - Optional.ofNullable(betaFileCitationParams) + fun fileCitation(): Optional = Optional.ofNullable(fileCitation) - fun betaUrlCitationParams(): Optional> = - Optional.ofNullable(betaUrlCitationParams) + fun urlCitation(): Optional = Optional.ofNullable(urlCitation) - fun betaContainerFileCitationParams(): - Optional> = - Optional.ofNullable(betaContainerFileCitationParams) + fun containerFileCitation(): Optional = + Optional.ofNullable(containerFileCitation) - fun isBetaFileCitationParams(): Boolean = betaFileCitationParams != null + fun isFileCitation(): Boolean = fileCitation != null - fun isBetaUrlCitationParams(): Boolean = betaUrlCitationParams != null + fun isUrlCitation(): Boolean = urlCitation != null - fun isBetaContainerFileCitationParams(): Boolean = - betaContainerFileCitationParams != null + fun isContainerFileCitation(): Boolean = containerFileCitation != null - fun asBetaFileCitationParams(): List = - betaFileCitationParams.getOrThrow("betaFileCitationParams") + fun asFileCitation(): FileCitation = fileCitation.getOrThrow("fileCitation") - fun asBetaUrlCitationParams(): List = - betaUrlCitationParams.getOrThrow("betaUrlCitationParams") + fun asUrlCitation(): UrlCitation = urlCitation.getOrThrow("urlCitation") - fun asBetaContainerFileCitationParams(): List = - betaContainerFileCitationParams.getOrThrow("betaContainerFileCitationParams") + fun asContainerFileCitation(): ContainerFileCitation = + containerFileCitation.getOrThrow("containerFileCitation") fun _json(): Optional = Optional.ofNullable(_json) @@ -7715,10 +7709,10 @@ private constructor( * import com.openai.core.JsonValue; * import java.util.Optional; * - * Optional result = annotations.accept(new Annotations.Visitor>() { + * Optional result = annotation.accept(new Annotation.Visitor>() { * @Override - * public Optional visitBetaFileCitationParams(List betaFileCitationParams) { - * return Optional.of(betaFileCitationParams.toString()); + * public Optional visitFileCitation(FileCitation fileCitation) { + * return Optional.of(fileCitation.toString()); * } * * // ... @@ -7736,14 +7730,10 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - betaFileCitationParams != null -> - visitor.visitBetaFileCitationParams(betaFileCitationParams) - betaUrlCitationParams != null -> - visitor.visitBetaUrlCitationParams(betaUrlCitationParams) - betaContainerFileCitationParams != null -> - visitor.visitBetaContainerFileCitationParams( - betaContainerFileCitationParams - ) + fileCitation != null -> visitor.visitFileCitation(fileCitation) + urlCitation != null -> visitor.visitUrlCitation(urlCitation) + containerFileCitation != null -> + visitor.visitContainerFileCitation(containerFileCitation) else -> visitor.unknown(_json) } @@ -7759,30 +7749,25 @@ private constructor( * @throws OpenAIInvalidDataException if any value type in this object doesn't match * its expected type. */ - fun validate(): Annotations = apply { + fun validate(): Annotation = apply { if (validated) { return@apply } accept( object : Visitor { - override fun visitBetaFileCitationParams( - betaFileCitationParams: List - ) { - betaFileCitationParams.forEach { it.validate() } + override fun visitFileCitation(fileCitation: FileCitation) { + fileCitation.validate() } - override fun visitBetaUrlCitationParams( - betaUrlCitationParams: List - ) { - betaUrlCitationParams.forEach { it.validate() } + override fun visitUrlCitation(urlCitation: UrlCitation) { + urlCitation.validate() } - override fun visitBetaContainerFileCitationParams( - betaContainerFileCitationParams: - List + override fun visitContainerFileCitation( + containerFileCitation: ContainerFileCitation ) { - betaContainerFileCitationParams.forEach { it.validate() } + containerFileCitation.validate() } } ) @@ -7807,18 +7792,15 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitBetaFileCitationParams( - betaFileCitationParams: List - ) = betaFileCitationParams.sumOf { it.validity().toInt() } + override fun visitFileCitation(fileCitation: FileCitation) = + fileCitation.validity() - override fun visitBetaUrlCitationParams( - betaUrlCitationParams: List - ) = betaUrlCitationParams.sumOf { it.validity().toInt() } + override fun visitUrlCitation(urlCitation: UrlCitation) = + urlCitation.validity() - override fun visitBetaContainerFileCitationParams( - betaContainerFileCitationParams: - List - ) = betaContainerFileCitationParams.sumOf { it.validity().toInt() } + override fun visitContainerFileCitation( + containerFileCitation: ContainerFileCitation + ) = containerFileCitation.validity() override fun unknown(json: JsonValue?) = 0 } @@ -7829,74 +7811,56 @@ private constructor( return true } - return other is Annotations && - betaFileCitationParams == other.betaFileCitationParams && - betaUrlCitationParams == other.betaUrlCitationParams && - betaContainerFileCitationParams == other.betaContainerFileCitationParams + return other is Annotation && + fileCitation == other.fileCitation && + urlCitation == other.urlCitation && + containerFileCitation == other.containerFileCitation } override fun hashCode(): Int = - Objects.hash( - betaFileCitationParams, - betaUrlCitationParams, - betaContainerFileCitationParams, - ) + Objects.hash(fileCitation, urlCitation, containerFileCitation) override fun toString(): String = when { - betaFileCitationParams != null -> - "Annotations{betaFileCitationParams=$betaFileCitationParams}" - betaUrlCitationParams != null -> - "Annotations{betaUrlCitationParams=$betaUrlCitationParams}" - betaContainerFileCitationParams != null -> - "Annotations{betaContainerFileCitationParams=$betaContainerFileCitationParams}" - _json != null -> "Annotations{_unknown=$_json}" - else -> throw IllegalStateException("Invalid Annotations") + fileCitation != null -> "Annotation{fileCitation=$fileCitation}" + urlCitation != null -> "Annotation{urlCitation=$urlCitation}" + containerFileCitation != null -> + "Annotation{containerFileCitation=$containerFileCitation}" + _json != null -> "Annotation{_unknown=$_json}" + else -> throw IllegalStateException("Invalid Annotation") } companion object { @JvmStatic - fun ofBetaFileCitationParams( - betaFileCitationParams: List - ) = Annotations(betaFileCitationParams = betaFileCitationParams.toImmutable()) + fun ofFileCitation(fileCitation: FileCitation) = + Annotation(fileCitation = fileCitation) @JvmStatic - fun ofBetaUrlCitationParams(betaUrlCitationParams: List) = - Annotations(betaUrlCitationParams = betaUrlCitationParams.toImmutable()) + fun ofUrlCitation(urlCitation: UrlCitation) = + Annotation(urlCitation = urlCitation) @JvmStatic - fun ofBetaContainerFileCitationParams( - betaContainerFileCitationParams: List - ) = - Annotations( - betaContainerFileCitationParams = - betaContainerFileCitationParams.toImmutable() - ) + fun ofContainerFileCitation(containerFileCitation: ContainerFileCitation) = + Annotation(containerFileCitation = containerFileCitation) } /** - * An interface that defines how to map each variant of [Annotations] to a value of + * An interface that defines how to map each variant of [Annotation] to a value of * type [T]. */ interface Visitor { - fun visitBetaFileCitationParams( - betaFileCitationParams: List - ): T + fun visitFileCitation(fileCitation: FileCitation): T - fun visitBetaUrlCitationParams( - betaUrlCitationParams: List - ): T + fun visitUrlCitation(urlCitation: UrlCitation): T - fun visitBetaContainerFileCitationParams( - betaContainerFileCitationParams: List - ): T + fun visitContainerFileCitation(containerFileCitation: ContainerFileCitation): T /** - * Maps an unknown variant of [Annotations] to a value of type [T]. + * Maps an unknown variant of [Annotation] to a value of type [T]. * - * An instance of [Annotations] can contain an unknown variant if it was + * An instance of [Annotation] can contain an unknown variant if it was * deserialized from data that doesn't match any known variant. For example, if * the SDK is on an older version than the API, then the API may respond with * new variants that the SDK is unaware of. @@ -7904,80 +7868,57 @@ private constructor( * @throws OpenAIInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw OpenAIInvalidDataException("Unknown Annotations: $json") + throw OpenAIInvalidDataException("Unknown Annotation: $json") } } - internal class Deserializer : BaseDeserializer(Annotations::class) { + internal class Deserializer : BaseDeserializer(Annotation::class) { - override fun ObjectCodec.deserialize(node: JsonNode): Annotations { + override fun ObjectCodec.deserialize(node: JsonNode): Annotation { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize( - node, - jacksonTypeRef>(), - ) - ?.let { - Annotations(betaFileCitationParams = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef>(), - ) - ?.let { - Annotations(betaUrlCitationParams = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef>(), - ) - ?.let { - Annotations( - betaContainerFileCitationParams = it, - _json = json, - ) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely - // incompatible with all the possible variants (e.g. deserializing from - // boolean). - 0 -> Annotations(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use - // the first completely valid match, or simply the first match if none - // are completely valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "file_citation" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Annotation(fileCitation = it, _json = json) + } ?: Annotation(_json = json) + } + "url_citation" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Annotation(urlCitation = it, _json = json) + } ?: Annotation(_json = json) + } + "container_file_citation" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Annotation(containerFileCitation = it, _json = json) } + ?: Annotation(_json = json) + } } + + return Annotation(_json = json) } } - internal class Serializer : BaseSerializer(Annotations::class) { + internal class Serializer : BaseSerializer(Annotation::class) { override fun serialize( - value: Annotations, + value: Annotation, generator: JsonGenerator, provider: SerializerProvider, ) { when { - value.betaFileCitationParams != null -> - generator.writeObject(value.betaFileCitationParams) - value.betaUrlCitationParams != null -> - generator.writeObject(value.betaUrlCitationParams) - value.betaContainerFileCitationParams != null -> - generator.writeObject(value.betaContainerFileCitationParams) + value.fileCitation != null -> generator.writeObject(value.fileCitation) + value.urlCitation != null -> generator.writeObject(value.urlCitation) + value.containerFileCitation != null -> + generator.writeObject(value.containerFileCitation) value._json != null -> generator.writeObject(value._json) - else -> throw IllegalStateException("Invalid Annotations") + else -> throw IllegalStateException("Invalid Annotation") } } } - class BetaFileCitationParam + class FileCitation @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val fileId: JsonField, @@ -8084,8 +8025,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of - * [BetaFileCitationParam]. + * Returns a mutable builder for constructing an instance of [FileCitation]. * * The following fields are required: * ```java @@ -8097,7 +8037,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [BetaFileCitationParam]. */ + /** A builder for [FileCitation]. */ class Builder internal constructor() { private var fileId: JsonField? = null @@ -8108,13 +8048,12 @@ private constructor( mutableMapOf() @JvmSynthetic - internal fun from(betaFileCitationParam: BetaFileCitationParam) = apply { - fileId = betaFileCitationParam.fileId - filename = betaFileCitationParam.filename - index = betaFileCitationParam.index - type = betaFileCitationParam.type - additionalProperties = - betaFileCitationParam.additionalProperties.toMutableMap() + internal fun from(fileCitation: FileCitation) = apply { + fileId = fileCitation.fileId + filename = fileCitation.filename + index = fileCitation.index + type = fileCitation.type + additionalProperties = fileCitation.additionalProperties.toMutableMap() } /** The ID of the file. */ @@ -8192,7 +8131,7 @@ private constructor( } /** - * Returns an immutable instance of [BetaFileCitationParam]. + * Returns an immutable instance of [FileCitation]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -8205,8 +8144,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): BetaFileCitationParam = - BetaFileCitationParam( + fun build(): FileCitation = + FileCitation( checkRequired("fileId", fileId), checkRequired("filename", filename), checkRequired("index", index), @@ -8227,7 +8166,7 @@ private constructor( * @throws OpenAIInvalidDataException if any value type in this object doesn't * match its expected type. */ - fun validate(): BetaFileCitationParam = apply { + fun validate(): FileCitation = apply { if (validated) { return@apply } @@ -8269,7 +8208,7 @@ private constructor( return true } - return other is BetaFileCitationParam && + return other is FileCitation && fileId == other.fileId && filename == other.filename && index == other.index && @@ -8284,10 +8223,10 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BetaFileCitationParam{fileId=$fileId, filename=$filename, index=$index, type=$type, additionalProperties=$additionalProperties}" + "FileCitation{fileId=$fileId, filename=$filename, index=$index, type=$type, additionalProperties=$additionalProperties}" } - class BetaUrlCitationParam + class UrlCitation @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val endIndex: JsonField, @@ -8415,8 +8354,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of - * [BetaUrlCitationParam]. + * Returns a mutable builder for constructing an instance of [UrlCitation]. * * The following fields are required: * ```java @@ -8429,7 +8367,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [BetaUrlCitationParam]. */ + /** A builder for [UrlCitation]. */ class Builder internal constructor() { private var endIndex: JsonField? = null @@ -8441,14 +8379,13 @@ private constructor( mutableMapOf() @JvmSynthetic - internal fun from(betaUrlCitationParam: BetaUrlCitationParam) = apply { - endIndex = betaUrlCitationParam.endIndex - startIndex = betaUrlCitationParam.startIndex - title = betaUrlCitationParam.title - type = betaUrlCitationParam.type - url = betaUrlCitationParam.url - additionalProperties = - betaUrlCitationParam.additionalProperties.toMutableMap() + internal fun from(urlCitation: UrlCitation) = apply { + endIndex = urlCitation.endIndex + startIndex = urlCitation.startIndex + title = urlCitation.title + type = urlCitation.type + url = urlCitation.url + additionalProperties = urlCitation.additionalProperties.toMutableMap() } /** The index of the last character of the citation in the message. */ @@ -8538,7 +8475,7 @@ private constructor( } /** - * Returns an immutable instance of [BetaUrlCitationParam]. + * Returns an immutable instance of [UrlCitation]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -8552,8 +8489,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): BetaUrlCitationParam = - BetaUrlCitationParam( + fun build(): UrlCitation = + UrlCitation( checkRequired("endIndex", endIndex), checkRequired("startIndex", startIndex), checkRequired("title", title), @@ -8575,7 +8512,7 @@ private constructor( * @throws OpenAIInvalidDataException if any value type in this object doesn't * match its expected type. */ - fun validate(): BetaUrlCitationParam = apply { + fun validate(): UrlCitation = apply { if (validated) { return@apply } @@ -8619,7 +8556,7 @@ private constructor( return true } - return other is BetaUrlCitationParam && + return other is UrlCitation && endIndex == other.endIndex && startIndex == other.startIndex && title == other.title && @@ -8635,10 +8572,10 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BetaUrlCitationParam{endIndex=$endIndex, startIndex=$startIndex, title=$title, type=$type, url=$url, additionalProperties=$additionalProperties}" + "UrlCitation{endIndex=$endIndex, startIndex=$startIndex, title=$title, type=$type, url=$url, additionalProperties=$additionalProperties}" } - class BetaContainerFileCitationParam + class ContainerFileCitation @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val containerId: JsonField, @@ -8802,7 +8739,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [BetaContainerFileCitationParam]. + * [ContainerFileCitation]. * * The following fields are required: * ```java @@ -8816,7 +8753,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [BetaContainerFileCitationParam]. */ + /** A builder for [ContainerFileCitation]. */ class Builder internal constructor() { private var containerId: JsonField? = null @@ -8829,17 +8766,15 @@ private constructor( mutableMapOf() @JvmSynthetic - internal fun from( - betaContainerFileCitationParam: BetaContainerFileCitationParam - ) = apply { - containerId = betaContainerFileCitationParam.containerId - endIndex = betaContainerFileCitationParam.endIndex - fileId = betaContainerFileCitationParam.fileId - filename = betaContainerFileCitationParam.filename - startIndex = betaContainerFileCitationParam.startIndex - type = betaContainerFileCitationParam.type + internal fun from(containerFileCitation: ContainerFileCitation) = apply { + containerId = containerFileCitation.containerId + endIndex = containerFileCitation.endIndex + fileId = containerFileCitation.fileId + filename = containerFileCitation.filename + startIndex = containerFileCitation.startIndex + type = containerFileCitation.type additionalProperties = - betaContainerFileCitationParam.additionalProperties.toMutableMap() + containerFileCitation.additionalProperties.toMutableMap() } /** The ID of the container. */ @@ -8946,7 +8881,7 @@ private constructor( } /** - * Returns an immutable instance of [BetaContainerFileCitationParam]. + * Returns an immutable instance of [ContainerFileCitation]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -8961,8 +8896,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): BetaContainerFileCitationParam = - BetaContainerFileCitationParam( + fun build(): ContainerFileCitation = + ContainerFileCitation( checkRequired("containerId", containerId), checkRequired("endIndex", endIndex), checkRequired("fileId", fileId), @@ -8985,7 +8920,7 @@ private constructor( * @throws OpenAIInvalidDataException if any value type in this object doesn't * match its expected type. */ - fun validate(): BetaContainerFileCitationParam = apply { + fun validate(): ContainerFileCitation = apply { if (validated) { return@apply } @@ -9033,7 +8968,7 @@ private constructor( return true } - return other is BetaContainerFileCitationParam && + return other is ContainerFileCitation && containerId == other.containerId && endIndex == other.endIndex && fileId == other.fileId && @@ -9058,7 +8993,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BetaContainerFileCitationParam{containerId=$containerId, endIndex=$endIndex, fileId=$fileId, filename=$filename, startIndex=$startIndex, type=$type, additionalProperties=$additionalProperties}" + "ContainerFileCitation{containerId=$containerId, endIndex=$endIndex, fileId=$fileId, filename=$filename, startIndex=$startIndex, type=$type, additionalProperties=$additionalProperties}" } } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/admin/organization/projects/ServiceAccountServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/admin/organization/projects/ServiceAccountServiceAsync.kt index 0ece534c3..b1259f0cc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/admin/organization/projects/ServiceAccountServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/admin/organization/projects/ServiceAccountServiceAsync.kt @@ -14,6 +14,7 @@ import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAcco import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountListParams import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountRetrieveParams import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountUpdateParams +import com.openai.services.async.admin.organization.projects.serviceaccounts.ApiKeyServiceAsync import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -31,9 +32,11 @@ interface ServiceAccountServiceAsync { */ fun withOptions(modifier: Consumer): ServiceAccountServiceAsync + fun apiKeys(): ApiKeyServiceAsync + /** - * Creates a new service account in the project. This also returns an unredacted API key for the - * service account. + * Creates a new service account in the project. By default, this also returns an unredacted API + * key for the service account. */ fun create( projectId: String, @@ -192,6 +195,8 @@ interface ServiceAccountServiceAsync { modifier: Consumer ): ServiceAccountServiceAsync.WithRawResponse + fun apiKeys(): ApiKeyServiceAsync.WithRawResponse + /** * Returns a raw HTTP response for `post * /organization/projects/{project_id}/service_accounts`, but is otherwise the same as diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/admin/organization/projects/ServiceAccountServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/admin/organization/projects/ServiceAccountServiceAsyncImpl.kt index 2b373c7e2..ab4e9d9d3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/admin/organization/projects/ServiceAccountServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/admin/organization/projects/ServiceAccountServiceAsyncImpl.kt @@ -27,6 +27,8 @@ import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAcco import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountListParams import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountRetrieveParams import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountUpdateParams +import com.openai.services.async.admin.organization.projects.serviceaccounts.ApiKeyServiceAsync +import com.openai.services.async.admin.organization.projects.serviceaccounts.ApiKeyServiceAsyncImpl import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -38,6 +40,8 @@ internal constructor(private val clientOptions: ClientOptions) : ServiceAccountS WithRawResponseImpl(clientOptions) } + private val apiKeys: ApiKeyServiceAsync by lazy { ApiKeyServiceAsyncImpl(clientOptions) } + override fun withRawResponse(): ServiceAccountServiceAsync.WithRawResponse = withRawResponse override fun withOptions( @@ -45,6 +49,8 @@ internal constructor(private val clientOptions: ClientOptions) : ServiceAccountS ): ServiceAccountServiceAsync = ServiceAccountServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun apiKeys(): ApiKeyServiceAsync = apiKeys + override fun create( params: ServiceAccountCreateParams, requestOptions: RequestOptions, @@ -86,6 +92,10 @@ internal constructor(private val clientOptions: ClientOptions) : ServiceAccountS private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + private val apiKeys: ApiKeyServiceAsync.WithRawResponse by lazy { + ApiKeyServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + override fun withOptions( modifier: Consumer ): ServiceAccountServiceAsync.WithRawResponse = @@ -93,6 +103,8 @@ internal constructor(private val clientOptions: ClientOptions) : ServiceAccountS clientOptions.toBuilder().apply(modifier::accept).build() ) + override fun apiKeys(): ApiKeyServiceAsync.WithRawResponse = apiKeys + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/admin/organization/projects/serviceaccounts/ApiKeyServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/admin/organization/projects/serviceaccounts/ApiKeyServiceAsync.kt new file mode 100644 index 000000000..5ed8ef44c --- /dev/null +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/admin/organization/projects/serviceaccounts/ApiKeyServiceAsync.kt @@ -0,0 +1,97 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openai.services.async.admin.organization.projects.serviceaccounts + +import com.openai.core.ClientOptions +import com.openai.core.RequestOptions +import com.openai.core.http.HttpResponseFor +import com.openai.models.admin.organization.projects.serviceaccounts.apikeys.ApiKeyCreateParams +import com.openai.models.admin.organization.projects.serviceaccounts.apikeys.ApiKeyCreateResponse +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface ApiKeyServiceAsync { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): ApiKeyServiceAsync + + /** Creates an API key for a service account in the project. */ + fun create( + serviceAccountId: String, + params: ApiKeyCreateParams, + ): CompletableFuture = + create(serviceAccountId, params, RequestOptions.none()) + + /** @see create */ + fun create( + serviceAccountId: String, + params: ApiKeyCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + create(params.toBuilder().serviceAccountId(serviceAccountId).build(), requestOptions) + + /** @see create */ + fun create(params: ApiKeyCreateParams): CompletableFuture = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: ApiKeyCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** + * A view of [ApiKeyServiceAsync] that provides access to raw HTTP responses for each method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): ApiKeyServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `post + * /organization/projects/{project_id}/service_accounts/{service_account_id}/api_keys`, but + * is otherwise the same as [ApiKeyServiceAsync.create]. + */ + fun create( + serviceAccountId: String, + params: ApiKeyCreateParams, + ): CompletableFuture> = + create(serviceAccountId, params, RequestOptions.none()) + + /** @see create */ + fun create( + serviceAccountId: String, + params: ApiKeyCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + create(params.toBuilder().serviceAccountId(serviceAccountId).build(), requestOptions) + + /** @see create */ + fun create( + params: ApiKeyCreateParams + ): CompletableFuture> = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: ApiKeyCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + } +} diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/admin/organization/projects/serviceaccounts/ApiKeyServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/admin/organization/projects/serviceaccounts/ApiKeyServiceAsyncImpl.kt new file mode 100644 index 000000000..ed835208a --- /dev/null +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/admin/organization/projects/serviceaccounts/ApiKeyServiceAsyncImpl.kt @@ -0,0 +1,103 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openai.services.async.admin.organization.projects.serviceaccounts + +import com.openai.core.ClientOptions +import com.openai.core.RequestOptions +import com.openai.core.SecurityOptions +import com.openai.core.checkRequired +import com.openai.core.handlers.errorBodyHandler +import com.openai.core.handlers.errorHandler +import com.openai.core.handlers.jsonHandler +import com.openai.core.http.HttpMethod +import com.openai.core.http.HttpRequest +import com.openai.core.http.HttpResponse +import com.openai.core.http.HttpResponse.Handler +import com.openai.core.http.HttpResponseFor +import com.openai.core.http.json +import com.openai.core.http.parseable +import com.openai.core.prepareAsync +import com.openai.models.admin.organization.projects.serviceaccounts.apikeys.ApiKeyCreateParams +import com.openai.models.admin.organization.projects.serviceaccounts.apikeys.ApiKeyCreateResponse +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class ApiKeyServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + ApiKeyServiceAsync { + + private val withRawResponse: ApiKeyServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): ApiKeyServiceAsync.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): ApiKeyServiceAsync = + ApiKeyServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun create( + params: ApiKeyCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /organization/projects/{project_id}/service_accounts/{service_account_id}/api_keys + withRawResponse().create(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + ApiKeyServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): ApiKeyServiceAsync.WithRawResponse = + ApiKeyServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: ApiKeyCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("serviceAccountId", params.serviceAccountId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments( + "organization", + "projects", + params._pathParam(0), + "service_accounts", + params._pathParam(1), + "api_keys", + ) + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepareAsync( + clientOptions, + params, + SecurityOptions.builder().adminApiKeyAuth(true).build(), + ) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + } +} diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/admin/organization/projects/ServiceAccountService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/admin/organization/projects/ServiceAccountService.kt index 5860e6c45..b30d500b3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/admin/organization/projects/ServiceAccountService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/admin/organization/projects/ServiceAccountService.kt @@ -15,6 +15,7 @@ import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAcco import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountListParams import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountRetrieveParams import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountUpdateParams +import com.openai.services.blocking.admin.organization.projects.serviceaccounts.ApiKeyService import java.util.function.Consumer interface ServiceAccountService { @@ -31,9 +32,11 @@ interface ServiceAccountService { */ fun withOptions(modifier: Consumer): ServiceAccountService + fun apiKeys(): ApiKeyService + /** - * Creates a new service account in the project. This also returns an unredacted API key for the - * service account. + * Creates a new service account in the project. By default, this also returns an unredacted API + * key for the service account. */ fun create( projectId: String, @@ -181,6 +184,8 @@ interface ServiceAccountService { modifier: Consumer ): ServiceAccountService.WithRawResponse + fun apiKeys(): ApiKeyService.WithRawResponse + /** * Returns a raw HTTP response for `post * /organization/projects/{project_id}/service_accounts`, but is otherwise the same as diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/admin/organization/projects/ServiceAccountServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/admin/organization/projects/ServiceAccountServiceImpl.kt index 51a3e8b9c..92e79334d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/admin/organization/projects/ServiceAccountServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/admin/organization/projects/ServiceAccountServiceImpl.kt @@ -27,6 +27,8 @@ import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAcco import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountListParams import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountRetrieveParams import com.openai.models.admin.organization.projects.serviceaccounts.ServiceAccountUpdateParams +import com.openai.services.blocking.admin.organization.projects.serviceaccounts.ApiKeyService +import com.openai.services.blocking.admin.organization.projects.serviceaccounts.ApiKeyServiceImpl import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -37,11 +39,15 @@ class ServiceAccountServiceImpl internal constructor(private val clientOptions: WithRawResponseImpl(clientOptions) } + private val apiKeys: ApiKeyService by lazy { ApiKeyServiceImpl(clientOptions) } + override fun withRawResponse(): ServiceAccountService.WithRawResponse = withRawResponse override fun withOptions(modifier: Consumer): ServiceAccountService = ServiceAccountServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun apiKeys(): ApiKeyService = apiKeys + override fun create( params: ServiceAccountCreateParams, requestOptions: RequestOptions, @@ -83,6 +89,10 @@ class ServiceAccountServiceImpl internal constructor(private val clientOptions: private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + private val apiKeys: ApiKeyService.WithRawResponse by lazy { + ApiKeyServiceImpl.WithRawResponseImpl(clientOptions) + } + override fun withOptions( modifier: Consumer ): ServiceAccountService.WithRawResponse = @@ -90,6 +100,8 @@ class ServiceAccountServiceImpl internal constructor(private val clientOptions: clientOptions.toBuilder().apply(modifier::accept).build() ) + override fun apiKeys(): ApiKeyService.WithRawResponse = apiKeys + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/admin/organization/projects/serviceaccounts/ApiKeyService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/admin/organization/projects/serviceaccounts/ApiKeyService.kt new file mode 100644 index 000000000..6ded38ee5 --- /dev/null +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/admin/organization/projects/serviceaccounts/ApiKeyService.kt @@ -0,0 +1,92 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openai.services.blocking.admin.organization.projects.serviceaccounts + +import com.google.errorprone.annotations.MustBeClosed +import com.openai.core.ClientOptions +import com.openai.core.RequestOptions +import com.openai.core.http.HttpResponseFor +import com.openai.models.admin.organization.projects.serviceaccounts.apikeys.ApiKeyCreateParams +import com.openai.models.admin.organization.projects.serviceaccounts.apikeys.ApiKeyCreateResponse +import java.util.function.Consumer + +interface ApiKeyService { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): ApiKeyService + + /** Creates an API key for a service account in the project. */ + fun create(serviceAccountId: String, params: ApiKeyCreateParams): ApiKeyCreateResponse = + create(serviceAccountId, params, RequestOptions.none()) + + /** @see create */ + fun create( + serviceAccountId: String, + params: ApiKeyCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): ApiKeyCreateResponse = + create(params.toBuilder().serviceAccountId(serviceAccountId).build(), requestOptions) + + /** @see create */ + fun create(params: ApiKeyCreateParams): ApiKeyCreateResponse = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: ApiKeyCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): ApiKeyCreateResponse + + /** A view of [ApiKeyService] that provides access to raw HTTP responses for each method. */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): ApiKeyService.WithRawResponse + + /** + * Returns a raw HTTP response for `post + * /organization/projects/{project_id}/service_accounts/{service_account_id}/api_keys`, but + * is otherwise the same as [ApiKeyService.create]. + */ + @MustBeClosed + fun create( + serviceAccountId: String, + params: ApiKeyCreateParams, + ): HttpResponseFor = + create(serviceAccountId, params, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create( + serviceAccountId: String, + params: ApiKeyCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + create(params.toBuilder().serviceAccountId(serviceAccountId).build(), requestOptions) + + /** @see create */ + @MustBeClosed + fun create(params: ApiKeyCreateParams): HttpResponseFor = + create(params, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create( + params: ApiKeyCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + } +} diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/admin/organization/projects/serviceaccounts/ApiKeyServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/admin/organization/projects/serviceaccounts/ApiKeyServiceImpl.kt new file mode 100644 index 000000000..a0e661061 --- /dev/null +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/admin/organization/projects/serviceaccounts/ApiKeyServiceImpl.kt @@ -0,0 +1,99 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openai.services.blocking.admin.organization.projects.serviceaccounts + +import com.openai.core.ClientOptions +import com.openai.core.RequestOptions +import com.openai.core.SecurityOptions +import com.openai.core.checkRequired +import com.openai.core.handlers.errorBodyHandler +import com.openai.core.handlers.errorHandler +import com.openai.core.handlers.jsonHandler +import com.openai.core.http.HttpMethod +import com.openai.core.http.HttpRequest +import com.openai.core.http.HttpResponse +import com.openai.core.http.HttpResponse.Handler +import com.openai.core.http.HttpResponseFor +import com.openai.core.http.json +import com.openai.core.http.parseable +import com.openai.core.prepare +import com.openai.models.admin.organization.projects.serviceaccounts.apikeys.ApiKeyCreateParams +import com.openai.models.admin.organization.projects.serviceaccounts.apikeys.ApiKeyCreateResponse +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class ApiKeyServiceImpl internal constructor(private val clientOptions: ClientOptions) : + ApiKeyService { + + private val withRawResponse: ApiKeyService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): ApiKeyService.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): ApiKeyService = + ApiKeyServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun create( + params: ApiKeyCreateParams, + requestOptions: RequestOptions, + ): ApiKeyCreateResponse = + // post /organization/projects/{project_id}/service_accounts/{service_account_id}/api_keys + withRawResponse().create(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + ApiKeyService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): ApiKeyService.WithRawResponse = + ApiKeyServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: ApiKeyCreateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("serviceAccountId", params.serviceAccountId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments( + "organization", + "projects", + params._pathParam(0), + "service_accounts", + params._pathParam(1), + "api_keys", + ) + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare( + clientOptions, + params, + SecurityOptions.builder().adminApiKeyAuth(true).build(), + ) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } +} diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateParamsTest.kt index 9073cd4b1..ad8c0928b 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateParamsTest.kt @@ -9,7 +9,11 @@ internal class ServiceAccountCreateParamsTest { @Test fun create() { - ServiceAccountCreateParams.builder().projectId("project_id").name("name").build() + ServiceAccountCreateParams.builder() + .projectId("project_id") + .name("name") + .createServiceAccountOnly(true) + .build() } @Test @@ -24,6 +28,21 @@ internal class ServiceAccountCreateParamsTest { @Test fun body() { + val params = + ServiceAccountCreateParams.builder() + .projectId("project_id") + .name("name") + .createServiceAccountOnly(true) + .build() + + val body = params._body() + + assertThat(body.name()).isEqualTo("name") + assertThat(body.createServiceAccountOnly()).contains(true) + } + + @Test + fun bodyWithoutOptionalFields() { val params = ServiceAccountCreateParams.builder().projectId("project_id").name("name").build() diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateResponseTest.kt index 51fbf0299..3e6efbd39 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/ServiceAccountCreateResponseTest.kt @@ -24,6 +24,7 @@ internal class ServiceAccountCreateResponseTest { ) .createdAt(0L) .name("name") + .role(ServiceAccountCreateResponse.Role.MEMBER) .build() assertThat(serviceAccountCreateResponse.id()).isEqualTo("id") @@ -38,6 +39,8 @@ internal class ServiceAccountCreateResponseTest { ) assertThat(serviceAccountCreateResponse.createdAt()).isEqualTo(0L) assertThat(serviceAccountCreateResponse.name()).isEqualTo("name") + assertThat(serviceAccountCreateResponse.role()) + .isEqualTo(ServiceAccountCreateResponse.Role.MEMBER) } @Test @@ -56,6 +59,7 @@ internal class ServiceAccountCreateResponseTest { ) .createdAt(0L) .name("name") + .role(ServiceAccountCreateResponse.Role.MEMBER) .build() val roundtrippedServiceAccountCreateResponse = diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/apikeys/ApiKeyCreateParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/apikeys/ApiKeyCreateParamsTest.kt new file mode 100644 index 000000000..a4d226544 --- /dev/null +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/apikeys/ApiKeyCreateParamsTest.kt @@ -0,0 +1,61 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openai.models.admin.organization.projects.serviceaccounts.apikeys + +import kotlin.jvm.optionals.getOrNull +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ApiKeyCreateParamsTest { + + @Test + fun create() { + ApiKeyCreateParams.builder() + .projectId("project_id") + .serviceAccountId("service_account_id") + .name("name") + .addScope("string") + .build() + } + + @Test + fun pathParams() { + val params = + ApiKeyCreateParams.builder() + .projectId("project_id") + .serviceAccountId("service_account_id") + .build() + + assertThat(params._pathParam(0)).isEqualTo("project_id") + assertThat(params._pathParam(1)).isEqualTo("service_account_id") + // out-of-bound path param + assertThat(params._pathParam(2)).isEqualTo("") + } + + @Test + fun body() { + val params = + ApiKeyCreateParams.builder() + .projectId("project_id") + .serviceAccountId("service_account_id") + .name("name") + .addScope("string") + .build() + + val body = params._body() + + assertThat(body.name()).contains("name") + assertThat(body.scopes().getOrNull()).containsExactly("string") + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + ApiKeyCreateParams.builder() + .projectId("project_id") + .serviceAccountId("service_account_id") + .build() + + val body = params._body() + } +} diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/apikeys/ApiKeyCreateResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/apikeys/ApiKeyCreateResponseTest.kt new file mode 100644 index 000000000..9559a9554 --- /dev/null +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/serviceaccounts/apikeys/ApiKeyCreateResponseTest.kt @@ -0,0 +1,47 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openai.models.admin.organization.projects.serviceaccounts.apikeys + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.openai.core.jsonMapper +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ApiKeyCreateResponseTest { + + @Test + fun create() { + val apiKeyCreateResponse = + ApiKeyCreateResponse.builder() + .id("id") + .createdAt(0L) + .name("name") + .value("value") + .build() + + assertThat(apiKeyCreateResponse.id()).isEqualTo("id") + assertThat(apiKeyCreateResponse.createdAt()).isEqualTo(0L) + assertThat(apiKeyCreateResponse.name()).isEqualTo("name") + assertThat(apiKeyCreateResponse.value()).isEqualTo("value") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val apiKeyCreateResponse = + ApiKeyCreateResponse.builder() + .id("id") + .createdAt(0L) + .name("name") + .value("value") + .build() + + val roundtrippedApiKeyCreateResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(apiKeyCreateResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedApiKeyCreateResponse).isEqualTo(apiKeyCreateResponse) + } +} diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponseTest.kt index d5609e1e4..0c7a000cc 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponseTest.kt @@ -26,9 +26,18 @@ internal class UsageAudioSpeechesResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -54,9 +63,18 @@ internal class UsageAudioSpeechesResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -87,9 +105,18 @@ internal class UsageAudioSpeechesResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponseTest.kt index 3d3795be2..8ea73e04b 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponseTest.kt @@ -26,9 +26,18 @@ internal class UsageAudioTranscriptionsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -55,9 +64,18 @@ internal class UsageAudioTranscriptionsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -88,9 +106,18 @@ internal class UsageAudioTranscriptionsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponseTest.kt index 9f22f5f1b..9f744b792 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponseTest.kt @@ -26,9 +26,18 @@ internal class UsageCodeInterpreterSessionsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -55,9 +64,18 @@ internal class UsageCodeInterpreterSessionsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -88,9 +106,18 @@ internal class UsageCodeInterpreterSessionsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponseTest.kt index 808d5cae1..c85872006 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponseTest.kt @@ -25,9 +25,18 @@ internal class UsageCompletionsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -53,9 +62,18 @@ internal class UsageCompletionsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -85,9 +103,18 @@ internal class UsageCompletionsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponseTest.kt index d540912e0..ba2f20641 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponseTest.kt @@ -25,9 +25,18 @@ internal class UsageCostsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -52,9 +61,18 @@ internal class UsageCostsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -84,9 +102,18 @@ internal class UsageCostsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponseTest.kt index f116ab88b..7073d60c7 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponseTest.kt @@ -25,9 +25,18 @@ internal class UsageEmbeddingsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -53,9 +62,18 @@ internal class UsageEmbeddingsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -85,9 +103,18 @@ internal class UsageEmbeddingsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponseTest.kt index c7021a07c..d5878abee 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponseTest.kt @@ -26,9 +26,18 @@ internal class UsageFileSearchCallsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -54,9 +63,18 @@ internal class UsageFileSearchCallsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -87,9 +105,18 @@ internal class UsageFileSearchCallsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponseTest.kt index d1c315384..9825290f0 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponseTest.kt @@ -25,9 +25,18 @@ internal class UsageImagesResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -52,9 +61,18 @@ internal class UsageImagesResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -84,9 +102,18 @@ internal class UsageImagesResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponseTest.kt index 86f12cb14..5bac27144 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponseTest.kt @@ -25,9 +25,18 @@ internal class UsageModerationsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -53,9 +62,18 @@ internal class UsageModerationsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -85,9 +103,18 @@ internal class UsageModerationsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponseTest.kt index e8121c949..374a5499e 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponseTest.kt @@ -25,9 +25,18 @@ internal class UsageVectorStoresResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -53,9 +62,18 @@ internal class UsageVectorStoresResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -85,9 +103,18 @@ internal class UsageVectorStoresResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponseTest.kt index bf6f0f40f..4302a1c98 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponseTest.kt @@ -26,9 +26,18 @@ internal class UsageWebSearchCallsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -54,9 +63,18 @@ internal class UsageWebSearchCallsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") @@ -87,9 +105,18 @@ internal class UsageWebSearchCallsResponseTest { .apiKeyId("api_key_id") .batch(true) .inputAudioTokens(0L) + .inputCacheWriteTokens(0L) + .inputCachedAudioTokens(0L) + .inputCachedImageTokens(0L) + .inputCachedTextTokens(0L) .inputCachedTokens(0L) + .inputImageTokens(0L) + .inputTextTokens(0L) + .inputUncachedTokens(0L) .model("model") .outputAudioTokens(0L) + .outputImageTokens(0L) + .outputTextTokens(0L) .projectId("project_id") .serviceTier("service_tier") .userId("user_id") diff --git a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputItemTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputItemTest.kt index 5caf40e7f..33354115b 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputItemTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseInputItemTest.kt @@ -1081,16 +1081,14 @@ internal class BetaResponseInputItemTest { .addOutput( BetaResponseInputItem.MultiAgentCallOutput.Output.builder() .text("text") - .annotationsOfBetaFileCitationParams( - listOf( - BetaResponseInputItem.MultiAgentCallOutput.Output.Annotations - .BetaFileCitationParam - .builder() - .fileId("file-123") - .filename("filename") - .index(0L) - .build() - ) + .addAnnotation( + BetaResponseInputItem.MultiAgentCallOutput.Output.Annotation + .FileCitation + .builder() + .fileId("file-123") + .filename("filename") + .index(0L) + .build() ) .build() ) @@ -1153,16 +1151,14 @@ internal class BetaResponseInputItemTest { .addOutput( BetaResponseInputItem.MultiAgentCallOutput.Output.builder() .text("text") - .annotationsOfBetaFileCitationParams( - listOf( - BetaResponseInputItem.MultiAgentCallOutput.Output.Annotations - .BetaFileCitationParam - .builder() - .fileId("file-123") - .filename("filename") - .index(0L) - .build() - ) + .addAnnotation( + BetaResponseInputItem.MultiAgentCallOutput.Output.Annotation + .FileCitation + .builder() + .fileId("file-123") + .filename("filename") + .index(0L) + .build() ) .build() ) diff --git a/openai-java-core/src/test/kotlin/com/openai/services/async/admin/organization/projects/ServiceAccountServiceAsyncTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/async/admin/organization/projects/ServiceAccountServiceAsyncTest.kt index 464914456..0531e6a93 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/async/admin/organization/projects/ServiceAccountServiceAsyncTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/async/admin/organization/projects/ServiceAccountServiceAsyncTest.kt @@ -26,7 +26,11 @@ internal class ServiceAccountServiceAsyncTest { val serviceAccountFuture = serviceAccountServiceAsync.create( - ServiceAccountCreateParams.builder().projectId("project_id").name("name").build() + ServiceAccountCreateParams.builder() + .projectId("project_id") + .name("name") + .createServiceAccountOnly(true) + .build() ) val serviceAccount = serviceAccountFuture.get() diff --git a/openai-java-core/src/test/kotlin/com/openai/services/async/admin/organization/projects/serviceaccounts/ApiKeyServiceAsyncTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/async/admin/organization/projects/serviceaccounts/ApiKeyServiceAsyncTest.kt new file mode 100644 index 000000000..9ab36df3a --- /dev/null +++ b/openai-java-core/src/test/kotlin/com/openai/services/async/admin/organization/projects/serviceaccounts/ApiKeyServiceAsyncTest.kt @@ -0,0 +1,38 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openai.services.async.admin.organization.projects.serviceaccounts + +import com.openai.TestServerExtension +import com.openai.client.okhttp.OpenAIOkHttpClientAsync +import com.openai.models.admin.organization.projects.serviceaccounts.apikeys.ApiKeyCreateParams +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class ApiKeyServiceAsyncTest { + + @Test + fun create() { + val client = + OpenAIOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .adminApiKey("My Admin API Key") + .build() + val apiKeyServiceAsync = + client.admin().organization().projects().serviceAccounts().apiKeys() + + val apiKeyFuture = + apiKeyServiceAsync.create( + ApiKeyCreateParams.builder() + .projectId("project_id") + .serviceAccountId("service_account_id") + .name("name") + .addScope("string") + .build() + ) + + val apiKey = apiKeyFuture.get() + apiKey.validate() + } +} diff --git a/openai-java-core/src/test/kotlin/com/openai/services/blocking/admin/organization/projects/ServiceAccountServiceTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/blocking/admin/organization/projects/ServiceAccountServiceTest.kt index 2a29c4c53..4ebd7929b 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/blocking/admin/organization/projects/ServiceAccountServiceTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/blocking/admin/organization/projects/ServiceAccountServiceTest.kt @@ -26,7 +26,11 @@ internal class ServiceAccountServiceTest { val serviceAccount = serviceAccountService.create( - ServiceAccountCreateParams.builder().projectId("project_id").name("name").build() + ServiceAccountCreateParams.builder() + .projectId("project_id") + .name("name") + .createServiceAccountOnly(true) + .build() ) serviceAccount.validate() diff --git a/openai-java-core/src/test/kotlin/com/openai/services/blocking/admin/organization/projects/serviceaccounts/ApiKeyServiceTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/blocking/admin/organization/projects/serviceaccounts/ApiKeyServiceTest.kt new file mode 100644 index 000000000..5bc1fb380 --- /dev/null +++ b/openai-java-core/src/test/kotlin/com/openai/services/blocking/admin/organization/projects/serviceaccounts/ApiKeyServiceTest.kt @@ -0,0 +1,36 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openai.services.blocking.admin.organization.projects.serviceaccounts + +import com.openai.TestServerExtension +import com.openai.client.okhttp.OpenAIOkHttpClient +import com.openai.models.admin.organization.projects.serviceaccounts.apikeys.ApiKeyCreateParams +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class ApiKeyServiceTest { + + @Test + fun create() { + val client = + OpenAIOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .adminApiKey("My Admin API Key") + .build() + val apiKeyService = client.admin().organization().projects().serviceAccounts().apiKeys() + + val apiKey = + apiKeyService.create( + ApiKeyCreateParams.builder() + .projectId("project_id") + .serviceAccountId("service_account_id") + .name("name") + .addScope("string") + .build() + ) + + apiKey.validate() + } +}