Class ClaudeMessage
Implements
Inherited Members
Namespace: Glitch9.AIDevKit.Anthropic
Assembly: Glitch9.AIDevKit.Provider.Anthropic.dll
Syntax
public sealed class ClaudeMessage : ClaudeResponse, IUsageProvider
Properties
| Edit this page View SourceContainer
Required. Information about the container used in this request.
This will be non-null if a container tool (e.g. code execution) was used.
Declaration
[JsonProperty("container")]
public AnthropicContainer Container { get; set; }
Property Value
| Type | Description |
|---|---|
| AnthropicContainer |
Content
Required. Content generated by the model.
This is an array of content blocks, each of which has a type that determines its shape.
Example:
[{"type": "text", "text": "Hi, I'm Claude."}]
If the request input messages ended with an assistant turn, then the response content will continue directly from that last turn. You can use this to constrain the model's output.
For example, if the input messages were:
[{"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"}, {"role": "assistant", "content": "The best answer is ("}]
Then the response content might be: [{"type": "text", "text": "B)"}]
Declaration
[JsonProperty("content")]
public StringOrArray<ContentBlock> Content { get; set; }
Property Value
| Type | Description |
|---|---|
| StringOrArray<ContentBlock> |
Model
Required. The model that handled the request.
Declaration
[JsonProperty("model")]
public string Model { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Role
Required. Conversational role of the generated message.
This will always be "assistant".
Declaration
[JsonProperty("role")]
public ChatRole Role { get; set; }
Property Value
| Type | Description |
|---|---|
| ChatRole |
StopReason
Required. The reason that we stopped.
This may be one the following values:
"end_turn": the model reached a natural stopping point "max_tokens": we exceeded the requested max_tokens or the model's maximum "stop_sequence": one of your provided custom stop_sequences was generated "tool_use": the model invoked one or more tools "pause_turn": we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue. "refusal": when streaming classifiers intervene to handle potential policy violations
In non-streaming mode this value is always non-null. In streaming mode, it is null in the message_start event and non-null otherwise.
Declaration
[JsonProperty("stop_reason")]
public FinishReason? StopReason { get; set; }
Property Value
| Type | Description |
|---|---|
| FinishReason? |
StopSequence
Required. Which custom stop sequence was generated, if any.
This value will be a non-null string if one of your custom stop sequences was generated.
Declaration
[JsonProperty("stop_sequence")]
public string StopSequence { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Usage
Required. Billing and rate-limit usage.
Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
Declaration
[JsonProperty("usage")]
public ClaudeUsage Usage { get; set; }
Property Value
| Type | Description |
|---|---|
| ClaudeUsage |
Methods
| Edit this page View SourceGetUsage()
Declaration
public Usage GetUsage()
Returns
| Type | Description |
|---|---|
| Usage |