mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
fix: move get_str_from_messages to module-level import and forward n param to aimage_generation
This commit is contained in:
parent
eb300c79d7
commit
dcb69f3f88
1 changed files with 2 additions and 4 deletions
|
|
@ -91,6 +91,7 @@ from litellm.litellm_core_utils.mock_functions import (
|
|||
)
|
||||
from litellm.litellm_core_utils.prompt_templates.common_utils import (
|
||||
get_content_from_model_response,
|
||||
get_str_from_messages,
|
||||
)
|
||||
from litellm.llms.base_llm import BaseConfig, BaseImageGenerationConfig
|
||||
from litellm.llms.base_llm.base_model_iterator import (
|
||||
|
|
@ -595,10 +596,6 @@ async def acompletion( # noqa: PLR0915
|
|||
pass # model not in cost map — treat as normal completion
|
||||
|
||||
if _is_image_model:
|
||||
from litellm.litellm_core_utils.prompt_templates.common_utils import (
|
||||
get_str_from_messages,
|
||||
)
|
||||
|
||||
_prompt = get_str_from_messages(messages) if messages else ""
|
||||
_img_kwargs = {
|
||||
k: v
|
||||
|
|
@ -610,6 +607,7 @@ async def acompletion( # noqa: PLR0915
|
|||
prompt=_prompt,
|
||||
api_key=api_key,
|
||||
api_base=base_url,
|
||||
n=n,
|
||||
**_img_kwargs,
|
||||
)
|
||||
# Convert ImageResponse → ModelResponse for chat completion clients
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue