Get context response
Receives the next response from the model according to the message history
- Parameters
- Advanced call ?
Function GetContextResponse(Val URL, Val Model, Val Messages, Val AdditionalParameters = "", Val AdditionalHeaders = "") Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| URL | --url | String | ✔ | Ollama server URL |
| Model | --model | String | ✔ | Models name |
| Messages | --msgs | Array of Structure | ✔ | Messages log. See GetContextMessageStructure |
| 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 chat completion
1C:Enterprise/OneScript code example
URL = "https://hut.openintegrations.dev/ollama";
Token = "12We34..."; // Authorization - not part API Ollama
AdditionalHeaders = New Map;
AdditionalHeaders.Insert("Authorization", StrTemplate("Bearer %1", Token));
Model = "tinyllama";
MessagesArray = New Array;
Question1 = OPI_Ollama.GetContextMessageStructure("user", "What is 1C:Enterprise?");
Question2 = OPI_Ollama.GetContextMessageStructure("user", "When the first version was released?"); // Question without specifics
// Adding the first question to the context
MessagesArray.Add(Question1);
Response1 = OPI_Ollama.GetContextResponse(URL, Model, MessagesArray, , AdditionalHeaders);
MessagesArray.Add(Response1["message"]); // Add response to first question in context
MessagesArray.Add(Question2); // Add second question in context
Response2 = OPI_Ollama.GetContextResponse(URL, Model, MessagesArray, , AdditionalHeaders);
MessagesArray.Add(Response2["message"]);
// ...
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint ollama GetContextResponse \
--url "https://hut.openintegrations.dev/ollama" \
--model "tinyllama" \
--msgs "[{'role':'user','content':'Hello!'}]" \
--options "{'options':{'seed':'555','temperature':'10'}}" \
--headers "{'Authorization':'***'}"
:: JSON data can also be passed as a path to a .json file
oint ollama GetContextResponse ^
--url "https://hut.openintegrations.dev/ollama" ^
--model "tinyllama" ^
--msgs "[{'role':'user','content':'Hello!'}]" ^
--options "{'options':{'seed':'555','temperature':'10'}}" ^
--headers "{'Authorization':'***'}"
Result
{
"model": "tinyllama",
"created_at": "2026-05-26T14:36:41.7716789Z",
"message": {
"role": "assistant",
"content": "The first version of 1C:Enterprise was released in 2003. However, it has since been updated and impr..."
},
"done": true,
"done_reason": "stop",
"total_duration": 1701457000,
"load_duration": 32465800,
"prompt_eval_count": 200,
"prompt_eval_duration": 699569700,
"eval_count": 68,
"eval_duration": 937328000
}