Share via


RunCompletionUsage Class

  • java.lang.Object
    • com.azure.ai.agents.persistent.models.RunCompletionUsage

Implements

public final class RunCompletionUsage
implements JsonSerializable<RunCompletionUsage>

Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).

Method Summary

Modifier and Type Method and Description
static RunCompletionUsage fromJson(JsonReader jsonReader)

Reads an instance of RunCompletionUsage from the JsonReader.

long getCompletionTokens()

Get the completionTokens property: Number of completion tokens used over the course of the run.

long getPromptTokens()

Get the promptTokens property: Number of prompt tokens used over the course of the run.

long getTotalTokens()

Get the totalTokens property: Total number of tokens used (prompt + completion).

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static RunCompletionUsage fromJson(JsonReader jsonReader)

Reads an instance of RunCompletionUsage from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of RunCompletionUsage if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getCompletionTokens

public long getCompletionTokens()

Get the completionTokens property: Number of completion tokens used over the course of the run.

Returns:

the completionTokens value.

getPromptTokens

public long getPromptTokens()

Get the promptTokens property: Number of prompt tokens used over the course of the run.

Returns:

the promptTokens value.

getTotalTokens

public long getTotalTokens()

Get the totalTokens property: Total number of tokens used (prompt + completion).

Returns:

the totalTokens value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to