Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor, Convert models costs to numeric values when unmarshaling th…
Browse files Browse the repository at this point in the history
…e JSON response, to avoid these values to be converted latter on

Part of #296
ruiAzevedo19 committed Jul 31, 2024

Verified

This commit was signed with the committer’s verified signature.
ruiAzevedo19 Rui Azevedo
1 parent e5c1bcc commit fa6db2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions provider/openrouter/openrouter.go
Original file line number Diff line number Diff line change
@@ -70,13 +70,13 @@ type Model struct {
// Pricing holds the pricing information of a model.
type Pricing struct {
// Prompt holds the price for a prompt in dollars per token.
Prompt string `json:"prompt"`
Prompt float64 `json:"prompt,string"`
// Completion holds the price for a completion in dollars per token.
Completion string `json:"completion"`
Completion float64 `json:"completion,string"`
// Request holds the price for a request in dollars per request.
Request string `json:"request"`
Request float64 `json:"request,string"`
// Image holds the price for an image in dollars per token.
Image string `json:"image"`
Image float64 `json:"image,string"`
}

// Models returns which models are available to be queried via this provider.

0 comments on commit fa6db2c

Please sign in to comment.