Skip to content

Commit

Permalink
Fix price calculation in openRouterModels function
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaroran committed Jan 8, 2024
1 parent 414fad1 commit 5d7bc64
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ts/model/openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export async function openRouterModels() {
const res = await (await aim).json()
return res.data.map((model: any) => {
let name = model.name
let price = ((model.pricing.prompt * 3) + model.pricing.completion) / 4
let price = ((Number(model.pricing.prompt) * 3) + Number(model.pricing.completion)) / 4
console.log(model.pricing, price)
if(price > 0){
name += ` - $${(price*1000).toFixed(5)}/1k`
}
Expand Down

0 comments on commit 5d7bc64

Please sign in to comment.