-
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.
Merge pull request #18 from cnblogs/support-function-behavior
feat: support auto invoke functions for non-stream chat
- Loading branch information
Showing
26 changed files
with
925 additions
and
60 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
27 changes: 27 additions & 0 deletions
27
src/SemanticKernel.DashScope/DashScopeChatMessageContent.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Cnblogs.DashScope.Core; | ||
using Microsoft.SemanticKernel; | ||
using Microsoft.SemanticKernel.ChatCompletion; | ||
|
||
namespace Cnblogs.SemanticKernel.Connectors.DashScope; | ||
|
||
/// <summary> | ||
/// DashScope specialized message content | ||
/// </summary> | ||
public class DashScopeChatMessageContent( | ||
AuthorRole role, | ||
string content, | ||
Dictionary<string, object?>? metadata = null, | ||
string? name = null, | ||
List<ToolCall>? toolCalls = null) | ||
: ChatMessageContent(role, content, metadata: metadata) | ||
{ | ||
/// <summary> | ||
/// The name of tool if role is tool. | ||
/// </summary> | ||
public string? Name { get; } = name; | ||
|
||
/// <summary> | ||
/// Optional tool calls. | ||
/// </summary> | ||
public List<ToolCall>? ToolCalls { get; } = toolCalls; | ||
} |
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.