Commit graph

7 commits

Author SHA1 Message Date
yuneng-jiang
6a0d03914c
test: drop the cwd-relative sys.path.insert calls from the test suite (#37802)
* test: drop the cwd-relative sys.path.insert calls from the test suite

TQ003 stands at 1,077 across 1,058 files, and 1,015 of them are the same shape:
sys.path.insert(0, os.path.abspath("../..")) and its deeper siblings. The
argument resolves against the working directory rather than the file, so from
the repo root, where every job runs pytest, it inserts the directory two levels
above the checkout. It has never pointed at litellm. The package is installed
into the environment anyway, which is what actually makes the import work, and
what the rule's message has said all along.

Removing them leaves 1,634 imports of sys and os with no remaining reference,
and those go too, except where another test module imports the name back out of
the file. The rest of TQ003 is 62 call sites that resolve against __file__ or a
variable, which are a different question and are left alone.

Collection is identical either way: 45,871 tests and the same 51 pre-existing
collection errors before and after, and ruff reports no new undefined name.

* test: drop the duplicate imports the sys.path sweep exposed to F811

* test(pre-call-utils): restore the os import the new bedrock tests need
2026-08-22 09:25:58 -07:00
Chesars
da76e1738a fix(perplexity): restore type='message' safety net for list inputs
Perplexity requires type='message' on input items. Add _ensure_message_type
to automatically set it when missing, matching the old _format_input behavior.
2026-03-11 00:14:13 -03:00
Chesars
636b474a8a fix(perplexity): remove redundant dict-cost check in Usage and add streaming cost test
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).
2026-03-10 23:52:17 -03:00
Chesars
a2781f0db3 fix(perplexity): remove models from shared TypedDict and restore error handling
- 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.
2026-03-10 19:51:23 -03:00
Chesars
e0927d1bac fix(tests): update Perplexity tests for simplified config
- 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)
2026-03-10 19:29:49 -03:00
Kesku
e468d108a6 format 2026-02-23 18:05:07 +00:00
Kesku
5899e909fd feat(perplexity): update Responses API integration to match Agent API
- 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.
2026-02-23 18:05:03 +00:00