You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-25 22:12:29 +02:00
61 lines
1.6 KiB
Plaintext
Vendored
61 lines
1.6 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 5
|
|
description: Get user message 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 user message
|
|
Gets the structure of a message from the user for use in a request
|
|
|
|
|
|
|
|
`Function GetUserMessage(Val Text, Val Name = "") ExportReturn GetMessageStructure("user", Text, Name);EndFunction`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| Text | --text | String | ✔ | Message text |
|
|
| Name | --name | String | ✖ | Name of participant in conversation |
|
|
|
|
|
|
Returns: Structure Of KeyAndValue - Fields structure
|
|
|
|
<br/>
|
|
|
|
:::tip
|
|
Is a shorthand for the function `GetMessageStructure`
|
|
:::
|
|
<br/>
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
Result = OPI_OpenAI.GetUserMessage("What is 1C:Enterprise?", "Vitaly");
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
oint openai GetUserMessage \
|
|
--text "What is 1C:Enterprise?" \
|
|
--name "Vitaly"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
oint openai GetUserMessage ^
|
|
--text "What is 1C:Enterprise?" ^
|
|
--name "Vitaly"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
"{\r\n \"role\": \"user\",\r\n \"content\": \"What is 1C:Enterprise?\",\r\n \"name\": \"Vitaly\"\r\n}"
|
|
```
|