litellm/test_script.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
754 B
Python
Raw Normal View History

Xai, VertexAI, Google AI Studio - live web search support in OpenAI format (#11251) * build(model_prices_and_context_window.json): fix 'supports_web_search' flag - openai only supports it on 2 models - gpt-4o-search-preview and gpt-4o-mini-search-preview * feat(xai/chat): add xai web search options param support * test: add max tokens to test xai output very verbose * build(xai/): add web search support for all xai models * build(model_prices_and_cost.json): add gemini-2.0 supports web search * feat(gemini/): map openai 'web_search_options' to google's 'googlesearch' tool * build(model_prices_and_context_window.json): add supports_web_search for vertex_ai/gemini-2 models * fix: fix circular reference error * fix(convert_dict_to_response.py): handle scenario where xai returns finish reason as 'stop' for tool calls * fix: reduce function size * fix: import session handling * Revert "fix: import session handling" This reverts commit deb257dc107fc72bdee932953ee803023b73c838. * fix: linting pin mypy * [Feat]: Guardrails - Add streaming for bedrock post guard (#11247) * feat: add streaming for bedrock post guard * fix: bedrock guardrails * fix: add clear comments * Update litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: clean up bedrock guardrails --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * [Fix] Responses API - Session management (#11254) * fix: import session handling * fix: imports for session handler * tests: tests for session handler * Update enterprise/litellm_enterprise/enterprise_callbacks/session_handler.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * bump: bump litellm enterprise * fixes: test_create_user_default_budget * fix(xai/): filter 'strict' on tool call * test: update test for new error string * fix(utils.py): default to None if not set in model cost map ensures consistent usage of 'supports_[x]' flags * fix(fireworks_ai/): support fireworks ai document inlining on pdf's sent via openai 'file' message type * test: update test * test: name filter_value_from_dict * fix(fireworks_ai/): handle cache control flag in messages * fix(xai/chat): fix check --------- Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-01 05:26:16 +08:00
import json
mistral_model_cost_map = json.load(open("model_prices_and_context_window.json"))
Xai, VertexAI, Google AI Studio - live web search support in OpenAI format (#11251) * build(model_prices_and_context_window.json): fix 'supports_web_search' flag - openai only supports it on 2 models - gpt-4o-search-preview and gpt-4o-mini-search-preview * feat(xai/chat): add xai web search options param support * test: add max tokens to test xai output very verbose * build(xai/): add web search support for all xai models * build(model_prices_and_cost.json): add gemini-2.0 supports web search * feat(gemini/): map openai 'web_search_options' to google's 'googlesearch' tool * build(model_prices_and_context_window.json): add supports_web_search for vertex_ai/gemini-2 models * fix: fix circular reference error * fix(convert_dict_to_response.py): handle scenario where xai returns finish reason as 'stop' for tool calls * fix: reduce function size * fix: import session handling * Revert "fix: import session handling" This reverts commit deb257dc107fc72bdee932953ee803023b73c838. * fix: linting pin mypy * [Feat]: Guardrails - Add streaming for bedrock post guard (#11247) * feat: add streaming for bedrock post guard * fix: bedrock guardrails * fix: add clear comments * Update litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: clean up bedrock guardrails --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * [Fix] Responses API - Session management (#11254) * fix: import session handling * fix: imports for session handler * tests: tests for session handler * Update enterprise/litellm_enterprise/enterprise_callbacks/session_handler.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * bump: bump litellm enterprise * fixes: test_create_user_default_budget * fix(xai/): filter 'strict' on tool call * test: update test for new error string * fix(utils.py): default to None if not set in model cost map ensures consistent usage of 'supports_[x]' flags * fix(fireworks_ai/): support fireworks ai document inlining on pdf's sent via openai 'file' message type * test: update test * test: name filter_value_from_dict * fix(fireworks_ai/): handle cache control flag in messages * fix(xai/chat): fix check --------- Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-01 05:26:16 +08:00
for model, model_info in mistral_model_cost_map.items():
if (
UI - Add Azure Content Safety Guardrails (improved UX) (#12330) * build(model_prices_and_context_window.json): remove 'supports_tool_choice' for specific mistral models Closes https://github.com/BerriAI/litellm/issues/11750 * feat: initial commit adding cleaner ui for azure text moderation guardrails * feat(guardrail_endpoints.py): add discoverable guardrail configs and improve converting base model to dict with types * fix(guardrail_provider_fields.tsx): render from api endpoint correctly * fix(guardrail_provider_fields.tsx): cleanup * refactor(guardrail_endpoints.py): refactor to handle dictionaries with literal - allows multiselect * feat(ui/): render dictionary with known keys correctly * feat(ui/): render optional params on separate page * style(ui/): style improvements to rendering optional params on the UI * feat(azure/prompt_shield.py): add azure prompt shield back on UI * fix(add_guardrail_form.tsx): fix form to handle updated api * fix(guardrail_optional_params.tsx): ensure values are nested correctly for writing to api * fix: fix linting error * test: update tests * fix mapped tests (#12320) * fix - use flush llm client cache * faster mapped tests * test_async_multiple_response_ids_routing * fix tests * test_ateam_member_update_admin_requires_premium * regular mapped tests * Revert "Fix: Initialize JSON logging for all loggers when JSON_LOGS=True (#12206)" This reverts commit 2c60c316ec5df6c2c427cbbb3d8254a45218edb4. * reset num workers * check_for_litellm_module_deletion * add test * add code_qa_check_tests * ci/cd new release * docs(opentelemetry_integration.md): add otel debug flag to docs help people debug their traces easily * [Feat] Add failure logging support for s3 logger (#12299) * add async_log_failure_event * test_basic_s3_v2_logging_failure * Comma separated spend and budget (#12317) * all_keys_table, key_info_view, organizations * teams * the whole usage page * teams page * users table * user info * more commas * some more commas * Segregate MCP tools on connections using headers (#12296) * Add get tools segregation * add ui changes (#12302) * resolve comments * add mapped tests * remove advanced settings (#12323) * [Bug Fix] /generateContent API - Only pass supported params when using OpenAI models (#12297) * fix - only pass GenericLiteLLMParams * test_google_generate_content_with_openai * Fix: Fix custom ca bundle support in aiohttp transport (#12281) * Unify usage of get_ssl_configuration * Fix doc * [Feat] Add github co-pilot as a new LLM API provider (#12325) * Litellm dev 03 05 2025 contributor prs (#9079) * feat: add support for copilot provider * test: add tests for github copilot * chore: clean up github copilot authenticator * test: add test for github copilot authenticator * test: add test for github copilot for sonnet 3.7 thought model * Fix #7629 - Add tzdata package to Dockerfile (#8915) * Add tzdata package to Dockerfile * Move tzdata to python requirement.txt * feat: add support for copilot provider (#8577) * feat: add support for copilot provider * test: add tests for github copilot * chore: clean up github copilot authenticator * test: add test for github copilot authenticator * test: add test for github copilot for sonnet 3.7 thought model --------- Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com> * feat: add model information for copilot models * fix: fix linting errors * test: remove integration test for github_copilot + fix misisng mock * fix: use print to make sure the logger message shown * test: remove debug print * fix lint (#11112) * Add init files to make test directories Python packages and update import paths in test_token_counter.py (#11119) * Update litellm/model_prices_and_context_window_backup.json Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com> --------- Co-authored-by: Son H. Nguyen <nhs.000.dev@gmail.com> Co-authored-by: subnet.dev <50828879+subnet-dev@users.noreply.github.com> Co-authored-by: Son H. Nguyen <33925625+nhs000@users.noreply.github.com> Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com> Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com> * refactor github copilot * test_github_copilot_transformation.py * test_github_copilot_authenticator.py * add GitHub Copilot * fix order * doc fix --------- Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com> Co-authored-by: Son H. Nguyen <nhs.000.dev@gmail.com> Co-authored-by: subnet.dev <50828879+subnet-dev@users.noreply.github.com> Co-authored-by: Son H. Nguyen <33925625+nhs000@users.noreply.github.com> Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com> * add new env vars to docs * ssl_cert_error (#12327) * feat - add new banner on startup (#12328) * [Security Bug Fix] Ensure only LLM API route fails get logged on Langfuse (and other loggers) (#12308) * _is_proxy_only_llm_api_error * test_proxy_only_error_true_for_llm_route * add not on change * Update tests/test_litellm/proxy/test_proxy_utils.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * add test_post_call_failure_hook_auth_error_key_info_route * test fix _is_proxy_only_llm_api_error * test_chat_completion_request_with_redaction * test_post_call_failure_hook_auth_error_llm_api_route --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Ensure message redaction works for responses API logging (#12291) * add fixes to choice implementation redaction * add isInstance check on responses API * change datadog to revert back * change datadog to revert back * fix type errors * Redaction test changes * Redaction test changes * Redaction test changes - remove changes * [Feat] UI - Allow Viewing/Editing Team Based Callbacks (#12329) * add logging settings view on UI * fix change ordering * fix type error * test fix - import loc * [Feat] QA - Arize Team based logging (#12331) * add _get_tracer_with_dynamic_headers * fix construct_dynamic_arize_headers * [Feat] UI - Allow Viewing/Editing Team Based Callbacks (#12329) * add logging settings view on UI * fix change ordering * add construct_dynamic_otel_headers for arize * refactor common code * test_construct_dynamic_arize_headers * otel unit tests * test_arize_dynamic_params * test_arize_dynamic_headers_in_grpc_requests * [Feat] UI - Allow setting Logging Callback Setting per Key (#12333) * allow adding logging settings on a key * add ability to edit key logging settings * dont leak api keys on ui * fix order * add langsmith settings * ui new build * test_default_api_base * fix new utils tests * bump: version 1.73.7 → 1.74.0 * Add mcp server segregation comma separated support (#12326) * add mcp comma separated support * dont support legacy json array * lint * add live tail state to session storage (#12335) * add aiml * fix: fix unused imports --------- Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com> Co-authored-by: tanjiro <56165694+NANDINI-star@users.noreply.github.com> Co-authored-by: Jugal D. Bhatt <55304795+jugaldb@users.noreply.github.com> Co-authored-by: Joost van Doorn <joost.van.doorn@gmail.com> Co-authored-by: Son H. Nguyen <nhs.000.dev@gmail.com> Co-authored-by: subnet.dev <50828879+subnet-dev@users.noreply.github.com> Co-authored-by: Son H. Nguyen <33925625+nhs000@users.noreply.github.com> Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-06 00:24:54 +08:00
"bedrock" in model_info.get("litellm_provider")
and model_info.get("mode") == "chat"
UI - Add Azure Content Safety Guardrails (improved UX) (#12330) * build(model_prices_and_context_window.json): remove 'supports_tool_choice' for specific mistral models Closes https://github.com/BerriAI/litellm/issues/11750 * feat: initial commit adding cleaner ui for azure text moderation guardrails * feat(guardrail_endpoints.py): add discoverable guardrail configs and improve converting base model to dict with types * fix(guardrail_provider_fields.tsx): render from api endpoint correctly * fix(guardrail_provider_fields.tsx): cleanup * refactor(guardrail_endpoints.py): refactor to handle dictionaries with literal - allows multiselect * feat(ui/): render dictionary with known keys correctly * feat(ui/): render optional params on separate page * style(ui/): style improvements to rendering optional params on the UI * feat(azure/prompt_shield.py): add azure prompt shield back on UI * fix(add_guardrail_form.tsx): fix form to handle updated api * fix(guardrail_optional_params.tsx): ensure values are nested correctly for writing to api * fix: fix linting error * test: update tests * fix mapped tests (#12320) * fix - use flush llm client cache * faster mapped tests * test_async_multiple_response_ids_routing * fix tests * test_ateam_member_update_admin_requires_premium * regular mapped tests * Revert "Fix: Initialize JSON logging for all loggers when JSON_LOGS=True (#12206)" This reverts commit 2c60c316ec5df6c2c427cbbb3d8254a45218edb4. * reset num workers * check_for_litellm_module_deletion * add test * add code_qa_check_tests * ci/cd new release * docs(opentelemetry_integration.md): add otel debug flag to docs help people debug their traces easily * [Feat] Add failure logging support for s3 logger (#12299) * add async_log_failure_event * test_basic_s3_v2_logging_failure * Comma separated spend and budget (#12317) * all_keys_table, key_info_view, organizations * teams * the whole usage page * teams page * users table * user info * more commas * some more commas * Segregate MCP tools on connections using headers (#12296) * Add get tools segregation * add ui changes (#12302) * resolve comments * add mapped tests * remove advanced settings (#12323) * [Bug Fix] /generateContent API - Only pass supported params when using OpenAI models (#12297) * fix - only pass GenericLiteLLMParams * test_google_generate_content_with_openai * Fix: Fix custom ca bundle support in aiohttp transport (#12281) * Unify usage of get_ssl_configuration * Fix doc * [Feat] Add github co-pilot as a new LLM API provider (#12325) * Litellm dev 03 05 2025 contributor prs (#9079) * feat: add support for copilot provider * test: add tests for github copilot * chore: clean up github copilot authenticator * test: add test for github copilot authenticator * test: add test for github copilot for sonnet 3.7 thought model * Fix #7629 - Add tzdata package to Dockerfile (#8915) * Add tzdata package to Dockerfile * Move tzdata to python requirement.txt * feat: add support for copilot provider (#8577) * feat: add support for copilot provider * test: add tests for github copilot * chore: clean up github copilot authenticator * test: add test for github copilot authenticator * test: add test for github copilot for sonnet 3.7 thought model --------- Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com> * feat: add model information for copilot models * fix: fix linting errors * test: remove integration test for github_copilot + fix misisng mock * fix: use print to make sure the logger message shown * test: remove debug print * fix lint (#11112) * Add init files to make test directories Python packages and update import paths in test_token_counter.py (#11119) * Update litellm/model_prices_and_context_window_backup.json Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com> --------- Co-authored-by: Son H. Nguyen <nhs.000.dev@gmail.com> Co-authored-by: subnet.dev <50828879+subnet-dev@users.noreply.github.com> Co-authored-by: Son H. Nguyen <33925625+nhs000@users.noreply.github.com> Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com> Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com> * refactor github copilot * test_github_copilot_transformation.py * test_github_copilot_authenticator.py * add GitHub Copilot * fix order * doc fix --------- Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com> Co-authored-by: Son H. Nguyen <nhs.000.dev@gmail.com> Co-authored-by: subnet.dev <50828879+subnet-dev@users.noreply.github.com> Co-authored-by: Son H. Nguyen <33925625+nhs000@users.noreply.github.com> Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com> * add new env vars to docs * ssl_cert_error (#12327) * feat - add new banner on startup (#12328) * [Security Bug Fix] Ensure only LLM API route fails get logged on Langfuse (and other loggers) (#12308) * _is_proxy_only_llm_api_error * test_proxy_only_error_true_for_llm_route * add not on change * Update tests/test_litellm/proxy/test_proxy_utils.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * add test_post_call_failure_hook_auth_error_key_info_route * test fix _is_proxy_only_llm_api_error * test_chat_completion_request_with_redaction * test_post_call_failure_hook_auth_error_llm_api_route --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Ensure message redaction works for responses API logging (#12291) * add fixes to choice implementation redaction * add isInstance check on responses API * change datadog to revert back * change datadog to revert back * fix type errors * Redaction test changes * Redaction test changes * Redaction test changes - remove changes * [Feat] UI - Allow Viewing/Editing Team Based Callbacks (#12329) * add logging settings view on UI * fix change ordering * fix type error * test fix - import loc * [Feat] QA - Arize Team based logging (#12331) * add _get_tracer_with_dynamic_headers * fix construct_dynamic_arize_headers * [Feat] UI - Allow Viewing/Editing Team Based Callbacks (#12329) * add logging settings view on UI * fix change ordering * add construct_dynamic_otel_headers for arize * refactor common code * test_construct_dynamic_arize_headers * otel unit tests * test_arize_dynamic_params * test_arize_dynamic_headers_in_grpc_requests * [Feat] UI - Allow setting Logging Callback Setting per Key (#12333) * allow adding logging settings on a key * add ability to edit key logging settings * dont leak api keys on ui * fix order * add langsmith settings * ui new build * test_default_api_base * fix new utils tests * bump: version 1.73.7 → 1.74.0 * Add mcp server segregation comma separated support (#12326) * add mcp comma separated support * dont support legacy json array * lint * add live tail state to session storage (#12335) * add aiml * fix: fix unused imports --------- Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com> Co-authored-by: tanjiro <56165694+NANDINI-star@users.noreply.github.com> Co-authored-by: Jugal D. Bhatt <55304795+jugaldb@users.noreply.github.com> Co-authored-by: Joost van Doorn <joost.van.doorn@gmail.com> Co-authored-by: Son H. Nguyen <nhs.000.dev@gmail.com> Co-authored-by: subnet.dev <50828879+subnet-dev@users.noreply.github.com> Co-authored-by: Son H. Nguyen <33925625+nhs000@users.noreply.github.com> Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-06 00:24:54 +08:00
and any(
m in model
for m in [
"mistral.mistral-large-2402-v1:0",
"mistral.mistral-small-2402-v1:0",
]
)
):
Xai, VertexAI, Google AI Studio - live web search support in OpenAI format (#11251) * build(model_prices_and_context_window.json): fix 'supports_web_search' flag - openai only supports it on 2 models - gpt-4o-search-preview and gpt-4o-mini-search-preview * feat(xai/chat): add xai web search options param support * test: add max tokens to test xai output very verbose * build(xai/): add web search support for all xai models * build(model_prices_and_cost.json): add gemini-2.0 supports web search * feat(gemini/): map openai 'web_search_options' to google's 'googlesearch' tool * build(model_prices_and_context_window.json): add supports_web_search for vertex_ai/gemini-2 models * fix: fix circular reference error * fix(convert_dict_to_response.py): handle scenario where xai returns finish reason as 'stop' for tool calls * fix: reduce function size * fix: import session handling * Revert "fix: import session handling" This reverts commit deb257dc107fc72bdee932953ee803023b73c838. * fix: linting pin mypy * [Feat]: Guardrails - Add streaming for bedrock post guard (#11247) * feat: add streaming for bedrock post guard * fix: bedrock guardrails * fix: add clear comments * Update litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: clean up bedrock guardrails --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * [Fix] Responses API - Session management (#11254) * fix: import session handling * fix: imports for session handler * tests: tests for session handler * Update enterprise/litellm_enterprise/enterprise_callbacks/session_handler.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * bump: bump litellm enterprise * fixes: test_create_user_default_budget * fix(xai/): filter 'strict' on tool call * test: update test for new error string * fix(utils.py): default to None if not set in model cost map ensures consistent usage of 'supports_[x]' flags * fix(fireworks_ai/): support fireworks ai document inlining on pdf's sent via openai 'file' message type * test: update test * test: name filter_value_from_dict * fix(fireworks_ai/): handle cache control flag in messages * fix(xai/chat): fix check --------- Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-01 05:26:16 +08:00
"""
Update all mistral models to supports_response_schema
Xai, VertexAI, Google AI Studio - live web search support in OpenAI format (#11251) * build(model_prices_and_context_window.json): fix 'supports_web_search' flag - openai only supports it on 2 models - gpt-4o-search-preview and gpt-4o-mini-search-preview * feat(xai/chat): add xai web search options param support * test: add max tokens to test xai output very verbose * build(xai/): add web search support for all xai models * build(model_prices_and_cost.json): add gemini-2.0 supports web search * feat(gemini/): map openai 'web_search_options' to google's 'googlesearch' tool * build(model_prices_and_context_window.json): add supports_web_search for vertex_ai/gemini-2 models * fix: fix circular reference error * fix(convert_dict_to_response.py): handle scenario where xai returns finish reason as 'stop' for tool calls * fix: reduce function size * fix: import session handling * Revert "fix: import session handling" This reverts commit deb257dc107fc72bdee932953ee803023b73c838. * fix: linting pin mypy * [Feat]: Guardrails - Add streaming for bedrock post guard (#11247) * feat: add streaming for bedrock post guard * fix: bedrock guardrails * fix: add clear comments * Update litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: clean up bedrock guardrails --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * [Fix] Responses API - Session management (#11254) * fix: import session handling * fix: imports for session handler * tests: tests for session handler * Update enterprise/litellm_enterprise/enterprise_callbacks/session_handler.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * bump: bump litellm enterprise * fixes: test_create_user_default_budget * fix(xai/): filter 'strict' on tool call * test: update test for new error string * fix(utils.py): default to None if not set in model cost map ensures consistent usage of 'supports_[x]' flags * fix(fireworks_ai/): support fireworks ai document inlining on pdf's sent via openai 'file' message type * test: update test * test: name filter_value_from_dict * fix(fireworks_ai/): handle cache control flag in messages * fix(xai/chat): fix check --------- Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-01 05:26:16 +08:00
"""
UI - Add Azure Content Safety Guardrails (improved UX) (#12330) * build(model_prices_and_context_window.json): remove 'supports_tool_choice' for specific mistral models Closes https://github.com/BerriAI/litellm/issues/11750 * feat: initial commit adding cleaner ui for azure text moderation guardrails * feat(guardrail_endpoints.py): add discoverable guardrail configs and improve converting base model to dict with types * fix(guardrail_provider_fields.tsx): render from api endpoint correctly * fix(guardrail_provider_fields.tsx): cleanup * refactor(guardrail_endpoints.py): refactor to handle dictionaries with literal - allows multiselect * feat(ui/): render dictionary with known keys correctly * feat(ui/): render optional params on separate page * style(ui/): style improvements to rendering optional params on the UI * feat(azure/prompt_shield.py): add azure prompt shield back on UI * fix(add_guardrail_form.tsx): fix form to handle updated api * fix(guardrail_optional_params.tsx): ensure values are nested correctly for writing to api * fix: fix linting error * test: update tests * fix mapped tests (#12320) * fix - use flush llm client cache * faster mapped tests * test_async_multiple_response_ids_routing * fix tests * test_ateam_member_update_admin_requires_premium * regular mapped tests * Revert "Fix: Initialize JSON logging for all loggers when JSON_LOGS=True (#12206)" This reverts commit 2c60c316ec5df6c2c427cbbb3d8254a45218edb4. * reset num workers * check_for_litellm_module_deletion * add test * add code_qa_check_tests * ci/cd new release * docs(opentelemetry_integration.md): add otel debug flag to docs help people debug their traces easily * [Feat] Add failure logging support for s3 logger (#12299) * add async_log_failure_event * test_basic_s3_v2_logging_failure * Comma separated spend and budget (#12317) * all_keys_table, key_info_view, organizations * teams * the whole usage page * teams page * users table * user info * more commas * some more commas * Segregate MCP tools on connections using headers (#12296) * Add get tools segregation * add ui changes (#12302) * resolve comments * add mapped tests * remove advanced settings (#12323) * [Bug Fix] /generateContent API - Only pass supported params when using OpenAI models (#12297) * fix - only pass GenericLiteLLMParams * test_google_generate_content_with_openai * Fix: Fix custom ca bundle support in aiohttp transport (#12281) * Unify usage of get_ssl_configuration * Fix doc * [Feat] Add github co-pilot as a new LLM API provider (#12325) * Litellm dev 03 05 2025 contributor prs (#9079) * feat: add support for copilot provider * test: add tests for github copilot * chore: clean up github copilot authenticator * test: add test for github copilot authenticator * test: add test for github copilot for sonnet 3.7 thought model * Fix #7629 - Add tzdata package to Dockerfile (#8915) * Add tzdata package to Dockerfile * Move tzdata to python requirement.txt * feat: add support for copilot provider (#8577) * feat: add support for copilot provider * test: add tests for github copilot * chore: clean up github copilot authenticator * test: add test for github copilot authenticator * test: add test for github copilot for sonnet 3.7 thought model --------- Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com> * feat: add model information for copilot models * fix: fix linting errors * test: remove integration test for github_copilot + fix misisng mock * fix: use print to make sure the logger message shown * test: remove debug print * fix lint (#11112) * Add init files to make test directories Python packages and update import paths in test_token_counter.py (#11119) * Update litellm/model_prices_and_context_window_backup.json Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com> --------- Co-authored-by: Son H. Nguyen <nhs.000.dev@gmail.com> Co-authored-by: subnet.dev <50828879+subnet-dev@users.noreply.github.com> Co-authored-by: Son H. Nguyen <33925625+nhs000@users.noreply.github.com> Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com> Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com> * refactor github copilot * test_github_copilot_transformation.py * test_github_copilot_authenticator.py * add GitHub Copilot * fix order * doc fix --------- Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com> Co-authored-by: Son H. Nguyen <nhs.000.dev@gmail.com> Co-authored-by: subnet.dev <50828879+subnet-dev@users.noreply.github.com> Co-authored-by: Son H. Nguyen <33925625+nhs000@users.noreply.github.com> Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com> * add new env vars to docs * ssl_cert_error (#12327) * feat - add new banner on startup (#12328) * [Security Bug Fix] Ensure only LLM API route fails get logged on Langfuse (and other loggers) (#12308) * _is_proxy_only_llm_api_error * test_proxy_only_error_true_for_llm_route * add not on change * Update tests/test_litellm/proxy/test_proxy_utils.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * add test_post_call_failure_hook_auth_error_key_info_route * test fix _is_proxy_only_llm_api_error * test_chat_completion_request_with_redaction * test_post_call_failure_hook_auth_error_llm_api_route --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Ensure message redaction works for responses API logging (#12291) * add fixes to choice implementation redaction * add isInstance check on responses API * change datadog to revert back * change datadog to revert back * fix type errors * Redaction test changes * Redaction test changes * Redaction test changes - remove changes * [Feat] UI - Allow Viewing/Editing Team Based Callbacks (#12329) * add logging settings view on UI * fix change ordering * fix type error * test fix - import loc * [Feat] QA - Arize Team based logging (#12331) * add _get_tracer_with_dynamic_headers * fix construct_dynamic_arize_headers * [Feat] UI - Allow Viewing/Editing Team Based Callbacks (#12329) * add logging settings view on UI * fix change ordering * add construct_dynamic_otel_headers for arize * refactor common code * test_construct_dynamic_arize_headers * otel unit tests * test_arize_dynamic_params * test_arize_dynamic_headers_in_grpc_requests * [Feat] UI - Allow setting Logging Callback Setting per Key (#12333) * allow adding logging settings on a key * add ability to edit key logging settings * dont leak api keys on ui * fix order * add langsmith settings * ui new build * test_default_api_base * fix new utils tests * bump: version 1.73.7 → 1.74.0 * Add mcp server segregation comma separated support (#12326) * add mcp comma separated support * dont support legacy json array * lint * add live tail state to session storage (#12335) * add aiml * fix: fix unused imports --------- Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com> Co-authored-by: tanjiro <56165694+NANDINI-star@users.noreply.github.com> Co-authored-by: Jugal D. Bhatt <55304795+jugaldb@users.noreply.github.com> Co-authored-by: Joost van Doorn <joost.van.doorn@gmail.com> Co-authored-by: Son H. Nguyen <nhs.000.dev@gmail.com> Co-authored-by: subnet.dev <50828879+subnet-dev@users.noreply.github.com> Co-authored-by: Son H. Nguyen <33925625+nhs000@users.noreply.github.com> Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-06 00:24:54 +08:00
del model_info["supports_tool_choice"]
print(f"Updated {model} to support response schema")
Xai, VertexAI, Google AI Studio - live web search support in OpenAI format (#11251) * build(model_prices_and_context_window.json): fix 'supports_web_search' flag - openai only supports it on 2 models - gpt-4o-search-preview and gpt-4o-mini-search-preview * feat(xai/chat): add xai web search options param support * test: add max tokens to test xai output very verbose * build(xai/): add web search support for all xai models * build(model_prices_and_cost.json): add gemini-2.0 supports web search * feat(gemini/): map openai 'web_search_options' to google's 'googlesearch' tool * build(model_prices_and_context_window.json): add supports_web_search for vertex_ai/gemini-2 models * fix: fix circular reference error * fix(convert_dict_to_response.py): handle scenario where xai returns finish reason as 'stop' for tool calls * fix: reduce function size * fix: import session handling * Revert "fix: import session handling" This reverts commit deb257dc107fc72bdee932953ee803023b73c838. * fix: linting pin mypy * [Feat]: Guardrails - Add streaming for bedrock post guard (#11247) * feat: add streaming for bedrock post guard * fix: bedrock guardrails * fix: add clear comments * Update litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: clean up bedrock guardrails --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * [Fix] Responses API - Session management (#11254) * fix: import session handling * fix: imports for session handler * tests: tests for session handler * Update enterprise/litellm_enterprise/enterprise_callbacks/session_handler.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * bump: bump litellm enterprise * fixes: test_create_user_default_budget * fix(xai/): filter 'strict' on tool call * test: update test for new error string * fix(utils.py): default to None if not set in model cost map ensures consistent usage of 'supports_[x]' flags * fix(fireworks_ai/): support fireworks ai document inlining on pdf's sent via openai 'file' message type * test: update test * test: name filter_value_from_dict * fix(fireworks_ai/): handle cache control flag in messages * fix(xai/chat): fix check --------- Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-01 05:26:16 +08:00
json.dump(
mistral_model_cost_map, open("model_prices_and_context_window.json", "w"), indent=4
)