mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
(Bug Fix) Using LiteLLM Python SDK with model=litellm_proxy/
for embedding, image_generation, transcription, speech, rerank (#8815)
* test_litellm_gateway_from_sdk * fix embedding check for openai * test litellm proxy provider * fix image generation openai compatible models * fix litellm.transcription * test_litellm_gateway_from_sdk_rerank * docs litellm python sdk * docs litellm python sdk with proxy * test_litellm_gateway_from_sdk_rerank * ci/cd run again * test_litellm_gateway_from_sdk_image_generation * test_litellm_gateway_from_sdk_embedding * test_litellm_gateway_from_sdk_embedding
This commit is contained in:
parent
ef22209a15
commit
f9cee4c46b
6 changed files with 466 additions and 83 deletions
|
@ -75,7 +75,7 @@ def rerank( # noqa: PLR0915
|
|||
query: str,
|
||||
documents: List[Union[str, Dict[str, Any]]],
|
||||
custom_llm_provider: Optional[
|
||||
Literal["cohere", "together_ai", "azure_ai", "infinity"]
|
||||
Literal["cohere", "together_ai", "azure_ai", "infinity", "litellm_proxy"]
|
||||
] = None,
|
||||
top_n: Optional[int] = None,
|
||||
rank_fields: Optional[List[str]] = None,
|
||||
|
@ -162,7 +162,7 @@ def rerank( # noqa: PLR0915
|
|||
)
|
||||
|
||||
# Implement rerank logic here based on the custom_llm_provider
|
||||
if _custom_llm_provider == "cohere":
|
||||
if _custom_llm_provider == "cohere" or _custom_llm_provider == "litellm_proxy":
|
||||
# Implement Cohere rerank logic
|
||||
api_key: Optional[str] = (
|
||||
dynamic_api_key or optional_params.api_key or litellm.api_key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue