Skip to content

Commit

Permalink
Update M.E.AI.Abstractions to 9.0.0-preview.9.24556.5
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Nov 13, 2024
1 parent 62081c7 commit 2bb9207
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/MicrosoftAi/AbstractionMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public static ChatRequest ToOllamaSharpChatRequest(IList<ChatMessage> chatMessag
{
FrequencyPenalty = options?.FrequencyPenalty,
PresencePenalty = options?.PresencePenalty,
Seed = (int?)options?.Seed,
Stop = options?.StopSequences?.ToArray(),
Temperature = options?.Temperature,
TopP = options?.TopP,
Expand Down
2 changes: 1 addition & 1 deletion src/OllamaSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.0.0-preview.9.24525.1" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.0.0-preview.9.24556.5" />
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion test/AbstractionMapperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ public void Maps_Options()
ModelId = "llama3.1:405b",
PresencePenalty = 0.3f,
ResponseFormat = ChatResponseFormat.Json,
Seed = 11,
StopSequences = ["stop1", "stop2", "stop3"],
Temperature = 0.1f,
TopP = 10.1f
Expand All @@ -430,6 +431,7 @@ public void Maps_Options()
chatRequest.Options.Stop.Should().BeEquivalentTo("stop1", "stop2", "stop3");
chatRequest.Options.Temperature.Should().Be(0.1f);
chatRequest.Options.TopP.Should().Be(10.1f);
chatRequest.Options.Seed.Should().Be(11);
chatRequest.Stream.Should().BeTrue();
chatRequest.Template.Should().BeNull();

Expand Down Expand Up @@ -488,7 +490,6 @@ public void Maps_Ollama_Options()
.AddOllamaOption(OllamaOption.PresencePenalty, 0.55f)
.AddOllamaOption(OllamaOption.RepeatLastN, 10)
.AddOllamaOption(OllamaOption.RepeatPenalty, 0.66f)
.AddOllamaOption(OllamaOption.Seed, 11)
.AddOllamaOption(OllamaOption.Stop, new string[] { "stop", "quit", "exit" })
.AddOllamaOption(OllamaOption.Temperature, 0.77f)
.AddOllamaOption(OllamaOption.TfsZ, 0.88f)
Expand Down

0 comments on commit 2bb9207

Please sign in to comment.