Interface MessageService
-
- All Implemented Interfaces:
public interface MessageService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceMessageService.WithRawResponseA view of MessageService that provides access to raw HTTP responses for each method.
-
Method Summary
Modifier and Type Method Description abstract MessageService.WithRawResponsewithRawResponse()Returns a view of this service that provides access to raw HTTP responses for each method. abstract BatchServicebatches()Messagecreate(MessageCreateParams params)Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation. abstract Messagecreate(MessageCreateParams params, RequestOptions requestOptions)StreamResponse<RawMessageStreamEvent>createStreaming(MessageCreateParams params)Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation. abstract StreamResponse<RawMessageStreamEvent>createStreaming(MessageCreateParams params, RequestOptions requestOptions)MessageTokensCountcountTokens(MessageCountTokensParams params)Count the number of tokens in a Message. abstract MessageTokensCountcountTokens(MessageCountTokensParams params, RequestOptions requestOptions)-
-
Method Detail
-
withRawResponse
abstract MessageService.WithRawResponse withRawResponse()
Returns a view of this service that provides access to raw HTTP responses for each method.
-
batches
abstract BatchService batches()
-
create
Message create(MessageCreateParams params)
Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
The Messages API can be used for either single queries or stateless multi-turn conversations.
Learn more about the Messages API in our /en/docs/initial-setup
-
create
abstract Message create(MessageCreateParams params, RequestOptions requestOptions)
-
createStreaming
@MustBeClosed() StreamResponse<RawMessageStreamEvent> createStreaming(MessageCreateParams params)
Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
The Messages API can be used for either single queries or stateless multi-turn conversations.
Learn more about the Messages API in our /en/docs/initial-setup
-
createStreaming
@MustBeClosed() abstract StreamResponse<RawMessageStreamEvent> createStreaming(MessageCreateParams params, RequestOptions requestOptions)
-
countTokens
MessageTokensCount countTokens(MessageCountTokensParams params)
Count the number of tokens in a Message.
The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it.
Learn more about token counting in our /en/docs/build-with-claude/token-counting
-
countTokens
abstract MessageTokensCount countTokens(MessageCountTokensParams params, RequestOptions requestOptions)
-
-
-
-