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-07-19T17:08:32.3894884Z",
"message": {
"role": "assistant",
"content": "1C:Enterprise has been continuously enhanced and released since its original launch in the mid-2000s. The most recent version of the software, known as 1C:Enterprise 15, was released in 2017. At this time, it includes numerous improvements and updates, including new features, enhancements to existing ones, and bug fixes.\n\nRegarding the exact release date, the official release dates of 1C:Enterprise software are as follows:\n\n- 1C:3D - Version 4.6 (April 2008)\n- 1C:3D - Version 5.2 (September 2009)\n- 1C:3D - Version 5.4 (March 2011)\n- 1C:3D - Version 6.0 (June 2012)\n- 1C:3D - Version 6.1 (November 2013)\n- 1C:3D - Version 6.2 (January 2014)\n- 1C:3D - Version 7.0 (October 2015)\n- 1C:3D - Version 8.0 (February 2016)\n- 1C:3D - Version 8.1 (July 2016)\n- 1C:3D - Version 9.0 (August 2017)\n\nThe latest version of 1C:Enterprise is 15, which was released in 2017."
},
"done": true,
"done_reason": "stop",
"total_duration": 12637744000,
"load_duration": 111482200,
"prompt_eval_count": 319,
"prompt_eval_duration": 805372000,
"eval_count": 367,
"eval_duration": 11696134000
}