Merge branch 'SciSharp:master' into master

This commit is contained in:
Joanna Ren 2024-10-18 14:26:23 -05:00 committed by GitHub
commit f7e37044f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 15 deletions

View file

@ -40,10 +40,10 @@ public partial class ConversationService
routing.Context.Push(agent.Id, reason: "request started");
// Save payload in order to assign the payload before hook is invoked
if (replyMessage != null && !string.IsNullOrEmpty(replyMessage.Payload))
{
message.Payload = replyMessage.Payload;
}
// if (replyMessage != null && !string.IsNullOrEmpty(replyMessage.Payload))
// {
// message.Payload = replyMessage.Payload;
// }
// Before chat completion hook
hooks = ReOrderConversationHooks(hooks);

View file

@ -16,15 +16,7 @@ public partial class RoutingService
role = agent.Name;
}
if (role == AgentRole.User)
{
conversation += $"{role}: {dialog.Payload ?? dialog.Content}\r\n";
}
else
{
// Assistant reply deosn't need help with payload
conversation += $"{role}: {dialog.Content}\r\n";
}
conversation += $"{role}: {dialog.Payload ?? dialog.Content}\r\n";
}
return conversation;

View file

@ -312,7 +312,7 @@ public class ChatCompletionProvider : IChatCompletion
}
else if (message.Role == AgentRole.Assistant)
{
messages.Add(new AssistantChatMessage(message.Content));
messages.Add(new AssistantChatMessage(message.Payload ?? message.Content));
}
}

View file

@ -290,7 +290,7 @@ public class ChatCompletionProvider : IChatCompletion
}
else if (message.Role == AgentRole.Assistant)
{
messages.Add(new AssistantChatMessage(message.Content));
messages.Add(new AssistantChatMessage(message.Payload ?? message.Content));
}
}