botsharp enchance
This commit is contained in:
parent
9d4d824c1a
commit
1c2c7b7de0
|
|
@ -68,7 +68,7 @@ public partial class AgentService
|
||||||
var name = prop.Name;
|
var name = prop.Name;
|
||||||
var node = prop.Value;
|
var node = prop.Value;
|
||||||
var matched = true;
|
var matched = true;
|
||||||
if (node.TryGetProperty(visibleExpress, out var element))
|
if (node.ValueKind == JsonValueKind.Object && node.TryGetProperty(visibleExpress, out var element))
|
||||||
{
|
{
|
||||||
var expression = element.GetString();
|
var expression = element.GetString();
|
||||||
matched = RenderVisibility(expression, renderDict);
|
matched = RenderVisibility(expression, renderDict);
|
||||||
|
|
|
||||||
|
|
@ -281,10 +281,6 @@ public class ChatCompletionProvider : IChatCompletion
|
||||||
var text = choice.ContentUpdate[0]?.Text ?? string.Empty;
|
var text = choice.ContentUpdate[0]?.Text ?? string.Empty;
|
||||||
textStream.Collect(text);
|
textStream.Collect(text);
|
||||||
|
|
||||||
#if DEBUG
|
|
||||||
_logger.LogCritical($"Content update: {text}");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
var content = new RoleDialogModel(AgentRole.Assistant, text)
|
var content = new RoleDialogModel(AgentRole.Assistant, text)
|
||||||
{
|
{
|
||||||
CurrentAgentId = agent.Id,
|
CurrentAgentId = agent.Id,
|
||||||
|
|
@ -325,7 +321,7 @@ public class ChatCompletionProvider : IChatCompletion
|
||||||
: string.Empty;
|
: string.Empty;
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
_logger.LogCritical($"Tool Call (id: {toolCallId}) => {functionName}({functionArgument})");
|
_logger.LogTrace($"Tool Call (id: {toolCallId}) => {functionName}({functionArgument})");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
responseMessage = new RoleDialogModel(AgentRole.Function, string.Empty)
|
responseMessage = new RoleDialogModel(AgentRole.Function, string.Empty)
|
||||||
|
|
@ -341,7 +337,7 @@ public class ChatCompletionProvider : IChatCompletion
|
||||||
else if (choice.FinishReason.HasValue)
|
else if (choice.FinishReason.HasValue)
|
||||||
{
|
{
|
||||||
var allText = textStream.GetText();
|
var allText = textStream.GetText();
|
||||||
_logger.LogCritical($"Text Content: {allText}");
|
_logger.LogTrace($"Text Content: {allText}");
|
||||||
|
|
||||||
responseMessage = new RoleDialogModel(AgentRole.Assistant, allText)
|
responseMessage = new RoleDialogModel(AgentRole.Assistant, allText)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue