feat: cohore_v2 support

This commit is contained in:
sajdkabir 2025-04-08 23:17:20 +05:30
parent ff3a6830a4
commit ac9c9bb729
10 changed files with 1480 additions and 6 deletions

View file

@ -21,11 +21,15 @@ def validate_environment(
messages: List[AllMessageValues],
optional_params: dict,
api_key: Optional[str] = None,
api_version: Optional[str] = "v1",
) -> dict:
"""
Return headers to use for cohere chat completion request
Cohere API Ref: https://docs.cohere.com/reference/chat
Cohere API Ref:
- v1: https://docs.cohere.com/reference/chat
- v2: https://docs.cohere.com/v2/reference/chat
Expected headers:
{
"Request-Source": "unspecified:litellm",