Commit graph

3 commits

Author SHA1 Message Date
Ishaan Jaffer
e8461b5b97
style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
Chesars
e223b29d31 fix(responses): add models to TypedDict and fix test state corruption
- Add 'models' field to ResponsesAPIOptionalRequestParams TypedDict so
  the Perplexity fallback chain param is not silently filtered out by
  get_requested_response_api_optional_param(). Verified with curl that
  Perplexity's models param works (tries models in order until one
  succeeds).
- Fix test_python_class_takes_priority_over_json: save and restore the
  original JSONProviderRegistry entry instead of deleting it, preventing
  state corruption for subsequent tests.
2026-03-10 19:19:07 -03:00
Chesars
0c27f20692 feat(openai_like): add Responses API support to JSON provider system
Add infrastructure for JSON-declared providers to support /v1/responses
via `supported_endpoints` field in providers.json. Simplify Perplexity
responses config from 410 to 40 lines by moving cost dict→float parsing
to generic validators in ResponseAPIUsage and Usage.

- Add `supported_endpoints` field to SimpleProviderConfig (default: [])
- Add `supports_responses_api()` to JSONProviderRegistry
- Create OpenAILikeResponsesConfig base class for responses API
- Add `create_responses_config_class()` with class caching
- ProviderConfigManager: Python classes take priority over JSON fallback
- Fix ResponseAPIUsage.cost field_validator to handle dict cost objects
- Fix Usage.__init__ to handle dict cost from chat completions
- Simplify PerplexityResponsesConfig with get_supported_openai_params guard
- Add 20 unit tests including Python-over-JSON priority test
2026-02-17 16:37:38 -03:00