﻿---
sidebar_position: 8
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 | &#x2714; | Message source: system, user, developer |
  | FileID | --file | String | &#x2714; | Image file ID. See UploadFile |
  | Text | --prompt | String | &#x2716; | Input text query for image processing |

  
  Returns:  Structure Of KeyAndValue - Fields structure

<br/>




```bsl title="1C:Enterprise/OneScript code example"
    URL   = "https://hut.openintegrations.dev/localai/";
    Token = "12We...";
    Image = "file-70";

    Result = OPI_OpenAI.GetImageMessageStructure("user", Image, "What is in this image?");
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint openai GetImageMessageStructure \
             --role "user" \
             --file "file-60" \
             --prompt "What is in this image?"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint openai GetImageMessageStructure ^
             --role "user" ^
             --file "file-60" ^
             --prompt "What is in this image?"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "role": "user",
 "content": [
  {
   "type": "input_image",
   "file_id": "file-17"
  },
  {
   "type": "input_text",
   "text": "What is in this image?"
  }
 ]
}
```
