mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-21 00:21:49 +00:00
Every issue opened from now on is gated on the template headings, sent once through the LiteLLM proxy with a strict JSON schema, and labelled from the manifest in .github/labels.json. Old-template issues are not touched. The bug template shrinks to Description, Config, LiteLLM Version and Steps to Repro, both templates gain a domain dropdown, and the labelers that keyed off the old component dropdown go away.
32 lines
1,023 B
TypeScript
32 lines
1,023 B
TypeScript
import manifest from "../.github/labels.json";
|
|
|
|
export const NAMESPACES = ["domain", "provider", "kind", "priority", "lift", "needs"] as const;
|
|
export type Namespace = (typeof NAMESPACES)[number];
|
|
|
|
export interface LabelSpec {
|
|
readonly color: string;
|
|
readonly description: string;
|
|
}
|
|
|
|
export type Manifest = Readonly<Record<Namespace, Readonly<Record<string, LabelSpec>>>>;
|
|
|
|
export interface ManifestLabel extends LabelSpec {
|
|
readonly name: string;
|
|
}
|
|
|
|
export const MANIFEST: Manifest = manifest;
|
|
|
|
export function labelName(namespace: Namespace, value: string): string {
|
|
return `${namespace}:${value}`;
|
|
}
|
|
|
|
export function namespaceOf(label: string): Namespace | undefined {
|
|
const prefix = label.split(":")[0];
|
|
return NAMESPACES.find((namespace) => namespace === prefix);
|
|
}
|
|
|
|
export function manifestLabels(source: Manifest): readonly ManifestLabel[] {
|
|
return NAMESPACES.flatMap((namespace) =>
|
|
Object.entries(source[namespace]).map(([value, spec]) => ({ name: labelName(namespace, value), ...spec })),
|
|
);
|
|
}
|