Get response
Generates a response for a given text query
- Parameters
- Advanced call ?
Function GetResponse(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 | --prompt | String | ✔ | Request text |
| AdditionalParameters | --options | Structure Of KeyAndValue | ✖ | Additional parameters. See GetRequestParametersStructure |
| AdditionalHeaders | --headers | Map Of KeyAndValue | ✖ | Additional request headers, if necessary |
Returns
Map Of KeyAndValue - Processing result
| 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) |
tip
Method at API documentation: Generate a completion
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);
- Bash
- CMD/Bat
# 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':'***'}"
:: 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':'***'}"
Result
{
"model": "tinyllama",
"created_at": "2026-07-19T17:08:06.0092105Z",
"response": "1C:Enterprise is a comprehensive suite of business management software designed for small and medium-sized enterprises (SMEs). The product is aimed at helping SMEs streamline their operations, improve efficiency, and grow their businesses. It offers a wide range of features such as accounting, inventory management, production planning, sales and marketing automation, human resources management, and much more. 1C:Enterprise is available for PC, Mac, and mobile devices and has been developed using Microsoft .NET framework 4.7.",
"done": true,
"done_reason": "stop",
"context": [
529,
29989,
5205,
29989,
29958,
13,
3492,
526,
263,
8444,
319,
29902,
20255,
29889,
2,
29871,
13,
29966,
29989,
1792,
29989,
29958,
13,
5618,
338,
29871,
29896,
29907,
29901,
10399,
7734,
29973,
2,
29871,
13,
29966,
29989,
465,
22137,
29989,
29958,
13,
29896,
29907,
29901,
10399,
7734,
338,
263,
15171,
6270,
9460,
310,
5381,
10643,
7047,
8688,
363,
2319,
322,
18350,
29899,
2311,
29881,
3896,
7734,
29879,
313,
17061,
14190,
467,
450,
3234,
338,
12242,
287,
472,
19912,
13766,
14190,
4840,
1220,
1009,
6931,
29892,
11157,
19201,
29892,
322,
6548,
1009,
5381,
267,
29889,
739,
16688,
263,
9377,
3464,
310,
5680,
1316,
408,
3633,
292,
29892,
11817,
706,
10643,
29892,
5802,
18987,
29892,
16538,
322,
9999,
292,
5092,
291,
29892,
5199,
7788,
10643,
29892,
322,
1568,
901,
29889,
29871,
29896,
29907,
29901,
10399,
7734,
338,
3625,
363,
9609,
29892,
4326,
29892,
322,
10426,
...