clean comments

This commit is contained in:
Jicheng Lu 2024-10-03 15:00:10 -05:00
parent 8c4e66a6d1
commit f53f156cc0

View file

@ -67,17 +67,6 @@ public class ChatCompletionProvider : IChatCompletion
responseMessage.FunctionName = responseMessage.FunctionName.Split('.').Last(); responseMessage.FunctionName = responseMessage.FunctionName.Split('.').Last();
} }
} }
//else if (reason == ChatFinishReason.ToolCalls)
//{
// var toolCall = value.ToolCalls.FirstOrDefault();
// responseMessage = new RoleDialogModel(AgentRole.Function, text)
// {
// CurrentAgentId = agent.Id,
// MessageId = conversations.LastOrDefault()?.MessageId ?? string.Empty,
// FunctionName = toolCall?.FunctionName,
// FunctionArgs = toolCall?.FunctionArguments
// };
//}
else else
{ {
responseMessage = new RoleDialogModel(AgentRole.Assistant, text) responseMessage = new RoleDialogModel(AgentRole.Assistant, text)
@ -281,13 +270,6 @@ public class ChatCompletionProvider : IChatCompletion
{ {
if (message.Role == AgentRole.Function) if (message.Role == AgentRole.Function)
{ {
//messages.Add(new AssistantChatMessage(string.Empty)
//{
// FunctionCall = new ChatFunctionCall(message.FunctionName, message.FunctionArgs ?? string.Empty)
//});
//messages.Add(new FunctionChatMessage(message.FunctionName, message.Content));
messages.Add(new AssistantChatMessage(new List<ChatToolCall> messages.Add(new AssistantChatMessage(new List<ChatToolCall>
{ {
ChatToolCall.CreateFunctionToolCall(message.FunctionName, message.FunctionName, BinaryData.FromString(message.FunctionArgs ?? string.Empty)) ChatToolCall.CreateFunctionToolCall(message.FunctionName, message.FunctionName, BinaryData.FromString(message.FunctionArgs ?? string.Empty))