30 lines
764 B
TypeScript
30 lines
764 B
TypeScript
import type { UsageAuthorization } from "./consultation-billing";
|
|
import type { PromptCacheUsage } from "./agent-generation-settings";
|
|
|
|
export type ReportBillingUsage = Readonly<{
|
|
actualModelId: string;
|
|
modelConfigVersion?: number;
|
|
inputTokens: number;
|
|
outputTokens: number;
|
|
durationMs: number;
|
|
cache?: PromptCacheUsage | null;
|
|
}>;
|
|
|
|
export type ReportBillingPort = Readonly<{
|
|
reserve(input: Readonly<{
|
|
userId: string;
|
|
requestId: string;
|
|
modelId: string;
|
|
}>): Promise<UsageAuthorization>;
|
|
complete(input: Readonly<{
|
|
userId: string;
|
|
requestId: string;
|
|
usage: ReportBillingUsage;
|
|
}>): Promise<boolean>;
|
|
release(input: Readonly<{
|
|
userId: string;
|
|
requestId: string;
|
|
reason: string;
|
|
}>): Promise<boolean>;
|
|
}>;
|