Commit graph

11 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
Sameer Kankute
5fd27141cf
Litellm OSS Staging 010626 (#29422) 2026-06-01 21:42:51 -07:00
Ishaan Jaffer
e8461b5b97
style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
Cursor Agent
003e841737
fix(tests): update BFL image generation tests for new signature
Update transform_image_generation_response test calls to pass required
explicit params (request_data, optional_params, litellm_params, encoding)
that replaced **kwargs in the method signature.

Co-authored-by: yuneng-jiang <yuneng-jiang@users.noreply.github.com>
2026-03-13 00:20:52 +00:00
Chesars
fa165a68d9 fix(bfl): add BFL-specific params to image edit get_supported_openai_params for consistency 2026-03-04 23:04:48 -03:00
Chesars
88dc0c1b18 feat(bfl): add kontext models to image generation support
Kontext models (flux-kontext-pro, flux-kontext-max) support both
text-to-image and image editing. Add them to IMAGE_GENERATION_MODELS
and update supported_endpoints in model prices JSON.
2026-03-04 19:12:28 -03:00
Chesars
cf01ef5949 fix(tests): align BFL test assertions with implementation
- image_edit: get_supported_openai_params returns [] not [n, size, response_format]
- image_generation: remove response_format assertion (not in supported params)
- image_generation: unknown model raises ValueError, not defaults to flux-pro-1.1
2026-03-04 18:47:59 -03:00
Chesars
727fd76841 refactor(bfl): separate HTTP logic into dedicated handlers
- Create handler.py for image generation and image edit
- Move polling logic from transformation to handlers
- Handlers use _get_httpx_client() / get_async_httpx_client()
- Transformation files now only transform request/response data
- Follows Bedrock pattern for provider-specific handlers

Addresses feedback: transformation files should not make HTTP requests
2026-03-04 18:10:09 -03:00
Chesars
e0af575ee8 feat(black_forest_labs): add image generation support
Add native text-to-image generation for Black Forest Labs Flux models
(flux-pro-1.1, flux-pro-1.1-ultra, flux-dev, flux-pro).

- Polling-based async API with sync and async support
- OpenAI-compatible parameter mapping (size, n, quality)
- Reuses shared HTTP clients via _get_httpx_client()
- 39 unit tests added
2026-03-04 18:09:34 -03:00
Chesars
d180db31e7 Use _get_httpx_client for HTTP polling in BFL image edit
Replace direct httpx.get() calls with _get_httpx_client() to reuse
cached HTTP client, following the pattern used by other providers
(RunwayML, Azure AI OCR, Sagemaker, etc.).
2026-03-04 18:09:12 -03:00
Chesars
cd731811d9 feat(black_forest_labs): add native image edit support for Black Forest Labs
Add native integration for Black Forest Labs image editing models
(flux-kontext-pro, flux-kontext-max, flux-pro-1.0-fill, flux-pro-1.0-expand).

Changes:
- Add BlackForestLabsImageEditConfig for BFL API transformation
- Add BLACK_FOREST_LABS to LlmProviders enum
- Add use_multipart_form_data() to BaseImageEditConfig for JSON vs form-data
- Modify image_edit_handler to support JSON request bodies
- Add comprehensive unit tests

Closes #11401
2026-03-04 18:08:50 -03:00