litellm/litellm
Dmitry fc75380b88
fix(presidio): use correct text positions in anonymize_text (#24998)
* fix(presidio): use correct text positions in anonymize_text (#24160)

The Presidio anonymizer endpoint returns items with start/end positions
that reference the *anonymized output* text, not the original input.
anonymize_text() was applying these positions to the original text,
causing garbled output with remnants of un-masked PII data.

When output_parse_pii is False, return redacted_text["text"] directly
from the anonymizer response instead of manually splicing.

When output_parse_pii is True, use analyze_results positions (which
correctly reference the original text) to build numbered replacement
tokens and the pii_tokens mapping.

* address review: remove dead code, fix token numbering order

- Remove unused `anon_item_by_entity` dict (Greptile P2)
- Number tokens left-to-right (<PERSON_1> first in text, not last)
- Add assertion for token numbering order in test
2026-04-04 18:46:43 -07:00
..
a2a_protocol Litellm ishaan march23 - MCP Toolsets + GCP Caching fix (#25146) (#25155) 2026-04-04 16:23:21 -07:00
anthropic_interface style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
assistants
batch_completion
batches Merge pull request #23957 from Sameerlite/litellm_vertex-cancel-batch 2026-03-20 23:32:50 +05:30
caching fix(cache): Prevent "multiple values" error in get_cache_key (#20261) 2026-04-04 18:40:56 -07:00
completion_extras fix(lint): apply Black formatting to 14 files (#24532) 2026-03-31 07:45:55 -07:00
containers Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
endpoints/speech/speech_to_completion_bridge
evals Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
experimental_mcp_client Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
files style: run black formatter on 52 non-enterprise files 2026-03-12 14:23:50 -03:00
fine_tuning address greptile review feedback (greploop iteration 1) 2026-03-27 20:04:41 +05:30
google_genai Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
images Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
integrations fix(s3_v2): use prepared URL for SigV4-signed S3 requests (#25074) 2026-04-04 18:39:37 -07:00
interactions Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
litellm_core_utils Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
llms Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
ocr Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
passthrough style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
proxy fix(presidio): use correct text positions in anonymize_text (#24998) 2026-04-04 18:46:43 -07:00
proxy_auth
rag style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
realtime_api Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
rerank_api Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
responses Litellm ishaan march23 - MCP Toolsets + GCP Caching fix (#25146) (#25155) 2026-04-04 16:23:21 -07:00
router_strategy Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
router_utils Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
search Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
secret_managers Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
skills Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
types Litellm ishaan march23 - MCP Toolsets + GCP Caching fix (#25146) (#25155) 2026-04-04 16:23:21 -07:00
vector_store_files Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
vector_stores Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
videos [Staging] - Ishaan March 17th (#23903) 2026-03-18 15:09:01 -07:00
__init__.py Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
_lazy_imports.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
_lazy_imports_registry.py feat: add sagemaker_nova provider for Amazon Nova models on SageMaker (#21542) 2026-03-14 15:10:01 -07:00
_logging.py Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
_redis.py Litellm ishaan march23 - MCP Toolsets + GCP Caching fix (#25146) (#25155) 2026-04-04 16:23:21 -07:00
_redis_credential_provider.py Litellm ishaan march23 - MCP Toolsets + GCP Caching fix (#25146) (#25155) 2026-04-04 16:23:21 -07:00
_service_logger.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
_uuid.py
_version.py
anthropic_beta_headers_config.json fix: enable context-1m-2025-08-07 beta header for vertex_ai provider (#21867) 2026-02-21 20:12:23 -08:00
anthropic_beta_headers_manager.py Refactor: Filtering beta header after transformation 2026-03-16 10:47:15 +05:30
blog_posts.json docs(blog): add WebRTC blog post link 2026-03-13 17:54:33 +05:30
budget_manager.py
constants.py cherry-pick: tag query fix + MCP metadata support (#25145) 2026-04-04 16:44:02 -07:00
cost.json
cost_calculator.py [Test Fix] fix gov pricing tests (#25022) 2026-04-02 15:55:55 -07:00
exceptions.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
main.py Litellm ishaan april4 2 (#25150) 2026-04-04 23:09:42 +00:00
model_prices_and_context_window_backup.json Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
mypy.ini
policy_templates_backup.json feat(add-new-block_code_execution-guardrail): prevent agent from executing code (#22154) 2026-02-25 22:02:14 -08:00
provider_endpoints_support_backup.json feat(search): add Serper (serper.dev) as search provider (#23112) 2026-03-09 08:40:37 -07:00
py.typed
router.py Litellm ishaan april4 2 (#25150) 2026-04-04 23:09:42 +00:00
scheduler.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
setup_wizard.py Litellm fix update bedrock models (#24947) 2026-04-01 19:22:54 -07:00
timeout.py
utils.py Litellm ishaan april4 2 (#25150) 2026-04-04 23:09:42 +00:00