Skip to content

pass every preflight field to the rules engine - #207

Open
bpapillon wants to merge 1 commit into
mainfrom
bpapillon/sch-7807-expose-event_quantities-preflight-in-the-sdks-and-the-api
Open

bpapillon wants to merge 1 commit into
mainfrom
bpapillon/sch-7807-expose-event_quantities-preflight-in-the-sdks-and-the-api

Conversation

@bpapillon

Copy link
Copy Markdown
Collaborator

Prepares the C# SDK for the v0.10.0 rules engine's event_quantities preflight, which prices a call (requests plus token counts) the way the API burns it. Mirrors schematic-go #250 as far as this SDK's hand-written code allows.

Local evaluation already hands the generated PreflightRequestBody to the engine as its options, but HasPreflight checked a fixed list of knobs, so a field the type gains on regen would have been silently left off. It now sends whatever the body serializes, minus null and empty-object fields, so event_quantities reaches the engine as soon as Fern adds it.

The generated rules-engine models keep unknown fields as extension data, so quantity_rates on conditions and entitlements already reaches the engine and comes back on the result. The new tests pin both, and run the API's shared quantity_cost.json fixture through the WASM engine with event_quantities carried in the body's extension data.

There's no public way to set event_quantities yet: this SDK's only preflight surface is the generated PreflightRequestBody (reached through Check), and that type gets the field once the API adds it to the preflight body and Fern regenerates. Exposing it on CheckOptions is a follow-up after that.

@bpapillon
bpapillon requested a review from a team as a code owner October 9, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant