Add three billing lifecycle methods to the TaskAdaptor interface: - EstimateBilling: compute OtherRatios from user request before pricing - AdjustBillingOnSubmit: adjust ratios from upstream submit response - AdjustBillingOnComplete: determine final quota at task terminal state Introduce BaseBilling as embeddable no-op default for adaptors without custom billing. Move Sora/Ali OtherRatios logic from shared validation into per-adaptor EstimateBilling implementations. Add TaskBillingContext to persist pricing params (model_price, group_ratio, other_ratios) in task private data for async polling settlement. Extract RecalculateTaskQuota as a general-purpose delta settlement function and unify polling billing via settleTaskBillingOnComplete (adaptor-first, then token-based fallback).
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| channel | Loading commit data... | |
| common | Loading commit data... | |
| common_handler | Loading commit data... | |
| constant | Loading commit data... | |
| helper | Loading commit data... | |
| reasonmap | Loading commit data... | |
| audio_handler.go | Loading commit data... | |
| chat_completions_via_responses.go | Loading commit data... | |
| claude_handler.go | Loading commit data... | |
| compatible_handler.go | Loading commit data... | |
| embedding_handler.go | Loading commit data... | |
| gemini_handler.go | Loading commit data... | |
| image_handler.go | Loading commit data... | |
| mjproxy_handler.go | Loading commit data... | |
| relay_adaptor.go | Loading commit data... | |
| relay_task.go | Loading commit data... | |
| rerank_handler.go | Loading commit data... | |
| responses_handler.go | Loading commit data... | |
| websocket.go | Loading commit data... |