Spaces:
Runtime error
Runtime error
Download src/media/content_assembler.py from AiCoderv2/app-knmojt-13: direct link, hf CLI and curl.
- Browser
- Download file 493 Bytes
-
https://huggingface.co/spaces/AiCoderv2/app-knmojt-13/resolve/main/src/media/content_assembler.py
- Command line
-
hf download hf://spaces/AiCoderv2/app-knmojt-13/src/media/content_assembler.py
-
curl -L -o content_assembler.py https://huggingface.co/spaces/AiCoderv2/app-knmojt-13/resolve/main/src/media/content_assembler.py
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 |