Skip to content

Get Completion With Options

This example assumes using Ollama; is in scope and apiKey contains your Ollama API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
await using var container = await Environment.PrepareAsync(TestModels.Chat);

var response = await container.Client.GenerateAsync(new GenerateRequest
{
    Model = TestModels.Chat,
    Prompt = "answer me just \"123\"",
    Options = new ModelOptions
    {
        Temperature = 0,
    },
});
Console.WriteLine(response.Response);