2025-06-08 20:09:09 +03:00
---
2025-06-25 13:17:23 +03:00
sidebar_position: 8
2025-06-08 20:09:09 +03:00
description: Get image message structure and other functions to work with OpenAI in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, OpenAI]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Get image message structure
Gets the message structure based on the image for the request message list
`Function GetImageMessageStructure(Val Role, Val FileID, Val Text = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Role | --role | String | ✔ | Message source: system, user, developer |
| FileID | --file | String | ✔ | Image file ID. See UploadFile |
| Text | --prompt | String | ✖ | Input text query for image processing |
Returns: Structure Of KeyAndValue - Fields structure
<br/>
```bsl title="1C:Enterprise/OneScript code example"
2025-06-29 14:35:33 +03:00
URL = "https://hut.openintegrations.dev/localai/";
Token = "12We...";
2025-09-15 13:14:53 +03:00
Image = "file-18";
2025-06-08 20:09:09 +03:00
Result = OPI_OpenAI.GetImageMessageStructure("user", Image, "What is in this image?");
```
2025-06-18 21:53:54 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint openai GetImageMessageStructure \
--role "user" \
2025-09-16 09:07:33 +03:00
--file "file-9" \
2025-06-18 21:53:54 +03:00
--prompt "What is in this image?"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint openai GetImageMessageStructure ^
--role "user" ^
2025-09-16 09:07:33 +03:00
--file "file-9" ^
2025-06-18 21:53:54 +03:00
--prompt "What is in this image?"
```
</TabItem>
</Tabs>
2025-06-08 20:09:09 +03:00
2025-06-17 16:20:59 +03:00
```json title="Result"
{
"role": "user",
"content": [
{
"type": "input_image",
2025-09-16 09:07:33 +03:00
"file_id": "file-9"
2025-06-17 16:20:59 +03:00
},
{
"type": "input_text",
"text": "What is in this image?"
}
]
}
```