﻿---
sidebar_position: 3
description: Get embeddings 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 embeddings
 Gets the embeddings for the given entries



`Function GetEmbeddings(Val URL, Val Token, Val Model, Val Text, Val AdditionalParameters = "", Val AdditionalHeaders = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | URL | --url | String | &#x2714; | OpenAI server URL |
  | Token | --token | String | &#x2714; | OpenAI authorization token |
  | Model | --model | String | &#x2714; | Models name |
  | Text | --input | Array Of String | &#x2714; | String or array of request strings |
  | AdditionalParameters | --options | Structure Of KeyAndValue | &#x2716; | Additional request parameters, if necessary |
  | AdditionalHeaders | --headers | Map Of KeyAndValue | &#x2716; | Additional request headers, if necessary |

  
  Returns:  Map Of KeyAndValue - Processing result

<br/>

:::tip
Method at API documentation: [Create embeddings](https://platform.openai.com/docs/api-reference/embeddings/create)
:::
<br/>



```bsl title="1C:Enterprise/OneScript code example"
    URL   = "https://hut.openintegrations.dev/localai/";
    Token = "12We...";

    Text  = "What is 1C:Enterprise?";
    Model = "text-embedding-ada-002";

    Result = OPI_OpenAI.GetEmbeddings(URL, Token, Model, Text);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint openai GetEmbeddings \
             --url "https://hut.openintegrations.dev/localai/" \
             --token "***" \
             --model "text-embedding-ada-002" \
             --input "What is 1C:Enterprise?"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint openai GetEmbeddings ^
             --url "https://hut.openintegrations.dev/localai/" ^
             --token "***" ^
             --model "text-embedding-ada-002" ^
             --input "What is 1C:Enterprise?"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "created": 1757696988,
 "object": "list",
 "id": "0375cf98-a5a1-418d-94dc-2cc8b5e98c53",
 "model": "text-embedding-ada-002",
 "data": [
  {
   "embedding": [
    -0.0034640837,
    0.065006845,
    0.036527865,
    0.020154536,
    0.052206554,
    -0.020729765,
    0.038841255,
    0.052850127,
    0.048277475,
    -0.003228828,
    -0.022187145,
    0.047483332,
    0.038455833,
    0.053687666,
    -0.016465323,
    0.029086571,
    0.0055962247,
    0.02108401,
    0.054026935,
    0.028484132,
    -0.013958801,
    0.039518118,
    0.033264376,
    0.05773344,
    -0.24631082,
    0.037079547,
    0.03337885,
    0.012708797,
    0.052998986,
    0.015201245,
    0.025211753,
    0.014358103,
    0.047380466,
    -0.05451781,
    0.009077685,
    0.040555883,
    0.03158231,
    0.042614974,
    0.029452903,
    0.049878214,
    0.02112613,
    0.0395226,
    0.027809719,
    0.052837394,
    0.03386907,
    -0.08775653,
    0.018957194,
    0.032147124,
    0.0039617806,
    -0.02585247,
    0.0047940705,
    0.019983806,
    0.032643158,
    0.039651573,
    0.02395145,
    0.033610936,
    0.012853704,
    0.033260085,
    0.028364537,
    0.020483878,
    0.023023864,
    0.028857907,
    0.024164476,
    0.033688318,
    0.021027658,
    -0.023705397,
    0.015833499,
    0.014322523,
    0.016243298,
    0.044204507,
    0.035459153,
    0.036140442,
    0.028193548,
    0.029029187,
    0.039671157,
    0.13306099,
    -0.024043463,
    0.00075658446,
    -0.0006862062,
    0.052160963,
    0.01681016,
    0.026383827,
    0.031632774,
    0.064906254,
    0.04267727,
    0.14228794,
    -0.042618163,
    0.018358178,
    0.030301923,
    0.0044752345,
    0.018920766,
    0.05070815,
    0.033221643,
    0.012964367,
    0.010416805,
    0.02457987,
    -0.27528474,
    0.003804653,
    0.027606592,
    0.013934599,
    0.021305634,
    0.001230495,
    0.048124053,
    0.03207139,
    0.037288293,
    -0.005714557,
    0.023209205,
    0.025294436,
    -0.010689476,
    0.041502725,
    0.014514886,
    -0.017996684,
    0.018753307,
    -0.02607613,
    0.019753894,
    0.06040448,
    0.022945106,
    0.04788241,
    0.012741256,
    0.021794334,
    0.043284543,
    0.0073872246,
    0.046721354,
    0.0040479926,
    0.013514044,
    -0.03261838,
    0.0077355877,
    0.0027494682,
    0.02225154,
    -0.064546436,
    0.035216827,
    0.024696002,
    0.052500326,
    0.053986497,
    -0.02387167,
    0.00901946,
    0.0077160313,
    0.021151569,
    -0.29098326,
    0.035835627,
    -0.010488377,
    -0.036764413,
...
```
