mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
Fix black
This commit is contained in:
parent
e3440baa0c
commit
2e3a4bb27a
2 changed files with 12 additions and 9 deletions
|
|
@ -1,4 +1,6 @@
|
|||
from litellm.llms.base_llm.image_generation.transformation import BaseImageGenerationConfig
|
||||
from litellm.llms.base_llm.image_generation.transformation import (
|
||||
BaseImageGenerationConfig,
|
||||
)
|
||||
|
||||
from .transformation import DashScopeImageGenerationConfig
|
||||
|
||||
|
|
|
|||
|
|
@ -27,9 +27,14 @@ from typing import TYPE_CHECKING, Any, List, Optional
|
|||
|
||||
import httpx
|
||||
|
||||
from litellm.llms.base_llm.image_generation.transformation import BaseImageGenerationConfig
|
||||
from litellm.llms.base_llm.image_generation.transformation import (
|
||||
BaseImageGenerationConfig,
|
||||
)
|
||||
from litellm.secret_managers.main import get_secret_str
|
||||
from litellm.types.llms.openai import AllMessageValues, OpenAIImageGenerationOptionalParams
|
||||
from litellm.types.llms.openai import (
|
||||
AllMessageValues,
|
||||
OpenAIImageGenerationOptionalParams,
|
||||
)
|
||||
from litellm.types.utils import ImageObject, ImageResponse
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -93,9 +98,7 @@ class DashScopeImageGenerationConfig(BaseImageGenerationConfig):
|
|||
stream: Optional[bool] = None,
|
||||
) -> str:
|
||||
return (
|
||||
api_base
|
||||
or get_secret_str("DASHSCOPE_API_BASE_IMAGE")
|
||||
or DEFAULT_API_BASE
|
||||
api_base or get_secret_str("DASHSCOPE_API_BASE_IMAGE") or DEFAULT_API_BASE
|
||||
)
|
||||
|
||||
def validate_environment(
|
||||
|
|
@ -176,9 +179,7 @@ class DashScopeImageGenerationConfig(BaseImageGenerationConfig):
|
|||
|
||||
choices = response_data.get("output", {}).get("choices", [])
|
||||
for choice in choices:
|
||||
content_list = (
|
||||
choice.get("message", {}).get("content", [])
|
||||
)
|
||||
content_list = choice.get("message", {}).get("content", [])
|
||||
for content_item in content_list:
|
||||
image_url = content_item.get("image")
|
||||
if image_url:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue