mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-30 01:52:18 +00:00
Address review feedback for kluster.ai provider
- Add provider_endpoints_support.json entry (fixes the code-quality provider-documentation check). - Expand supported OpenAI params (user, seed, parallel_tool_calls, stream_options, max_completion_tokens). - Make the provider-info test hermetic by patching get_secret_str instead of os.environ.
This commit is contained in:
parent
9bcb006794
commit
6dfe8a6d18
3 changed files with 30 additions and 1 deletions
|
|
@ -40,10 +40,13 @@ class KlusterAIConfig(OpenAIGPTConfig):
|
|||
def get_supported_openai_params(self, model: str) -> list:
|
||||
return [
|
||||
"max_tokens",
|
||||
"max_completion_tokens",
|
||||
"n",
|
||||
"temperature",
|
||||
"top_p",
|
||||
"seed",
|
||||
"stream",
|
||||
"stream_options",
|
||||
"logprobs",
|
||||
"top_logprobs",
|
||||
"frequency_penalty",
|
||||
|
|
@ -53,4 +56,6 @@ class KlusterAIConfig(OpenAIGPTConfig):
|
|||
"logit_bias",
|
||||
"tools",
|
||||
"tool_choice",
|
||||
"parallel_tool_calls",
|
||||
"user",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -32,6 +32,24 @@
|
|||
}
|
||||
},
|
||||
"providers": {
|
||||
"kluster_ai": {
|
||||
"display_name": "Kluster AI (`kluster_ai`)",
|
||||
"url": "https://docs.litellm.ai/docs/providers/kluster_ai",
|
||||
"endpoints": {
|
||||
"chat_completions": true,
|
||||
"messages": true,
|
||||
"responses": true,
|
||||
"embeddings": false,
|
||||
"image_generations": false,
|
||||
"audio_transcriptions": false,
|
||||
"audio_speech": false,
|
||||
"moderations": false,
|
||||
"batches": false,
|
||||
"rerank": false,
|
||||
"a2a": true,
|
||||
"interactions": true
|
||||
}
|
||||
},
|
||||
"a2a": {
|
||||
"display_name": "A2A (Agent-to-Agent) (`a2a`)",
|
||||
"url": "https://docs.litellm.ai/docs/providers/a2a",
|
||||
|
|
|
|||
|
|
@ -51,7 +51,13 @@ class TestKlusterAIConfig:
|
|||
assert KlusterAIConfig.API_BASE_URL == "https://api.kluster.ai/v1"
|
||||
|
||||
def test_get_openai_compatible_provider_info(self):
|
||||
with patch.dict(os.environ, {"KLUSTER_AI_API_KEY": "sk-secret"}, clear=False):
|
||||
def fake_secret(name, *args, **kwargs):
|
||||
return "sk-secret" if name == "KLUSTER_AI_API_KEY" else None
|
||||
|
||||
with patch(
|
||||
"litellm.llms.kluster_ai.chat.transformation.get_secret_str",
|
||||
side_effect=fake_secret,
|
||||
):
|
||||
api_base, api_key = self.config._get_openai_compatible_provider_info(
|
||||
api_base=None, api_key=None
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue