Skip to content

Commit

Permalink
Merge pull request #306 from xbotter/deps/sk-1.0.0-beta8
Browse files Browse the repository at this point in the history
bump semantic kernel 1.0.0-beta8
  • Loading branch information
AsakusaRinne authored Nov 17, 2023
2 parents 8b6105f + 1056e13 commit 22b3073
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion LLama.Examples/Examples/SemanticKernelChat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static async Task Run()
/// </summary>
private static Task MessageOutputAsync(Microsoft.SemanticKernel.AI.ChatCompletion.ChatHistory chatHistory)
{
var message = chatHistory.Messages.Last();
var message = chatHistory.Last();

Console.WriteLine($"{message.Role}: {message.Content}");
Console.WriteLine("------------------------");
Expand Down
2 changes: 1 addition & 1 deletion LLama.Examples/LLama.Examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.0.0-beta6" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.0.0-beta8" />
<PackageReference Include="Spectre.Console" Version="0.47.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion LLama.KernelMemory/LLamaSharp.KernelMemory.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.KernelMemory.Core" Version="0.9.231114.1-preview" />
<PackageReference Include="Microsoft.KernelMemory.Core" Version="0.10.231116.2-preview" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion LLama.KernelMemory/LLamaSharpTextEmbeddingGeneration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public class LLamaSharpTextEmbeddingGeneration : ITextEmbeddingGeneration, IDisp
private readonly LLamaEmbedder _embedder;
private bool _ownsEmbedder = false;
private bool _ownsWeights = false;
private readonly Dictionary<string, string> _attributes = new();

public IReadOnlyDictionary<string, string> Attributes => this._attributes;

/// <summary>
/// Initializes a new instance of the <see cref="LLamaSharpTextEmbeddingGeneration"/> class.
Expand Down Expand Up @@ -67,7 +70,7 @@ public void Dispose()
{
_weights?.Dispose();
}
if(_ownsEmbedder)
if (_ownsEmbedder)
{
_embedder.Dispose();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public sealed class LLamaSharpChatCompletion : IChatCompletion
private ChatSession session;
private ChatRequestSettings defaultRequestSettings;

private readonly Dictionary<string, string> _attributes = new();

public IReadOnlyDictionary<string, string> Attributes => this._attributes;

static ChatRequestSettings GetDefaultSettings()
{
return new ChatRequestSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace LLamaSharp.SemanticKernel.ChatCompletion;
/// <summary>
/// LLamaSharp Chat Message
/// </summary>
public class LLamaSharpChatMessage : ChatMessageBase
public class LLamaSharpChatMessage : ChatMessage
{
/// <inheritdoc/>
public LLamaSharpChatMessage(AuthorRole role, string content) : base(role, content)
Expand Down
4 changes: 2 additions & 2 deletions LLama.SemanticKernel/ChatCompletion/LLamaSharpChatResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public LLamaSharpChatResult(IAsyncEnumerable<string> stream)
public ModelResult ModelResult => this._modelResult;

/// <inheritdoc/>
public async Task<ChatMessageBase> GetChatMessageAsync(CancellationToken cancellationToken = default)
public async Task<ChatMessage> GetChatMessageAsync(CancellationToken cancellationToken = default)
{
var sb = new StringBuilder();
await foreach (var token in _stream)
Expand All @@ -34,7 +34,7 @@ public async Task<ChatMessageBase> GetChatMessageAsync(CancellationToken cancell
}

/// <inheritdoc/>
public async IAsyncEnumerable<ChatMessageBase> GetStreamingChatMessageAsync([EnumeratorCancellation] CancellationToken cancellationToken = default)
public async IAsyncEnumerable<ChatMessage> GetStreamingChatMessageAsync([EnumeratorCancellation] CancellationToken cancellationToken = default)
{
await foreach (var token in _stream)
{
Expand Down
2 changes: 1 addition & 1 deletion LLama.SemanticKernel/LLamaSharp.SemanticKernel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SemanticKernel.Abstractions" Version="1.0.0-beta6" />
<PackageReference Include="Microsoft.SemanticKernel.Abstractions" Version="1.0.0-beta8" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ public sealed class LLamaSharpTextCompletion : ITextCompletion
{
public ILLamaExecutor executor;

private readonly Dictionary<string, string> _attributes = new();

public IReadOnlyDictionary<string, string> Attributes => this._attributes;

public LLamaSharpTextCompletion(ILLamaExecutor executor)
{
this.executor = executor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ public sealed class LLamaSharpEmbeddingGeneration : ITextEmbeddingGeneration
{
private LLamaEmbedder _embedder;

private readonly Dictionary<string, string> _attributes = new();

public IReadOnlyDictionary<string, string> Attributes => this._attributes;

public LLamaSharpEmbeddingGeneration(LLamaEmbedder embedder)
{
_embedder = embedder;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ both Windows, Linux and MAC without requirment for compiling llama.cpp yourself.
- [API reference](https://scisharp.github.io/LLamaSharp/latest/xmldocs/)

## Examples
- [Official Console Examples](./LLama.Examples/NewVersion/)
- [Official Console Examples](./LLama.Examples/)
- [Unity Demo](https://github.com/eublefar/LLAMASharpUnityDemo)
- [LLamaStack (with WPF and Web support)](https://github.com/saddam213/LLamaStack)

Expand Down

0 comments on commit 22b3073

Please sign in to comment.