Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

959 B
Raw Blame
import { type ModelPricingContext, type RouteAttemptIdentity } from '@lobechat/model-runtime';
import { type ModelPerformance, type ModelUsage, type SpendOrigin } from '@lobechat/types';

interface ChargeParams {
  /** Generation params, to price fixed per-image models. */
  computePriceParams?: Record<string, unknown>;
  isError?: boolean;
  metadata: SpendOrigin & {
    asyncTaskId: string;
    generationBatchId: string;
    modelId: string;
    topicId?: string;
  };
  metrics?: ModelPerformance;
  modelUsage?: ModelUsage;
  /** Opaque billing handle passed through from `asyncTask.metadata.precharge`. */
  prechargeResult?: unknown;
  pricingContext?: ModelPricingContext;
  provider: string;
  /** Router attempt that generated the image; attributes the charge to its channel. */
  routeAttempt?: RouteAttemptIdentity;
  userId: string;
  workspaceId?: string;
}

export async function chargeAfterGenerate(_params: ChargeParams): Promise<void> {}