-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #279 from SciSharp/sk1.2
feat: upgrade semantic kernel to 1.2
- Loading branch information
Showing
11 changed files
with
102 additions
and
105 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
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
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
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
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
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
59 changes: 29 additions & 30 deletions
59
tests/BotSharp.Plugin.SemanticKernel.UnitTests/Helpers/ResultHelper.cs
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 |
---|---|---|
@@ -1,35 +1,34 @@ | ||
using Microsoft.SemanticKernel.AI.ChatCompletion; | ||
using Microsoft.SemanticKernel.AI.TextCompletion; | ||
using Microsoft.SemanticKernel.Orchestration; | ||
using Microsoft.SemanticKernel; | ||
using Microsoft.SemanticKernel.ChatCompletion; | ||
|
||
namespace BotSharp.Plugin.SemanticKernel.UnitTests.Helpers | ||
{ | ||
public class ResultHelper : IChatResult, ITextResult | ||
{ | ||
public ModelResult ModelResult { get; set; } | ||
private string _response; | ||
//namespace BotSharp.Plugin.SemanticKernel.UnitTests.Helpers | ||
//{ | ||
// public class ResultHelper : KernelContent | ||
// { | ||
// public TextContent ModelResult { get; set; } | ||
// private string _response; | ||
|
||
public ResultHelper(string response) | ||
{ | ||
ModelResult = new ModelResult(response); | ||
_response = response; | ||
} | ||
// public ResultHelper(string response) | ||
// { | ||
// ModelResult = new TextContent(response); | ||
// _response = response; | ||
// } | ||
|
||
public async Task<ChatMessage> GetChatMessageAsync(CancellationToken cancellationToken = default) | ||
{ | ||
return await Task.FromResult(new MockModelResult(_response)); | ||
} | ||
// public async Task<ChatMessageContent> GetChatMessageAsync(CancellationToken cancellationToken = default) | ||
// { | ||
// return await Task.FromResult(new MockModelResult(_response)); | ||
// } | ||
|
||
public Task<string> GetCompletionAsync(CancellationToken cancellationToken = default) | ||
{ | ||
return Task.FromResult(_response); | ||
} | ||
// public Task<string> GetCompletionAsync(CancellationToken cancellationToken = default) | ||
// { | ||
// return Task.FromResult(_response); | ||
// } | ||
|
||
public class MockModelResult : ChatMessage | ||
{ | ||
public MockModelResult(string content) : base(AuthorRole.Assistant, content, null) | ||
{ | ||
} | ||
} | ||
} | ||
} | ||
// public class MockModelResult : ChatMessageContent | ||
// { | ||
// public MockModelResult(string content) : base(AuthorRole.Assistant, content, null) | ||
// { | ||
// } | ||
// } | ||
// } | ||
//} |
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
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
Oops, something went wrong.