You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-12-24 00:01:24 +02:00
50 lines
1.6 KiB
Plaintext
Vendored
50 lines
1.6 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 2
|
|
description: Get images 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 images
|
|
Generates images based on the specified description
|
|
|
|
|
|
|
|
`Function GetImages(Val URL, Val Token, Val Model, Val Description, Val AdditionalHeaders = "") Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| URL | --url | String | ✔ | OpenAI server URL |
|
|
| Token | --token | String | ✔ | OpenAI authorization token |
|
|
| Model | --model | String | ✔ | Models name |
|
|
| Description | --descr | Structure Of KeyAndValue | ✔ | Generation parameters. See GetImageDescriptionStructure |
|
|
| AdditionalHeaders | --headers | Map Of KeyAndValue | ✖ | Additional request headers, if necessary |
|
|
|
|
|
|
Returns: Map Of KeyAndValue - Processing result
|
|
|
|
<br/>
|
|
|
|
:::tip
|
|
Method at API documentation: [Create image](https://platform.openai.com/docs/api-reference/images/create)
|
|
:::
|
|
<br/>
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
URL = "https://bothub.chat/api/v2/openai/";
|
|
Token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUzYTUwNWFiLTdhYmEtNDkyNy05YmQ0LTZlNDFlZGEyZGRmYyIsImlzRGV2Z...";
|
|
|
|
Model = "dall-e-3";
|
|
Description = OPI_OpenAI.GetImageDescriptionStructure("Yellow alpaca", 1, , "1024x1024");
|
|
Result = OPI_OpenAI.GetImages(URL, Token, Model, Description);
|
|
```
|
|
|
|
|
|
|
|
|
|
|