Perplexity requires type='message' on input items. Add _ensure_message_type
to automatically set it when missing, matching the old _format_input behavior.
Remove the isinstance(cost, dict) guard from Usage.__init__ — ResponseAPIUsage.parse_cost
validator already converts Perplexity's cost dict to float before it reaches Usage.
Add test_streaming_cost_dict_to_float_via_validator to verify the dict→float conversion
works end-to-end through transform_streaming_response (pydantic recursive construction).
- Remove Perplexity-specific `models` field from ResponsesAPIOptionalRequestParams
TypedDict to avoid polluting the shared OpenAI type. The param is still passed
through via get_supported_openai_params + map_openai_params at runtime.
- Add transform_response_api_response override to catch Perplexity's HTTP 200
with status:"failed" and raise BaseLLMException instead of silently succeeding.
- Update test_all_supported_params_declared to match the simplified
8-param list (was 24 params from old 410-line implementation)
- Replace test_cost_transformation tests: use ResponseAPIUsage
validator directly instead of removed _transform_usage method
(cost parsing moved to generic parse_cost validator)
- Rename "Agentic Research API" to "Agent API"
Expand
- supported Responses API parameters
- Fix function
tool handling to pass custom function tools through unchanged instead of heuristically mapping them.
-Update model registry with current Perplexity
models and presets
- Add Function Calling and Structured Outputs documentation sections.
- Unit tests for transformation logic.