diff --git a/litellm/llms/cohere/common_utils.py b/litellm/llms/cohere/common_utils.py index 6dbe52d575..d194d9556b 100644 --- a/litellm/llms/cohere/common_utils.py +++ b/litellm/llms/cohere/common_utils.py @@ -31,7 +31,7 @@ def validate_environment( "Request-Source": "unspecified:litellm", "accept": "application/json", "content-type": "application/json", - "Authorization": "bearer $CO_API_KEY" + "Authorization": "Bearer $CO_API_KEY" } """ headers.update( @@ -42,7 +42,7 @@ def validate_environment( } ) if api_key: - headers["Authorization"] = f"bearer {api_key}" + headers["Authorization"] = f"Bearer {api_key}" return headers diff --git a/litellm/llms/cohere/rerank/transformation.py b/litellm/llms/cohere/rerank/transformation.py index 6586a83f06..f9c979712d 100644 --- a/litellm/llms/cohere/rerank/transformation.py +++ b/litellm/llms/cohere/rerank/transformation.py @@ -86,7 +86,7 @@ class CohereRerankConfig(BaseRerankConfig): ) default_headers = { - "Authorization": f"bearer {api_key}", + "Authorization": f"Bearer {api_key}", "accept": "application/json", "content-type": "application/json", } diff --git a/litellm/llms/infinity/rerank/transformation.py b/litellm/llms/infinity/rerank/transformation.py index 6259d445ae..55aac6033d 100644 --- a/litellm/llms/infinity/rerank/transformation.py +++ b/litellm/llms/infinity/rerank/transformation.py @@ -49,7 +49,7 @@ class InfinityRerankConfig(CohereRerankConfig): ) default_headers = { - "Authorization": f"bearer {api_key}", + "Authorization": f"Bearer {api_key}", "accept": "application/json", "content-type": "application/json", } diff --git a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py index 7a0343e2e9..005b474424 100644 --- a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py +++ b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py @@ -84,7 +84,7 @@ async def set_env_variables_in_header(custom_headers: Optional[dict]) -> Optiona example header can be - {"Authorization": "bearer os.environ/COHERE_API_KEY"} + {"Authorization": "Bearer os.environ/COHERE_API_KEY"} """ if custom_headers is None: return None diff --git a/tests/local_testing/test_pass_through_endpoints.py b/tests/local_testing/test_pass_through_endpoints.py index 9c5f599521..29cf9682a7 100644 --- a/tests/local_testing/test_pass_through_endpoints.py +++ b/tests/local_testing/test_pass_through_endpoints.py @@ -117,7 +117,7 @@ async def test_pass_through_endpoint_rerank(client): { "path": "/v1/rerank", "target": "https://api.cohere.com/v1/rerank", - "headers": {"Authorization": f"bearer {_cohere_api_key}"}, + "headers": {"Authorization": f"Bearer {_cohere_api_key}"}, } ] @@ -193,7 +193,7 @@ async def test_pass_through_endpoint_rpm_limit( "path": "/v1/rerank", "target": "https://api.cohere.com/v1/rerank", "auth": auth, - "headers": {"Authorization": f"bearer {_cohere_api_key}"}, + "headers": {"Authorization": f"Bearer {_cohere_api_key}"}, } ] @@ -293,7 +293,7 @@ async def test_pass_through_endpoint_sequential_rpm_limit( "path": "/v1/rerank", "target": "https://api.cohere.com/v1/rerank", "auth": auth, - "headers": {"Authorization": f"bearer {_cohere_api_key}"}, + "headers": {"Authorization": f"Bearer {_cohere_api_key}"}, } ] diff --git a/tests/test_passthrough_endpoints.py b/tests/test_passthrough_endpoints.py index a66c94c583..47ac7511aa 100644 --- a/tests/test_passthrough_endpoints.py +++ b/tests/test_passthrough_endpoints.py @@ -17,7 +17,7 @@ dotenv.load_dotenv() async def cohere_rerank(session): url = "http://localhost:4000/v1/rerank" headers = { - "Authorization": f"bearer {os.getenv('COHERE_API_KEY')}", + "Authorization": f"Bearer {os.getenv('COHERE_API_KEY')}", "Content-Type": "application/json", "Accept": "application/json", }