Search Results for

    Show / Hide Table of Contents

    Class ClaudeMessage

    Inheritance
    object
    ClaudeResponse
    ClaudeMessage
    Implements
    IUsageProvider
    Inherited Members
    ClaudeResponse.Id
    ClaudeResponse.Type
    ClaudeResponse.CreatedAtZulu
    ClaudeResponse.CreatedAt
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.Anthropic
    Assembly: Glitch9.AIDevKit.Provider.Anthropic.dll
    Syntax
    public sealed class ClaudeMessage : ClaudeResponse, IUsageProvider

    Properties

    | Edit this page View Source

    Container

    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
    | Edit this page View Source

    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>
    | Edit this page View Source

    Model

    Required. The model that handled the request.

    Declaration
    [JsonProperty("model")]
    public string Model { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    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
    | Edit this page View Source

    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?
    | Edit this page View Source

    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
    | Edit this page View Source

    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 Source

    GetUsage()

    Declaration
    public Usage GetUsage()
    Returns
    Type Description
    Usage

    Implements

    IUsageProvider

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation