2025-04-08 20:31:27 +03:00
---
2025-04-12 22:59:24 +03:00
sidebar_position: 8
2025-05-05 11:15:20 +03:00
description: Get context message structure and other functions to work with Ollama in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
2025-05-05 09:49:19 +03:00
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Ollama]
2025-04-08 20:31:27 +03:00
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Get context message structure
Gets the message structure for a list of request messages in context
2025-04-12 22:59:24 +03:00
`Function GetContextMessageStructure(Val Role, Val Text, Val Pictures = "", Val Tools = "") Export`
2025-04-08 20:31:27 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
2025-04-12 22:59:24 +03:00
| Role | --role | String | ✔ | Message source: system, user, assistant, tool |
| Text | --text | String | ✔ | Message text |
| Pictures | --images | Array Of String | ✖ | List of pictures in Base64 format (for multimodal models like llava) |
| Tools | --tools | Array Of String | ✖ | List of tools in JSON format that the model should use |
2025-04-08 20:31:27 +03:00
Returns: Structure Of KeyAndValue - Fields structure
<br/>
```bsl title="1C:Enterprise/OneScript code example"
2025-04-12 22:59:24 +03:00
Result = OPI_Ollama.GetContextMessageStructure("user", "Hello!");
2025-04-08 20:31:27 +03:00
```
2025-05-01 20:09:27 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint ollama GetContextMessageStructure \
2025-10-07 19:27:04 +03:00
--role "user" \
--text "Hello!"
2025-05-01 20:09:27 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint ollama GetContextMessageStructure ^
2025-10-07 19:27:04 +03:00
--role "user" ^
--text "Hello!"
2025-05-01 20:09:27 +03:00
```
</TabItem>
</Tabs>
2025-04-08 20:31:27 +03:00
2025-05-01 12:55:47 +03:00
```json title="Result"
{
"role": "user",
"content": "Hello!"
}
```