mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
OpenRouter: update parser
This commit is contained in:
@@ -600,8 +600,10 @@ export function openRouterModelToModelDescription(wireModel: object): ModelDescr
|
||||
|
||||
// parse pricing
|
||||
const pricing: ModelDescriptionSchema['pricing'] = {
|
||||
chatIn: parseFloat(model.pricing.prompt) * 1000,
|
||||
chatOut: parseFloat(model.pricing.completion),
|
||||
chatIn: parseFloat(model.pricing.prompt) * 1000 * 1000,
|
||||
chatOut: parseFloat(model.pricing.completion) * 1000 * 1000,
|
||||
// image...
|
||||
// request...
|
||||
};
|
||||
const seemsFree = pricing.chatIn === 0 && pricing.chatOut === 0;
|
||||
|
||||
|
||||
@@ -8,14 +8,18 @@ export const wireOpenrouterModelsListOutputSchema = z.object({
|
||||
pricing: z.object({
|
||||
prompt: z.string(),
|
||||
completion: z.string(),
|
||||
image: z.string(),
|
||||
request: z.string(),
|
||||
}),
|
||||
context_length: z.number(),
|
||||
architecture: z.object({
|
||||
tokenizer: z.string(),
|
||||
modality: z.string(), // z.enum(['text', 'multimodal']),
|
||||
tokenizer: z.string(), // e.g. 'Mistral'
|
||||
instruct_type: z.string().nullable(),
|
||||
}),
|
||||
top_provider: z.object({
|
||||
max_completion_tokens: z.number().nullable(),
|
||||
is_moderated: z.boolean(), // false means that the user will need to do moderation, and likely this has lower latency
|
||||
}),
|
||||
|
||||
// when logged in
|
||||
|
||||
Reference in New Issue
Block a user