litellm/tests/litellm_utils_tests
Cole McIntosh a7594196cd
fix: support Cursor IDE tool_choice format {"type": "auto"} (#12168)
* fix: support Cursor IDE tool_choice format {"type": "auto"}

- Update validate_chat_completion_tool_choice to normalize {"type": "auto"} to "auto"
- Handles Cursor IDE sending non-standard tool_choice format
- Add comprehensive tests for tool choice validation

Fixes #12098

* fix: return full tool_choice object for Cursor IDE format

Based on PR feedback, updated validate_chat_completion_tool_choice to return
the full tool_choice dictionary instead of just extracting the type string.
This maintains consistency with downstream code that expects the full object
structure.

- Changed behavior: {"type": "auto"} now returns {"type": "auto"} instead of "auto"
- Updated tests to reflect the new expected behavior
- Ensures compatibility with code that passes tool_choice to optional_params

Addresses feedback from PR #12168
2025-06-30 12:39:58 -07:00
..
conftest.py (Feat) Add x-litellm-overhead-duration-ms and "x-litellm-response-duration-ms" in response from LiteLLM (#7899) 2025-01-21 20:27:55 -08:00
log.txt Allow passing thinking param to litellm proxy via client sdk + Code QA Refactor on get_optional_params (get correct values) (#9386) 2025-04-07 21:04:11 -07:00
test_aiohttp_handler.py [Feat] Use aiohttp transport by default - 97% lower median latency (#11097) 2025-05-23 22:55:35 -07:00
test_aws_secret_manager.py (AWS Secret Manager) - Using K/V pairs in 1 AWS Secret (#9039) 2025-03-06 19:30:18 -08:00
test_get_secret.py (Feat) Add x-litellm-overhead-duration-ms and "x-litellm-response-duration-ms" in response from LiteLLM (#7899) 2025-01-21 20:27:55 -08:00
test_hashicorp.py build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07:00
test_litellm_overhead.py (Feat) Add x-litellm-overhead-duration-ms and "x-litellm-response-duration-ms" in response from LiteLLM (#7899) 2025-01-21 20:27:55 -08:00
test_logging_callback_manager.py Litellm dev 02 10 2025 p2 (#8443) 2025-02-10 17:53:46 -08:00
test_proxy_budget_reset.py Update enduser spend and budget reset date based on budget duration (#8460) 2025-06-08 08:39:14 -07:00
test_secret_manager.py [️ Python SDK import] - reduce python sdk import time by .3s (#12140) 2025-06-28 14:57:10 -07:00
test_utils.py test whitelisted models 2025-06-28 14:46:16 -07:00
test_validate_tool_choice.py fix: support Cursor IDE tool_choice format {"type": "auto"} (#12168) 2025-06-30 12:39:58 -07:00
vertex_key.json (Feat) Add x-litellm-overhead-duration-ms and "x-litellm-response-duration-ms" in response from LiteLLM (#7899) 2025-01-21 20:27:55 -08:00