Package com.anthropic.client
Class AnthropicClientAsyncImpl
-
- All Implemented Interfaces:
-
com.anthropic.client.AnthropicClientAsync
public final class AnthropicClientAsyncImpl implements AnthropicClientAsync
-
-
Constructor Summary
Constructors Constructor Description AnthropicClientAsyncImpl(ClientOptions clientOptions)
-
Method Summary
Modifier and Type Method Description AnthropicClientsync()Returns a version of this client that uses synchronous execution. CompletionServiceAsynccompletions()MessageServiceAsyncmessages()ModelServiceAsyncmodels()BetaServiceAsyncbeta()Unitclose()Closes this client, relinquishing any underlying resources. -
-
Constructor Detail
-
AnthropicClientAsyncImpl
AnthropicClientAsyncImpl(ClientOptions clientOptions)
-
-
Method Detail
-
sync
AnthropicClient sync()
Returns a version of this client that uses synchronous execution.
The returned client shares its resources, like its connection pool and thread pools, with this client.
-
completions
CompletionServiceAsync completions()
-
messages
MessageServiceAsync messages()
-
models
ModelServiceAsync models()
-
beta
BetaServiceAsync beta()
-
close
Unit close()
Closes this client, relinquishing any underlying resources.
This is purposefully not inherited from AutoCloseable because the client is long-lived and usually should not be synchronously closed via try-with-resources.
It's also usually not necessary to call this method at all. the default HTTP client automatically releases threads and connections if they remain idle, but if you are writing an application that needs to aggressively release unused resources, then you may call this method.
-
-
-
-