--- 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 | ✔ | Ollama server URL | | Model | --model | String | ✔ | Models name | | Question | --input | Array Of String | ✔ | String or array of request strings | | AdditionalParameters | --options | Structure Of KeyAndValue | ✖ | Additional parameters. See GetEmbeddingsParameterStructure | | AdditionalHeaders | --headers | Map Of KeyAndValue | ✖ | 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) :::
```bsl title="1C:Enterprise/OneScript code example" URL = "https://api.athenaeum.digital/ollama"; Token = "10KO-82..."; // 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); ``` ```bash # JSON data can also be passed as a path to a .json file oint ollama GetEmbeddings \ --url "https://api.athenaeum.digital/ollama" \ --model "tinyllama" \ --input "['Why is the sky blue?','Why is the grass green?']" \ --headers "{'Authorization':'Bearer ***'}" ``` ```batch :: JSON data can also be passed as a path to a .json file oint ollama GetEmbeddings ^ --url "https://api.athenaeum.digital/ollama" ^ --model "tinyllama" ^ --input "['Why is the sky blue?','Why is the grass green?']" ^ --headers "{'Authorization':'Bearer ***'}" ``` ```json title="Result" { "model": "tinyllama", "embeddings": [ [ -0.00044430292, 0.025364451, -0.01982562, -0.01386767, -0.007092864, -0.00503173, 0.01651015, -0.028159814, 0.015309966, 0.013927799, 0.009948988, -0.01869834, -0.02563637, -0.022916118, 0.033947412, 0.03941754, 0.02642755, -0.010713595, -0.0076262536, 0.018318623, 0.030285759, 0.002330778, -0.018220112, 0.011386592, 0.000666717, -0.008044991, 0.043651845, 0.05132412, 0.003812024, -0.0136625115, -0.015328717, -0.027654702, 0.001977373, -0.0122701805, 0.011486682, 0.053245112, 0.05337978, -0.0006950077, -0.01195663, 0.01159945, 0.013282272, 0.004622383, 0.040185854, 0.0054333764, -0.019031523, -0.022164648, -0.02582063, -0.014741235, -0.013980079, 0.01294476, 0.031466667, -0.03512586, -0.014624453, -0.009558237, -0.0068604904, -0.007057802, 0.012021439, -0.0006198152, 0.019291516, 0.03393301, -0.027182134, -0.036371164, -0.012455482, 0.02411247, 0.011506146, 0.017271796, 0.0059685884, -0.035789035, 0.0015824656, 0.018839229, -0.04484443, 0.010405249, 0.0181315, -0.029923748, 0.017660325, 0.02027916, -0.011880048, 0.005352395, 0.029090125, -0.01706375, 0.0149785215, 0.014900051, 0.03415813, 0.009630137, 0.007297612, -0.014927609, -0.024197245, 0.021678656, 0.0068406337, 0.011193635, -0.050415695, 0.008101151, 0.01351943, 0.004162063, -0.008875305, -0.017664887, -0.009920957, 0.014776082, 0.013460335, -0.004077699, 0.016902719, 0.0051475936, -0.0084040845, 0.009280715, -0.018571058, 0.0012752402, -0.01596135, -0.0016916095, 0.018394733, 0.019883, 0.027734987, 0.03631366, 0.039260034, -0.016021095, 0.011052684, 0.011507018, -0.0076753194, 0.01993369, 0.0071385438, -0.02870273, -0.02153879, 0.0009840115, -0.010758189, 0.015692476, -0.029970534, 0.01930829, -0.0018783837, -0.0010985625, 0.0052133594, -0.006007234, -0.010127605, -0.019594474, 0.026688702, 0.015195338, -0.0041626943, -0.02570787, 0.021987861, 0.0084545165, -0.015682045, -0.009067063, 0.034213036, 0.010508461, -0.0003027637, -0.051668152, -0.009586356, -0.0067230226, ... ```