mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
docs(byteplus): register provider endpoints support and cover image dispatch
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
49fcfe503c
commit
97be01c11e
2 changed files with 39 additions and 0 deletions
|
|
@ -439,6 +439,22 @@
|
|||
"interactions": true
|
||||
}
|
||||
},
|
||||
"byteplus": {
|
||||
"display_name": "BytePlus (`byteplus`)",
|
||||
"url": "https://docs.litellm.ai/docs/providers/byteplus",
|
||||
"endpoints": {
|
||||
"chat_completions": false,
|
||||
"messages": false,
|
||||
"responses": false,
|
||||
"embeddings": false,
|
||||
"image_generations": true,
|
||||
"audio_transcriptions": false,
|
||||
"audio_speech": false,
|
||||
"moderations": false,
|
||||
"batches": false,
|
||||
"rerank": false
|
||||
}
|
||||
},
|
||||
"bytez": {
|
||||
"display_name": "Bytez (`bytez`)",
|
||||
"url": "https://docs.litellm.ai/docs/providers/bytez",
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import pytest
|
|||
|
||||
sys.path.insert(0, os.path.abspath("../../../../.."))
|
||||
|
||||
import litellm
|
||||
from litellm import get_llm_provider
|
||||
from litellm.llms.byteplus.image_generation.transformation import (
|
||||
DEFAULT_API_BASE,
|
||||
|
|
@ -221,6 +222,28 @@ class TestBytePlusImageGenerationTransformation:
|
|||
encoding=None,
|
||||
)
|
||||
|
||||
def test_image_generation_dispatches_to_byteplus_handler(self):
|
||||
fake_response = MagicMock()
|
||||
|
||||
with patch.object(
|
||||
litellm.images.main.llm_http_handler,
|
||||
"image_generation_handler",
|
||||
return_value=fake_response,
|
||||
) as mock_handler:
|
||||
result = litellm.image_generation(
|
||||
model="byteplus/seedream-5-0-260128",
|
||||
prompt="a cat surfing a wave",
|
||||
api_key="sk-test",
|
||||
)
|
||||
|
||||
assert result is fake_response
|
||||
mock_handler.assert_called_once()
|
||||
kwargs = mock_handler.call_args.kwargs
|
||||
assert kwargs["custom_llm_provider"] == "byteplus"
|
||||
assert kwargs["model"] == "seedream-5-0-260128"
|
||||
assert kwargs["prompt"] == "a cat surfing a wave"
|
||||
assert isinstance(kwargs["image_generation_provider_config"], BytePlusImageGenerationConfig)
|
||||
|
||||
def test_transform_response_json_parse_error_raises(self):
|
||||
mock_response = MagicMock()
|
||||
mock_response.status_code = 200
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue