You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-06-12 00:34:16 +02:00
104 lines
4.1 KiB
Plaintext
Vendored
104 lines
4.1 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';
|
|
import Admonition from '@theme/Admonition';
|
|
|
|
# Get images
|
|
Generates images based on the specified description
|
|
|
|
|
|
|
|
<Tabs>
|
|
<TabItem value="params" label="Parameters" default>
|
|
|
|
`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 |
|
|
|
|
|
|
<div className="return-value-note">
|
|
<div className="return-value-note__title">Returns</div>
|
|
<div className="return-value-note__value">
|
|
Map Of KeyAndValue - Processing result
|
|
</div>
|
|
</div>
|
|
|
|
</TabItem>
|
|
<TabItem value="extended" label={<span>Advanced call{' '}<a href="/docs/Start/Advanced-call" target="_blank" rel="noreferrer" title="About advanced call" onClick={(e) => e.stopPropagation()}>?</a></span>}>
|
|
|
|
| Parameter | Description |
|
|
|---|---|
|
|
| proxy | `InternetProxy` or a structure with fields `Protocol`, `Host`, `Port`, `User`, `Password`, `UseOSAuthentication` |
|
|
| timeout | Request execution timeout |
|
|
| adv_response | Formats the response as a complete HTTP structure with fields `code`, `body`, and `headers` |
|
|
| retries | Number of HTTP request send attempts on `5**` status codes or internal client errors |
|
|
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
|
|
|
|
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
:::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://hut.openintegrations.dev/localai/";
|
|
Token = "12We34...";
|
|
|
|
Model = "sd-1.5-ggml";
|
|
Description = OPI_OpenAI.GetImageDescriptionStructure("Yellow alpaca", 1, , "64x64");
|
|
Result = OPI_OpenAI.GetImages(URL, Token, Model, Description);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
oint openai GetImages \
|
|
--url "https://bothub.chat/api/v2/openai/" \
|
|
--token "***" \
|
|
--model "dall-e-3" \
|
|
--descr "{'prompt':'Yellow alpaca','n':'1','size':'1024x1024'}"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
oint openai GetImages ^
|
|
--url "https://bothub.chat/api/v2/openai/" ^
|
|
--token "***" ^
|
|
--model "dall-e-3" ^
|
|
--descr "{'prompt':'Yellow alpaca','n':'1','size':'1024x1024'}"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"created": 1757982404,
|
|
"data": [
|
|
{
|
|
"revised_prompt": "An adorable, fluffy alpaca standing in a serene field. Its fur is the color of rich, vibrant yellow, appearing almost golden in the sunlight. The alpaca's gentle eyes and cute, rounded ears make it appear friendly and approachable. In the background, tall grasses and a cloudless blue sky portray a peaceful rural scene.",
|
|
"url": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-vf0VrTZ44yHusk7vPGBYcYgW/user-HMyGZPKt7HooVlzCBP2dP9we/img-mcVZADShuw1V7jNhvLr4sGQ6.png?st=2025-09-15T23%3A26%3A44Z&se=2025-09-16T01%3A26%3A44Z&sp=r&sv=2024-08-04&sr=b&rscd=inline&rsct=image/png&skoid=ed3ea2f9-5e38-44be-9a1b-7c1e65e4d54f&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2025-09-15T18%3A27%3A16Z&ske=2025-09-16T18%3A27%3A16Z&sks=b&skv=2024-08-04&sig=tSIPVLt4Wp1jFi4dZa%2BB%2BOdBpZOLgupNwosWvAmPMUc%3D"
|
|
}
|
|
]
|
|
}
|
|
```
|