Files
cobble/src/pages/admin/bots/[bot_id]/(utils)/provider-label.ts
T
tbenandClaude Opus 5.5 c13b9ea826 Show how each bot message was generated
Every bot message gets an info button that opens its details: the
provider and model behind it, tokens and cost, the job that ran it, each
model used and every call in order. Each model call now records how it
was made in token_usages.settings (generation settings sent, whose
settings they were, pinned or automatic model, fallbacks), shown per
model in the modal.

Live replies now carry their token usage, from the job's push and the
live relay alike, so it shows without a reload.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 04:33:47 +01:00

21 lines
658 B
TypeScript

import { HarnessProviderKinds } from "@/src/dict/harness-provider-dict";
type Params = {
name: string | null;
kind: string | null;
};
/**
* A provider as a message's details name it: the name it was saved under,
* with its kind beside it when that says something more ("Work key ·
* OpenAI").
*/
export default function providerLabel({ name, kind }: Params) {
const kind_title = kind ? HarnessProviderKinds.find((k) => k.value == kind)?.title : undefined;
if (!name) return kind_title || "Unknown provider";
if (!kind_title || kind_title.toLowerCase() == name.toLowerCase()) return name;
return `${name} · ${kind_title}`;
}