-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
} | ||
} |