-
Notifications
You must be signed in to change notification settings - Fork 23
Add auction pricing for all pricing models #269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Previously only CPM and vCPM supported both fixed and auction pricing. This change adds auction variants for CPC, CPCV, CPV, CPP, and Flat Rate. New schemas: - cpc-auction-option.json - cpcv-auction-option.json - cpv-auction-option.json - cpp-auction-option.json - flat-rate-auction-option.json Renamed for consistency: - cpc-option.json → cpc-fixed-option.json - cpcv-option.json → cpcv-fixed-option.json - cpv-option.json → cpv-fixed-option.json - cpp-option.json → cpp-fixed-option.json - flat-rate-option.json → flat-rate-fixed-option.json
| @@ -0,0 +1,68 @@ | |||
| { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we really have to enumerate every combination in general?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed! Refactored to use 7 schema files (one per pricing model) instead of 14 separate files. Each pricing model schema now uses a discriminated union with is_fixed to support both fixed and auction variants in a single file.
Schema structure:
cpm-option.json- both fixed and auctionvcpm-option.json- both fixed and auctioncpc-option.json- both fixed and auctioncpcv-option.json- both fixed and auctioncpv-option.json- both fixed and auctioncpp-option.json- both fixed and auctionflat-rate-option.json- both fixed and auction
This eliminates the fixed vs auction duplication while keeping each pricing model in its own maintainable file.
| } | ||
| ``` | ||
|
|
||
| **Auction Example**: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possibly use the testable code to make these maintainable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion! For pricing-models.mdx, the JSON examples are schema documentation rather than API calls, so testable: true isn't directly applicable here (those tests validate executable code against the test agent API).
However, the schema validation tests do indirectly validate these structures since they test the pricing option schemas. The examples in the doc should match the schema definitions.
If we want explicit validation of doc examples, we could add a test that extracts JSON from the mdx and validates against schemas - happy to add that if useful.
Address PR feedback to avoid enumerating every pricing model + type combination. Changes: - Consolidated 14 individual pricing option schemas into single pricing-option.json - Uses two-level discriminated union: is_fixed (true/false) × pricing_model enum - Removed pricing-options directory entirely - Updated schema registry index.json This makes it trivial to add new pricing models (just add to enum) rather than creating 2 new schema files per model.
Address PR feedback to avoid enumerating every pricing model + type combination. Changes: - Create 7 pricing model schemas (cpm, vcpm, cpc, cpcv, cpv, cpp, flat-rate) - Each schema supports both fixed and auction variants via discriminated union - Use is_fixed boolean as discriminator (true=rate, false=price_guidance) - Update pricing-option.json to reference 7 model schemas - Update index.json registry with pricing-options section
Summary
-fixed-option.jsonfor consistencyTest plan