Skip to content
Source
Sign inSign up
TanStack/schemas

FAL pricing extract: send Cloudflare's catalog model id to AI Gateway (#556) #557

Mergedtombeckenhammerged 1 commit intomain fromrefs/pull/557/headmerged by tombeckenham View on GitHub

Showing 3 changed files with 35 additions and 9 deletions.

x
0 of 3 viewed, 3 left
2 additions and 1 deletionscripts/compare-fal-extract-models.tsModified
View file
@@ -104,7 +104,8 @@
body: JSON.stringify({
...body,
- model: model.replace(/^anthropic\//, ''),
+ // Back from the gateway catalog id to Anthropic's.
+ model: model.replace(/^anthropic\//, '').replaceAll('.', '-'),
}),
if (response.ok) pending.push(readUsage(response.clone()).then(onUsage))
2 additions and 1 deletionsrc/server/ingest/extract-fal-pricing.test.tsModified
View file
@@ -358,7 +358,8 @@
expect(card.source.hash).toBe(args.sourceHash)
expect(card.source.url).toBe(args.sourceUrl)
const [model, input, options] = run.mock.calls[0] ?? []
- expect(model).toBe(`anthropic/${FAL_PRICING_EXTRACT_MODEL}`)
+ // Cloudflare's catalog id, not Anthropic's (#556).
+ expect(model).toBe('anthropic/claude-sonnet-5.5')
expect(options).toMatchObject({ gateway: { id: 'gw-test' } })
// Claude 5 400s on temperature (#550).
expect(input).not.toHaveProperty('temperature')
31 additions and 7 deletionssrc/server/ingest/extract-fal-pricing.tsModified
View file
@@ -71,11 +71,21 @@
​