You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-25 22:12:29 +02:00
62 lines
1.7 KiB
Plaintext
Vendored
62 lines
1.7 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 8
|
|
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
|
|
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Ollama]
|
|
---
|
|
|
|
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
|
|
|
|
|
|
|
|
`Function GetContextMessageStructure(Val Role, Val Text, Val Pictures = "", Val Tools = "") Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| 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 |
|
|
|
|
|
|
Returns: Structure Of KeyAndValue - Fields structure
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
Result = OPI_Ollama.GetContextMessageStructure("user", "Hello!");
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
oint ollama GetContextMessageStructure \
|
|
--role "user" \
|
|
--text "Hello!"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
oint ollama GetContextMessageStructure ^
|
|
--role "user" ^
|
|
--text "Hello!"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"role": "user",
|
|
"content": "Hello!"
|
|
}
|
|
```
|