Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.47.0"
".": "2.47.1"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 116
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-dffbd6e37f0be6d218800cdb283e5ad958c715021986d788e10c89c0a80a9f44.yml
openapi_spec_hash: 753042938edfcbf43eb60c63c3369a30
config_hash: 2fc184efddefac872a2f58876711b4f5
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-22e4e7c84b8efa6d1777ad68e350fe88205ca55933c9b1042bcf04fc6437825f.yml
openapi_spec_hash: f61203a73768b7175003b648c986e3f9
config_hash: 6850143d4cb11e40948430dd9ee88369
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2.47.1 (2026-07-01)

Full Changelog: [v2.47.0...v2.47.1](https://github.com/anthropics/anthropic-sdk-java/compare/v2.47.0...v2.47.1)

### Chores

* **api:** remove some nonfunctional types from the SDKs ([2f92a48](https://github.com/anthropics/anthropic-sdk-java/commit/2f92a48d5e6b7dde8efebc493c96def5ddcbe523))

## 2.47.0 (2026-06-30)

Full Changelog: [v2.46.0...v2.47.0](https://github.com/anthropics/anthropic-sdk-java/compare/v2.46.0...v2.47.0)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Full documentation is available at **[platform.claude.com/docs/en/api/sdks/java]
### Gradle

```kotlin
implementation("com.anthropic:anthropic-java:2.47.0")
implementation("com.anthropic:anthropic-java:2.47.1")
```

### Maven
Expand All @@ -24,7 +24,7 @@ implementation("com.anthropic:anthropic-java:2.47.0")
<dependency>
<groupId>com.anthropic</groupId>
<artifactId>anthropic-java</artifactId>
<version>2.47.0</version>
<version>2.47.1</version>
</dependency>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ private constructor(
private val environmentId: JsonField<String>,
private val latestHeartbeatAt: JsonField<String>,
private val metadata: JsonField<Metadata>,
private val secret: JsonField<String>,
private val startedAt: JsonField<String>,
private val state: JsonField<State>,
private val stopRequestedAt: JsonField<String>,
Expand All @@ -61,7 +60,6 @@ private constructor(
@ExcludeMissing
latestHeartbeatAt: JsonField<String> = JsonMissing.of(),
@JsonProperty("metadata") @ExcludeMissing metadata: JsonField<Metadata> = JsonMissing.of(),
@JsonProperty("secret") @ExcludeMissing secret: JsonField<String> = JsonMissing.of(),
@JsonProperty("started_at") @ExcludeMissing startedAt: JsonField<String> = JsonMissing.of(),
@JsonProperty("state") @ExcludeMissing state: JsonField<State> = JsonMissing.of(),
@JsonProperty("stop_requested_at")
Expand All @@ -77,7 +75,6 @@ private constructor(
environmentId,
latestHeartbeatAt,
metadata,
secret,
startedAt,
state,
stopRequestedAt,
Expand Down Expand Up @@ -142,15 +139,6 @@ private constructor(
*/
fun metadata(): Metadata = metadata.getRequired("metadata")

/**
* Credential payload used by the environment worker to execute this work item. May be populated
* when polling for work; null on all other retrieval paths.
*
* @throws AnthropicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun secret(): Optional<String> = secret.getOptional("secret")

/**
* RFC 3339 timestamp when work execution started
*
Expand Down Expand Up @@ -252,13 +240,6 @@ private constructor(
*/
@JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField<Metadata> = metadata

/**
* Returns the raw JSON value of [secret].
*
* Unlike [secret], this method doesn't throw if the JSON field has an unexpected type.
*/
@JsonProperty("secret") @ExcludeMissing fun _secret(): JsonField<String> = secret

/**
* Returns the raw JSON value of [startedAt].
*
Expand Down Expand Up @@ -315,7 +296,6 @@ private constructor(
* .environmentId()
* .latestHeartbeatAt()
* .metadata()
* .secret()
* .startedAt()
* .state()
* .stopRequestedAt()
Expand All @@ -335,7 +315,6 @@ private constructor(
private var environmentId: JsonField<String>? = null
private var latestHeartbeatAt: JsonField<String>? = null
private var metadata: JsonField<Metadata>? = null
private var secret: JsonField<String>? = null
private var startedAt: JsonField<String>? = null
private var state: JsonField<State>? = null
private var stopRequestedAt: JsonField<String>? = null
Expand All @@ -352,7 +331,6 @@ private constructor(
environmentId = betaSelfHostedWork.environmentId
latestHeartbeatAt = betaSelfHostedWork.latestHeartbeatAt
metadata = betaSelfHostedWork.metadata
secret = betaSelfHostedWork.secret
startedAt = betaSelfHostedWork.startedAt
state = betaSelfHostedWork.state
stopRequestedAt = betaSelfHostedWork.stopRequestedAt
Expand Down Expand Up @@ -463,23 +441,6 @@ private constructor(
*/
fun metadata(metadata: JsonField<Metadata>) = apply { this.metadata = metadata }

/**
* Credential payload used by the environment worker to execute this work item. May be
* populated when polling for work; null on all other retrieval paths.
*/
fun secret(secret: String?) = secret(JsonField.ofNullable(secret))

/** Alias for calling [Builder.secret] with `secret.orElse(null)`. */
fun secret(secret: Optional<String>) = secret(secret.getOrNull())

/**
* Sets [Builder.secret] to an arbitrary JSON value.
*
* You should usually call [Builder.secret] with a well-typed [String] value instead. This
* method is primarily for setting the field to an undocumented or not yet supported value.
*/
fun secret(secret: JsonField<String>) = apply { this.secret = secret }

/** RFC 3339 timestamp when work execution started */
fun startedAt(startedAt: String?) = startedAt(JsonField.ofNullable(startedAt))

Expand Down Expand Up @@ -587,7 +548,6 @@ private constructor(
* .environmentId()
* .latestHeartbeatAt()
* .metadata()
* .secret()
* .startedAt()
* .state()
* .stopRequestedAt()
Expand All @@ -605,7 +565,6 @@ private constructor(
checkRequired("environmentId", environmentId),
checkRequired("latestHeartbeatAt", latestHeartbeatAt),
checkRequired("metadata", metadata),
checkRequired("secret", secret),
checkRequired("startedAt", startedAt),
checkRequired("state", state),
checkRequired("stopRequestedAt", stopRequestedAt),
Expand Down Expand Up @@ -637,7 +596,6 @@ private constructor(
environmentId()
latestHeartbeatAt()
metadata().validate()
secret()
startedAt()
state().validate()
stopRequestedAt()
Expand Down Expand Up @@ -672,7 +630,6 @@ private constructor(
(if (environmentId.asKnown().isPresent) 1 else 0) +
(if (latestHeartbeatAt.asKnown().isPresent) 1 else 0) +
(metadata.asKnown().getOrNull()?.validity() ?: 0) +
(if (secret.asKnown().isPresent) 1 else 0) +
(if (startedAt.asKnown().isPresent) 1 else 0) +
(state.asKnown().getOrNull()?.validity() ?: 0) +
(if (stopRequestedAt.asKnown().isPresent) 1 else 0) +
Expand Down Expand Up @@ -956,7 +913,6 @@ private constructor(
environmentId == other.environmentId &&
latestHeartbeatAt == other.latestHeartbeatAt &&
metadata == other.metadata &&
secret == other.secret &&
startedAt == other.startedAt &&
state == other.state &&
stopRequestedAt == other.stopRequestedAt &&
Expand All @@ -974,7 +930,6 @@ private constructor(
environmentId,
latestHeartbeatAt,
metadata,
secret,
startedAt,
state,
stopRequestedAt,
Expand All @@ -987,5 +942,5 @@ private constructor(
override fun hashCode(): Int = hashCode

override fun toString() =
"BetaSelfHostedWork{id=$id, acknowledgedAt=$acknowledgedAt, createdAt=$createdAt, data=$data, environmentId=$environmentId, latestHeartbeatAt=$latestHeartbeatAt, metadata=$metadata, secret=$secret, startedAt=$startedAt, state=$state, stopRequestedAt=$stopRequestedAt, stoppedAt=$stoppedAt, type=$type, additionalProperties=$additionalProperties}"
"BetaSelfHostedWork{id=$id, acknowledgedAt=$acknowledgedAt, createdAt=$createdAt, data=$data, environmentId=$environmentId, latestHeartbeatAt=$latestHeartbeatAt, metadata=$metadata, startedAt=$startedAt, state=$state, stopRequestedAt=$stopRequestedAt, stoppedAt=$stoppedAt, type=$type, additionalProperties=$additionalProperties}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,18 @@ private constructor(

fun memoryStoreId(): Optional<String> = Optional.ofNullable(memoryStoreId)

/** Query parameter for depth */
/**
* `0` (or omitted) returns all descendants below `path_prefix` (recursive). `1` returns
* immediate children only; deeper entries roll up as `memory_prefix` items. `depth=1` behaves
* like `ls`; omitting `depth` behaves like `find`.
*/
fun depth(): Optional<Int> = Optional.ofNullable(depth)

/** Query parameter for limit */
/**
* Maximum number of items to return per page. Must be between 1 and 100. Defaults to 20 when
* omitted. Capped at 20 when `view=full`. Both `memory` and `memory_prefix` items count toward
* the limit.
*/
fun limit(): Optional<Int> = Optional.ofNullable(limit)

/** Query parameter for order */
Expand All @@ -45,17 +53,23 @@ private constructor(
/** Query parameter for order_by */
fun orderBy(): Optional<String> = Optional.ofNullable(orderBy)

/** Query parameter for page */
/**
* Opaque pagination cursor (a `page_...` value). Pass the `next_page` value from a previous
* response to fetch the next page; omit for the first page.
*/
fun page(): Optional<String> = Optional.ofNullable(page)

/**
* Optional path prefix filter (raw string-prefix match; include a trailing slash for
* directory-scoped lists). This value appears in request URLs. Do not include secrets or
* personally identifiable information.
* Optional path prefix filter. Must end with `/` (segment-aligned), e.g., `/notes/`. This value
* appears in request URLs. Do not include secrets or personally identifiable information.
*/
fun pathPrefix(): Optional<String> = Optional.ofNullable(pathPrefix)

/** Query parameter for view */
/**
* Which projection of each `memory` to return. Defaults to `basic` (content omitted). `full`
* populates `content` on each item and caps `limit` at 20; use this as the bulk-read path for
* export and sync.
*/
fun view(): Optional<BetaManagedAgentsMemoryView> = Optional.ofNullable(view)

/** Optional header to specify the beta version(s) you want to use. */
Expand Down Expand Up @@ -113,7 +127,11 @@ private constructor(
fun memoryStoreId(memoryStoreId: Optional<String>) =
memoryStoreId(memoryStoreId.getOrNull())

/** Query parameter for depth */
/**
* `0` (or omitted) returns all descendants below `path_prefix` (recursive). `1` returns
* immediate children only; deeper entries roll up as `memory_prefix` items. `depth=1`
* behaves like `ls`; omitting `depth` behaves like `find`.
*/
fun depth(depth: Int?) = apply { this.depth = depth }

/**
Expand All @@ -126,7 +144,11 @@ private constructor(
/** Alias for calling [Builder.depth] with `depth.orElse(null)`. */
fun depth(depth: Optional<Int>) = depth(depth.getOrNull())

/** Query parameter for limit */
/**
* Maximum number of items to return per page. Must be between 1 and 100. Defaults to 20
* when omitted. Capped at 20 when `view=full`. Both `memory` and `memory_prefix` items
* count toward the limit.
*/
fun limit(limit: Int?) = apply { this.limit = limit }

/**
Expand All @@ -151,23 +173,30 @@ private constructor(
/** Alias for calling [Builder.orderBy] with `orderBy.orElse(null)`. */
fun orderBy(orderBy: Optional<String>) = orderBy(orderBy.getOrNull())

/** Query parameter for page */
/**
* Opaque pagination cursor (a `page_...` value). Pass the `next_page` value from a previous
* response to fetch the next page; omit for the first page.
*/
fun page(page: String?) = apply { this.page = page }

/** Alias for calling [Builder.page] with `page.orElse(null)`. */
fun page(page: Optional<String>) = page(page.getOrNull())

/**
* Optional path prefix filter (raw string-prefix match; include a trailing slash for
* directory-scoped lists). This value appears in request URLs. Do not include secrets or
* personally identifiable information.
* Optional path prefix filter. Must end with `/` (segment-aligned), e.g., `/notes/`. This
* value appears in request URLs. Do not include secrets or personally identifiable
* information.
*/
fun pathPrefix(pathPrefix: String?) = apply { this.pathPrefix = pathPrefix }

/** Alias for calling [Builder.pathPrefix] with `pathPrefix.orElse(null)`. */
fun pathPrefix(pathPrefix: Optional<String>) = pathPrefix(pathPrefix.getOrNull())

/** Query parameter for view */
/**
* Which projection of each `memory` to return. Defaults to `basic` (content omitted).
* `full` populates `content` on each item and caps `limit` at 20; use this as the bulk-read
* path for export and sync.
*/
fun view(view: BetaManagedAgentsMemoryView?) = apply { this.view = view }

/** Alias for calling [Builder.view] with `view.orElse(null)`. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ private constructor(

@JvmField val REASONING_EXTRACTION = of("reasoning_extraction")

@JvmField val MILITARY_WEAPONS = of("military_weapons")

@JvmStatic fun of(value: String) = Category(JsonField.of(value))
}

Expand All @@ -242,7 +240,6 @@ private constructor(
BIO,
FRONTIER_LLM,
REASONING_EXTRACTION,
MILITARY_WEAPONS,
}

/**
Expand All @@ -259,7 +256,6 @@ private constructor(
BIO,
FRONTIER_LLM,
REASONING_EXTRACTION,
MILITARY_WEAPONS,
/** An enum member indicating that [Category] was instantiated with an unknown value. */
_UNKNOWN,
}
Expand All @@ -277,7 +273,6 @@ private constructor(
BIO -> Value.BIO
FRONTIER_LLM -> Value.FRONTIER_LLM
REASONING_EXTRACTION -> Value.REASONING_EXTRACTION
MILITARY_WEAPONS -> Value.MILITARY_WEAPONS
else -> Value._UNKNOWN
}

Expand All @@ -296,7 +291,6 @@ private constructor(
BIO -> Known.BIO
FRONTIER_LLM -> Known.FRONTIER_LLM
REASONING_EXTRACTION -> Known.REASONING_EXTRACTION
MILITARY_WEAPONS -> Known.MILITARY_WEAPONS
else -> throw AnthropicInvalidDataException("Unknown Category: $value")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,6 @@ private constructor(

@JvmField val REASONING_EXTRACTION = of("reasoning_extraction")

@JvmField val MILITARY_WEAPONS = of("military_weapons")

@JvmStatic fun of(value: String) = Category(JsonField.of(value))
}

Expand All @@ -531,7 +529,6 @@ private constructor(
BIO,
FRONTIER_LLM,
REASONING_EXTRACTION,
MILITARY_WEAPONS,
}

/**
Expand All @@ -548,7 +545,6 @@ private constructor(
BIO,
FRONTIER_LLM,
REASONING_EXTRACTION,
MILITARY_WEAPONS,
/** An enum member indicating that [Category] was instantiated with an unknown value. */
_UNKNOWN,
}
Expand All @@ -566,7 +562,6 @@ private constructor(
BIO -> Value.BIO
FRONTIER_LLM -> Value.FRONTIER_LLM
REASONING_EXTRACTION -> Value.REASONING_EXTRACTION
MILITARY_WEAPONS -> Value.MILITARY_WEAPONS
else -> Value._UNKNOWN
}

Expand All @@ -585,7 +580,6 @@ private constructor(
BIO -> Known.BIO
FRONTIER_LLM -> Known.FRONTIER_LLM
REASONING_EXTRACTION -> Known.REASONING_EXTRACTION
MILITARY_WEAPONS -> Known.MILITARY_WEAPONS
else -> throw AnthropicInvalidDataException("Unknown Category: $value")
}

Expand Down
Loading
Loading