mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-23 21:33:58 +00:00
move SambaNovaInferenceAdapter from bespoke convert_message_to_openai_dict_with_b64_images to common convert_message_to_openai_dict_new
This commit is contained in:
parent
218c89fff1
commit
fbf5096e5f
2 changed files with 8 additions and 150 deletions
|
|
@ -564,6 +564,7 @@ class UnparseableToolCall(BaseModel):
|
|||
|
||||
async def convert_message_to_openai_dict_new(
|
||||
message: Message | dict,
|
||||
download_images: bool = False,
|
||||
) -> OpenAIChatCompletionMessage:
|
||||
"""
|
||||
Convert a Message to an OpenAI API-compatible dictionary.
|
||||
|
|
@ -607,7 +608,9 @@ async def convert_message_to_openai_dict_new(
|
|||
elif isinstance(content_, ImageContentItem):
|
||||
return OpenAIChatCompletionContentPartImageParam(
|
||||
type="image_url",
|
||||
image_url=OpenAIImageURL(url=await convert_image_content_to_url(content_)),
|
||||
image_url=OpenAIImageURL(
|
||||
url=await convert_image_content_to_url(content_, download=download_images)
|
||||
),
|
||||
)
|
||||
elif isinstance(content_, list):
|
||||
return [await impl(item) for item in content_]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue