Commit Graph

47 Commits

Author SHA1 Message Date
Ishaan Jaffer 1d2bdaebb6 test_openai_streaming_logging 2025-11-08 11:49:36 -08:00
Ishaan Jaffer 4fb521c251 test_basic_openai_responses_api_non_streaming_with_logging 2025-11-08 11:12:35 -08:00
Ishaan Jaffer bbcdf6f996 test_basic_openai_responses_api_non_streaming_with_logging 2025-11-08 10:47:48 -08:00
Ishaan Jaffer 0148b8d2f7 test_basic_openai_responses_api_non_streaming_with_logging 2025-11-08 10:36:47 -08:00
Ishaan Jaffer 89157f4b5c test_basic_openai_responses_api_streaming_with_logging 2025-11-08 10:30:41 -08:00
Ishaan Jaffer 6bb963dca2 test_basic_openai_responses_api_non_streaming_with_logging 2025-11-08 10:13:27 -08:00
Ishaan Jaffer f9d95b71bb fix _get_assembled_streaming_response 2025-11-08 10:08:03 -08:00
Cesar Garcia 1fec48499f fix: Pass extra_body to provider in Responses API requests (#16320)
## Problem
The `extra_body` parameter in `litellm.responses()` and `litellm.aresponses()`
was being accepted but never passed to the HTTP request sent to the LLM provider.
This prevented users from sending custom/experimental parameters to provider APIs.

## Changes
- Added `data.update(extra_body)` in `async_response_api_handler` (line 2138)
- Added `data.update(extra_body)` in `response_api_handler` (line 2012)
- Added tests to `test_openai_responses_api.py` for extra_body functionality

## Testing
- Tests verify extra_body params are passed in both sync and async modes
- Existing Responses API tests continue to pass
- Manually verified with OpenAI API that custom params are sent correctly

## Impact
Users can now pass custom/experimental parameters via extra_body:
```python
litellm.aresponses(
    model="gpt-4o",
    input="hello",
    extra_body={"custom_param": "value"}  # Now works!
)
```

This aligns with the OpenAI SDK pattern and matches behavior in other
LiteLLM endpoints (completion, embedding, etc.) that already support extra_body.
2025-11-06 14:54:40 -08:00
Ishaan Jaffer 4a83ae0695 test_aresponses_service_tier_and_safety_identifier 2025-11-04 18:05:30 -08:00
Krish Dholakia 74ae7aed44 build: Squashed commit of the following: (#16176)
commit bb0b050fb01633d83c1c2932f8e9c11432911847
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Sat Nov 1 20:00:01 2025 -0700

    test: update tests

commit b2da4bdac23868e69a9452805b231f8830e49912
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Wed Oct 22 14:58:01 2025 -0700

    fix(langfuse_otel_attributes.py): log tools and other optional params

commit 75bee1f2748f32b230467de0b085c55bf1d687a9
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Wed Oct 22 14:42:05 2025 -0700

    feat(langfuse_otel/): working request/response logging on spans

    Closes https://github.com/BerriAI/litellm/issues/13764

commit a3e4fa5b81e82f71c74fb9e7dc859c6cb40495f5
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Wed Oct 22 14:20:39 2025 -0700

    fix: initial commit fixing langfuse request/response logging with OTEL

commit 09fc9deac844004104822810e42975cd9c68f0e3
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Wed Oct 22 13:33:52 2025 -0700

    fix(litellm_logging.py): for responses api - return a unified usage object for logging

    ensures logging integrations all pull the right usage information
2025-11-02 09:46:40 -08:00
Sameer Kankute f804ab6de5 Add LLM provider response headers to Responses API (#16091)
* Add llm headers to responses api

* fix mock test
2025-11-01 13:25:56 -07:00
Ishaan Jaff d91efa7a7b [Bug Fix]: ErrorEvent ValidationError when OpenAI Responses API returns nested error structure (#15804)
* add ErrorEventError nested field

* test_openai_responses_api_token_limit_error

* test_openai_responses_api_token_limit_error
2025-10-22 14:18:46 -07:00
Ishaan Jaff 37d885e46a [Fix] LiteLLM does not support new web_search tool (Responses API) (#14083)
* test_basic_openai_responses_with_websearch

* fix: ResponsesAPIResponse

* fix: StandardBuiltInToolCostTracking
2025-08-29 18:33:52 -07:00
Ishaan Jaff 76f1064229 [Bug Fix] litellm incompatible with newest release of openAI v1.100.0 (#13728)
* fix imports OpenAI SDK

* ResponseText fixes

* fixes ResponseText

* fix imports

* catch AttributeError

* fix import

* use openai==1.100.1

* fix build from PIP

* fix lint test

* Print OpenAI version

* fix Install dependencies
2025-08-18 18:26:17 -07:00
Ishaan Jaff 1cd827874f [Bug Fix] - Allow using reasoning_effort for gpt-5 model family and reasoning for Responses API (#13475)
* test_openai_gpt5_reasoning

* test_openai_gpt5_reasoning_effort_parameter

* add OpenAIGPT5ResponsesAPIConfig

* test_openai_gpt5_reasoning_effort_parameter

* fixes
2025-08-10 09:55:36 -07:00
Ishaan Jaff 825ea65b96 [Bug Fix] Responses API - Responses API failed if input containing ResponseReasoningItem (#13465)
* add test_responses_api_multi_turn_with_reasoning_and_structured_output

* fix transform_responses_api_request
2025-08-09 11:20:34 -07:00
Ishaan Jaff dae72003a7 [Bug Fix] OpenAI / Azure Responses API - Add service_tier , safety_identifier supported params (#13258)
* test_aresponses_service_tier_and_safety_identifier

* add service_tier + safety_identifier

* fix get_supported_openai_params

* add safety_identifier + service_tier for responses()
2025-08-04 10:51:53 -07:00
Jugal D. Bhatt eb8a338d9b [MCP Guardrails] move pre and during hooks to ProxyLoggin (#13109)
* move pre and during hooks t o ProxyLoggin

* fix lint

* fix ruff

* fix tests
2025-07-30 13:58:41 -07:00
Ishaan Jaff 274baac9df test_mcp_tools_with_responses_api 2025-07-03 14:53:30 -07:00
Ishaan Jaff 03a589d323 fix - MCP deepwiki mcp is unstable, move to stable mcp 2025-07-03 14:24:32 -07:00
Jugal D. Bhatt 88834b8550 [Bump] Litellm responses format (#12253)
* Add responses format changes

* Add check

* Add check

* added more testing
2025-07-02 16:32:06 -07:00
Ishaan Jaff 80501b8268 [Feat] Day-0 Support for OpenAI Re-usable prompts Responses API (#11782)
* add prompt to responses params

* add OpenAI PromptObject

* add prompt param to responses api

* test_get_optional_params_responses_api

* test_openai_responses_litellm_router_with_prompt

* docs Reusable Prompts
2025-06-16 21:28:50 -07:00
Ishaan Jaff 86cdb8382b [Feat] Use aiohttp transport by default - 97% lower median latency (#11097)
* fix: add flag for disabling use_aiohttp_transport

* feat: add _create_async_transport

* feat: fixes for transport

* add httpx-aiohttp

* feat: fixes for transport

* refactor: fixes for transport

* build: fix deps

* fixes: test fixes

* fix: ensure aiohttp does not auto set content type

* test: test fixes

* feat: add LiteLLMAiohttpTransport

* fix: fixes for responses API handling

* test: fixes for responses API handling

* test: fixes for responses API handling

* feat: fixes for transport

* fix: base embedding handler

* test: test_async_http_handler_force_ipv4

* test: fix failing deepeval test

* fix: add YARL for bedrock urls

* fix: issues with transport

* fix: comment out linting issues

* test fix

* test: XAI is unstable

* test: fixes for using respx

* test: XAI fixes

* test: XAI fixes

* test: infinity testing fixes

* docs(config_settings.md): document param

* test: test_openai_image_edit_litellm_sdk

* test: remove deprecated test

* bump respx==0.22.0

* test: test_xai_message_name_filtering

* test: fix anthropic test after bumping httpx

* use n 4 for mapped tests (#11109)

* fix: use 1 session per event loop

* test: test_client_session_helper

* fix: linting error

* fix: resolving GET requests on httpx 0.28.1

* test fixes proxy unit tests

* fix: add ssl verify settings

* fix: proxy unit tests

* fix: refactor

* tests: basic unit tests for aiohttp transports

* tests: fixes xai

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>
2025-05-23 22:55:35 -07:00
Ishaan Jaff dd4a65b83a Feat: add MCP to Responses API and bump openai python sdk (#11029)
* feat: add MCP to responses API

* feat: bump openai version to 1.75.0

* docs MCP + responses API

* fixes: type checking

* fixes: type checking

* build: use latest openai 1.81.0

* fix: linting error

* fix: linting error

* fix: test

* fix: linting errors

* fix: test

* fix: test

* fix: linting

* Revert "fix: linting"

This reverts commit ebb19ff8cb1f8fcc3e224390e351676daccb33de.

* fix: linting
2025-05-22 07:24:10 -07:00
Ishaan Jaff 0dba2886f0 fix test 2025-04-22 18:37:56 -07:00
Ishaan Jaff 653570824a Bug Fix - Responses API, Loosen restrictions on allowed environments for computer use tool (#10168)
* loosen allowed types on ComputerToolParam

* test_basic_computer_use_preview_tool_call
2025-04-19 14:40:32 -07:00
Ishaan Jaff d3e04eac7f [Feat] Unified Responses API - Add Azure Responses API support (#10116)
* initial commit for azure responses api support

* update get complete url

* fixes for responses API

* working azure responses API

* working responses API

* test suite for responses API

* azure responses API test suite

* fix test with complete url

* fix test refactor

* test fix metadata checks

* fix code quality check
2025-04-17 16:47:59 -07:00
Ishaan Jaff b04cf226aa test_openai_o1_pro_response_api_streaming 2025-03-20 13:04:49 -07:00
Ishaan Jaff d915ab3f07 test_openai_o1_pro_response_api 2025-03-20 09:18:38 -07:00
Ishaan Jaff 7fee847ffc test_openai_o1_pro_incomplete_response 2025-03-20 09:14:59 -07:00
Ishaan Jaff 3b632ac825 test_async_bad_request_bad_param_error 2025-03-13 15:57:19 -07:00
Ishaan Jaff ee47016300 test_openai_responses_litellm_router_with_metadata 2025-03-12 18:55:02 -07:00
Ishaan Jaff c82ef41dc4 test_openai_responses_litellm_router_no_metadata 2025-03-12 18:18:07 -07:00
Ishaan Jaff d808fa3c23 test_openai_responses_litellm_router 2025-03-12 16:13:48 -07:00
Ishaan Jaff daea59a7b4 test openai responses streaming 2025-03-12 11:32:26 -07:00
Ishaan Jaff accdaa4a74 fix ResponseAPILoggingUtils 2025-03-12 11:12:09 -07:00
Ishaan Jaff d6351c3433 test_basic_openai_responses_api 2025-03-12 10:07:03 -07:00
Ishaan Jaff 047879c004 add aresponses 2025-03-12 09:22:44 -07:00
Ishaan Jaff c2dbcb798f working streaming logging + cost tracking 2025-03-12 07:27:53 -07:00
Ishaan Jaff dd7ac41e33 validate_responses_match 2025-03-11 22:42:49 -07:00
Ishaan Jaff b790f0a5c6 log input of response API 2025-03-11 22:34:18 -07:00
Ishaan Jaff 51dc24a405 _transform_response_api_usage_to_chat_usage 2025-03-11 22:26:44 -07:00
Ishaan Jaff aa40cb5b26 working ResponsesAPIStreamingIterator 2025-03-11 19:47:43 -07:00
Ishaan Jaff 8da714104b ResponsesAPIStreamingResponse 2025-03-11 17:48:15 -07:00
Ishaan Jaff 52b43f672b working test_basic_openai_responses_api 2025-03-11 17:35:43 -07:00
Ishaan Jaff d6c82327e6 working import litellm.responses 2025-03-11 14:32:32 -07:00
Ishaan Jaff 4b1b87eb67 openai reasoning initial types 2025-03-11 14:28:47 -07:00