Skip to content

Commit

Permalink
Merge 931484e into b9cb5fd
Browse files Browse the repository at this point in the history
  • Loading branch information
jpalvarezl committed Apr 26, 2024
2 parents b9cb5fd + 931484e commit d1f66de
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions specification/ai/OpenAI.Assistants/run_steps/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,31 @@ model RunStep {
@doc("The Unix timestamp, in seconds, representing when this failed.")
failedAt: utcDateTime | null;

#suppress "@azure-tools/typespec-azure-core/no-nullable" "OpenAI uses explicit nullability, distinct from optionality"
@doc("Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.")
@added(ServiceApiVersions.vFuturePlaceholder)
usage: RunStepCompletionUsage | null;

...RequiredNullableMetadata;
}

@doc("Usage statistics related to the run step.")
@added(ServiceApiVersions.vFuturePlaceholder)
model RunStepCompletionUsage {

@doc("Number of completion tokens used over the course of the run step.")
@encodedName("application/json", "completion_tokens")
completionTokens: int64;

@doc("Number of prompt tokens used over the course of the run step.")
@encodedName("application/json", "prompt_tokens")
promptTokens: int64;

@doc("Total number of tokens used (prompt + completion).")
@encodedName("application/json", "total_tokens")
totalTokens: int64;
}

@doc("The possible types of run steps.")
@added(ServiceApiVersions.v2024_02_15_preview)
union RunStepType {
Expand Down
22 changes: 22 additions & 0 deletions specification/ai/OpenAI.Assistants/runs/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,31 @@ model ThreadRun {
@doc("The Unix timestamp, in seconds, representing when this failed.")
failedAt: utcDateTime | null;

#suppress "@azure-tools/typespec-azure-core/no-nullable" "OpenAI uses explicit nullability, distinct from optionality"
@doc("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.).")
@added(ServiceApiVersions.vFuturePlaceholder)
usage: RunCompletionUsage | null;

...RequiredNullableMetadata;
}

@doc("Usage statistics related to the run.")
@added(ServiceApiVersions.vFuturePlaceholder)
model RunCompletionUsage {

@doc("Number of completion tokens used over the course of the run.")
@encodedName("application/json", "completion_tokens")
completionTokens: int64;

@doc("Number of prompt tokens used over the course of the run.")
@encodedName("application/json", "prompt_tokens")
promptTokens: int64;

@doc("Total number of tokens used (prompt + completion).")
@encodedName("application/json", "total_tokens")
totalTokens: int64;
}

@doc("The details used when creating a new run of an assistant thread.")
@added(ServiceApiVersions.v2024_02_15_preview)
model CreateRunOptions {
Expand Down

0 comments on commit d1f66de

Please sign in to comment.