The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix code QA checks
Ishaan Jaffera48705bfaf50
diff --git a/litellm/rag/ingestion/base_ingestion.py b/litellm/rag/ingestion/base_ingestion.pyindex 3d2e72f8538..538a72b5ca4 100644--- a/litellm/rag/ingestion/base_ingestion.py+++ b/litellm/rag/ingestion/base_ingestion.py@@ -16,12 +16,14 @@ import base64from abc import ABC, abstractmethodfrom typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, cast-import httpx-import litellmfrom litellm._logging import verbose_loggerfrom litellm._uuid import uuid4from litellm.constants import DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE+from litellm.llms.custom_httpx.http_handler import (+ get_async_httpx_client,+ httpxSpecialProvider,+)from litellm.rag.text_splitters import RecursiveCharacterTextSplitterfrom litellm.types.rag import RAGIngestOptions, RAGIngestResponse@@ -86,12 +88,12 @@ class BaseRAGIngestion(ABC):return filename, file_content, content_type, Noneif file_url:- async with httpx.AsyncClient() as http_client:- response = await http_client.get(file_url)- response.raise_for_status()- file_content = response.content- filename = file_url.split("/")[-1] or "document"- content_type = response.headers.get("content-type", "application/octet-stream")+ http_client = get_async_httpx_client(llm_provider=httpxSpecialProvider.RAG)+ response = await http_client.get(file_url)+ response.raise_for_status()+ file_content = response.content+ filename = file_url.split("/")[-1] or "document"+ content_type = response.headers.get("content-type", "application/octet-stream")return filename, file_content, content_type, Noneif file_id:diff --git a/litellm/types/llms/custom_http.py b/litellm/types/llms/custom_http.pyindex 46956fedc8e..4d5ca02f032 100644--- a/litellm/types/llms/custom_http.py+++ b/litellm/types/llms/custom_http.py@@ -23,6 +23,7 @@ class httpxSpecialProvider(str, Enum):SSO_HANDLER = "sso_handler"Search = "search"MCP = "mcp"+ RAG = "rag"VerifyTypes = Union[str, bool, ssl.SSLContext]