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



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

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

  
  Returns:  Map Of KeyAndValue - Processing result

:::tip
Method at API documentation: [Generate Embeddings](https://github.com/ollama/ollama/blob/main/docs/api.md#generate-embeddings)
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    URL   = "https://hut.openintegrations.dev/ollama";
    Token = "12We34..."; // Authorization - not part API Ollama

    StingsArray = New Array;
    StingsArray.Add("Why is the sky blue?");
    StingsArray.Add("Why is the grass green?");

    Model = "tinyllama";

    AdditionalHeaders = New Map;
    AdditionalHeaders.Insert("Authorization", StrTemplate("Bearer %1", Token));

    Result = OPI_Ollama.GetEmbeddings(URL, Model, StingsArray, , AdditionalHeaders);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            # JSON data can also be passed as a path to a .json file
            
            oint ollama GetEmbeddings \
             --url "https://hut.openintegrations.dev/ollama" \
             --model "tinyllama" \
             --input "['Why is the sky blue?','Why is the grass green?']" \
             --headers "{'Authorization':'***'}"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            :: JSON data can also be passed as a path to a .json file
            
            oint ollama GetEmbeddings ^
             --url "https://hut.openintegrations.dev/ollama" ^
             --model "tinyllama" ^
             --input "['Why is the sky blue?','Why is the grass green?']" ^
             --headers "{'Authorization':'***'}"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "model": "tinyllama",
 "embeddings": [
  [
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
   "***",
...
```
