Use backend podcast estimates and remove frontend cost heuristics#474
Open
Use backend podcast estimates and remove frontend cost heuristics#474
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
CreateModal.tsxand stopped injecting inferred constants into the create UI by passingestimatedCost={null}into the topic input component.TopicUrlInput.tsxto accept a nullableestimatedCostand render an explicitEst. Unavailablechip when no server estimate is present.estimateCostsheuristic and now map the backendanalysisResp.data.estimateinto the frontendCreateProjectResult.estimate(nullable) infrontend/src/services/podcastApi.ts.PodcastEstimatetyping to include backend metadata (breakdown,currency,lastUpdated) and allowedCreateProjectResult.estimateto benullinfrontend/src/components/PodcastMaker/types.ts.backend/api/podcast/handlers/analysis.py) that reads pricing catalog entries (cost_per_input_token,cost_per_output_token,cost_per_request, etc.) viaPricingService, applies phase-level usage assumptions for Analyze/Gather/Write/Produce, and returns a user-facing estimate payload.estimatefield to the API response modelPodcastAnalyzeResponse(backend/api/podcast/models.py) so the frontend receives precomputed totals and a phase breakdown.Testing
python -m py_compile backend/api/podcast/handlers/analysis.py backend/api/podcast/models.py, which completed successfully.npm --prefix frontend run -s typecheckandnpm --prefix frontend exec tsc -- --noEmit, buttscinvocation failed in this environment due to npm registry policy (403) and could not complete here.Codex Task