app-knmojt-13 / src /media /content_assembler.py
AiCoderv2's picture
Deploy Gradio app with multiple files
9f9394b verified
raw
history blame contribute delete
493 Bytes
#
# SPDX-FileCopyrightText: Hadad <hadad@linuxmail.org>
# SPDX-License-Identifier: Apache-2.0
#
async def assemble_content_parts(text_value, url_collection):
parts = []
if text_value:
parts.append({
"type": "text",
"text": text_value
})
for url_item in url_collection:
parts.append({
"type": "image_url",
"image_url": {
"url": url_item
}
})
return parts