Skip to content

Commit

Permalink
docs: Added ReaderLm case.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Sep 15, 2024
1 parent 3ad97b8 commit 0c9fae6
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/tests/Ollama.IntegrationTests/Tests.ReaderLm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
namespace Ollama.IntegrationTests;

public partial class Tests
{
[TestMethod]
public async Task ReaderLm()
{
#if DEBUG
await using var container = await PrepareEnvironmentAsync(EnvironmentType.Local, "reader-lm:latest");
#else
await using var container = await PrepareEnvironmentAsync(EnvironmentType.Container, "reader-lm:latest");
#endif

var enumerable = container.ApiClient.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.
}
}

0 comments on commit 0c9fae6

Please sign in to comment.