ReaderLm

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
G


using var api = new OllamaApiClient();

await apiClient.Models.PullModelAsync("reader-lm:latest").EnsureSuccessAsync();


var enumerable = api.Completions.GenerateCompletionAsync(
    "reader-lm:latest", 
    """
    <html>
      <body>
        <h3>Why is the sky blue?</h3>
        <p>The sky appears blue because of the way light from the sun is reflected by the atmosphere. The atmosphere is made up of gases, including nitrogen and oxygen, which scatter light in all directions. This scattering causes the sunlight to appear as a rainbow of colors, with red light scattered more than other colors.
        </p>
      </body>
    </html>
    """);
await foreach (var response in enumerable)
{
    Console.Write(response.Response);
}

// ### Why is the sky blue?
// 
// The sky appears blue because of the way light from the sun is reflected by the atmosphere. The atmosphere is made up of gases, including nitrogen and oxygen, which scatter light in all directions. This scattering causes the sunlight to appear as a rainbow of colors, with red light scattered more than other colors.