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-05-26T14:36:34.8686767Z",
"response": "1C:Enterprise is a powerful suite of enterprise-grade applications developed by Citi, which provides...",
"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,
13988,
9460,
310,
3896,
7734,
29899,
8228,
8324,
8906,
491,
21353,
29875,
29892,
607,
8128,
5381,
6851,
363,
25700,
4822,
5164,
21136,
267,
29889,
739,
7805,
8324,
1316,
408,
3633,
292,
29892,
5146,
1245,
29892,
10596,
5832,
29892,
322,
11817,
706,
10643,
29892,
4249,
4045,
29889,
450,
9460,
338,
10816,
8688,
304,
5870,
278,
4225,
310,
18161,
21561,
29892,
12012,
3864,
14582,
29892,
9045,
18020,
13113,
29879,
29892,
322,
916,
2919,
3896,
7734,
29879,
411,
4280,
11780,
29889
],
"total_duration": 1879086200,
"load_duration": 460512200,
"prompt_eval_count": 43,
"prompt_eval_duration": 206222900,
"eval_count": 86,
"eval_duration": 1170030900
}