---
sidebar_position: 2
description: Get response 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 response
 Generates a response for a given text query



`Function GetResponse(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 | --prompt | String | &#x2714; | Request text |
  | AdditionalParameters | --options | Structure Of KeyAndValue | &#x2716; | Additional parameters. See GetRequestParametersStructure |
  | AdditionalHeaders | --headers | Map Of KeyAndValue | &#x2716; | Additional request headers, if necessary |

  
  Returns:  Map Of KeyAndValue - Processing result

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


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

    Prompt = "What is 1C:Enterprise?";
    Model  = "tinyllama";

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

    Result = OPI_Ollama.GetResponse(URL, Model, Prompt, , AdditionalHeaders);

    // With paramether

    Prompt = "Ollama is 22 years old and is busy saving the world. Respond using JSON";

    Format = OPI_Tools.JSONToStructure("
    |{
    |""type"": ""object"",
    |""properties"": {
    | ""age"": {
    | ""type"": ""integer""
    | },
    | ""available"": {
    | ""type"": ""boolean""
    | }
    |},
    |""required"": [
    | ""age"",
    | ""available""
    |]
    |}");

    AdditionalParameters = New Structure("format", Format);

    Result = OPI_Ollama.GetResponse(URL, Model, Prompt, AdditionalParameters, AdditionalHeaders);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            # JSON data can also be passed as a path to a .json file
            
            oint ollama GetResponse \
             --url "https://hut.openintegrations.dev/ollama" \
             --model "mario" \
             --prompt "How are you?" \
             --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 GetResponse ^
             --url "https://hut.openintegrations.dev/ollama" ^
             --model "mario" ^
             --prompt "How are you?" ^
             --headers "{'Authorization':'***'}"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "model": "tinyllama",
 "created_at": "2025-12-10T21:15:44.102988237Z",
 "response": "1C:Enterprise is a comprehensive business software solution that offers various modules and functionalities for accounting, financial management, HR, manufacturing, and supply chain management. The solution is designed to help organizations streamline their operations, enhance efficiency, and improve decision-making by providing accurate, timely, and comprehensive data. It is a multiplatform software suite that includes various applications such as Accounts Payable, Accounts Receivable, HRMS, Supply Chain Management, Manufacturing, and Financials. 1C:Enterprise provides customizable reports, dashboards, alerts, and notifications to help users stay up-to-date with important business information, making it an excellent choice for organizations of all sizes.",
 "done": true,
 "done_reason": "stop",
 "context": [
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
  "***",
...
```
