1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-12-03 22:39:12 +02:00
Files
OpenIntegrations/docs/en/examples/Ollama/GetResponse.txt

36 lines
945 B
Plaintext
Raw Normal View History

2025-04-08 20:31:27 +03:00
 URL = "https://api.athenaeum.digital/ollama";
2025-05-01 23:28:11 +03:00
Token = "10KO-82..."; // Authorization - not part API Ollama
2025-04-08 20:31:27 +03:00
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);
2025-04-12 00:07:36 +03:00
// 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);