Skip to content

@chinmaymk/aikit v0.0.40


@chinmaymk/aikit / extractUsageFromAnthropicEvent

Function: extractUsageFromAnthropicEvent()

extractUsageFromAnthropicEvent(event): undefined | GenerationUsage

Defined in: providers/anthropic-transformers.ts:125

Parameters

event

type

"message_delta"

delta

{ stop_reason?: string; stop_sequence?: null | string; }

delta.stop_reason?

string

delta.stop_sequence?

null | string

usage?

{ output_tokens: number; }

usage.output_tokens

number

Returns

undefined | GenerationUsage

Released under the MIT License.