mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-13 16:00:02 +02:00
Adjust structure delete models
This commit is contained in:
-7559
File diff suppressed because it is too large
Load Diff
@@ -47,27 +47,21 @@ export type AiModelCatalogEntry = {
|
|||||||
provider: CatalogProvider;
|
provider: CatalogProvider;
|
||||||
model: string;
|
model: string;
|
||||||
pricing: {
|
pricing: {
|
||||||
input: number | null;
|
in: number | null;
|
||||||
output: number | null;
|
out: number | null;
|
||||||
cacheRead: number | null;
|
cache: number | null;
|
||||||
reasoningOutput: number | null;
|
reasoning: number | null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
type RawCatalogEntry = {
|
type RawCatalogEntry = {
|
||||||
id?: string;
|
model: string;
|
||||||
name?: string;
|
|
||||||
model?: string;
|
|
||||||
provider: string;
|
provider: string;
|
||||||
input_cost_per_token?: number | null;
|
|
||||||
output_cost_per_token?: number | null;
|
|
||||||
cache_read_input_token_cost?: number | null;
|
|
||||||
output_cost_per_reasoning_token?: number | null;
|
|
||||||
pricing?: {
|
pricing?: {
|
||||||
input?: number | null;
|
in?: number | null;
|
||||||
output?: number | null;
|
out?: number | null;
|
||||||
cacheRead?: number | null;
|
cache?: number | null;
|
||||||
reasoningOutput?: number | null;
|
reasoning?: number | null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -93,25 +87,18 @@ function normalizeEntry(raw: RawCatalogEntry): AiModelCatalogEntry | null {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const model = raw.model ?? raw.name ?? raw.id;
|
if (!raw.model) {
|
||||||
if (!model) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
provider,
|
provider,
|
||||||
model,
|
model: raw.model,
|
||||||
pricing: {
|
pricing: {
|
||||||
input: raw.pricing?.input ?? raw.input_cost_per_token ?? null,
|
in: raw.pricing?.in ?? null,
|
||||||
output: raw.pricing?.output ?? raw.output_cost_per_token ?? null,
|
out: raw.pricing?.out ?? null,
|
||||||
cacheRead:
|
cache: raw.pricing?.cache ?? null,
|
||||||
raw.pricing?.cacheRead ??
|
reasoning: raw.pricing?.reasoning ?? null
|
||||||
raw.cache_read_input_token_cost ??
|
|
||||||
null,
|
|
||||||
reasoningOutput:
|
|
||||||
raw.pricing?.reasoningOutput ??
|
|
||||||
raw.output_cost_per_reasoning_token ??
|
|
||||||
null
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ function toPricing(
|
|||||||
approximate: boolean
|
approximate: boolean
|
||||||
): AiModelPricing {
|
): AiModelPricing {
|
||||||
return {
|
return {
|
||||||
inputCostPerToken: entry.pricing.input,
|
inputCostPerToken: entry.pricing.in,
|
||||||
outputCostPerToken: entry.pricing.output,
|
outputCostPerToken: entry.pricing.out,
|
||||||
cacheReadInputTokenCost: entry.pricing.cacheRead,
|
cacheReadInputTokenCost: entry.pricing.cache,
|
||||||
outputCostPerReasoningToken: entry.pricing.reasoningOutput,
|
outputCostPerReasoningToken: entry.pricing.reasoning,
|
||||||
approximate
|
approximate
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user