File size: 493 Bytes
9f9394b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
# 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