diff --git a/src/tests/Ollama.IntegrationTests/Tests.ReaderLm.cs b/src/tests/Ollama.IntegrationTests/Tests.ReaderLm.cs new file mode 100755 index 0000000..402ce83 --- /dev/null +++ b/src/tests/Ollama.IntegrationTests/Tests.ReaderLm.cs @@ -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", + """ + + +

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. +

+ + + """); + 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. + } +} \ No newline at end of file