undo indication set.

This commit is contained in:
Haiping Chen 2025-01-13 11:45:40 -06:00
parent da402f5eb0
commit 48d2e43e38
3 changed files with 5 additions and 10 deletions

View file

@ -50,14 +50,13 @@ public class ChatCompletionProvider : IChatCompletion
var content = response.Content.OfType<TextContent>().FirstOrDefault(); var content = response.Content.OfType<TextContent>().FirstOrDefault();
var toolResult = response.Content.OfType<ToolUseContent>().First(); var toolResult = response.Content.OfType<ToolUseContent>().First();
responseMessage = new RoleDialogModel(AgentRole.Function, response.FirstMessage?.Text ?? string.Empty) responseMessage = new RoleDialogModel(AgentRole.Function, content?.Text ?? string.Empty)
{ {
CurrentAgentId = agent.Id, CurrentAgentId = agent.Id,
MessageId = conversations.LastOrDefault()?.MessageId ?? string.Empty, MessageId = conversations.LastOrDefault()?.MessageId ?? string.Empty,
ToolCallId = toolResult.Id, ToolCallId = toolResult.Id,
FunctionName = toolResult.Name, FunctionName = toolResult.Name,
FunctionArgs = JsonSerializer.Serialize(toolResult.Input), FunctionArgs = JsonSerializer.Serialize(toolResult.Input),
Indication = content.Text
}; };
} }
else else

View file

@ -58,8 +58,7 @@ public class ChatCompletionProvider : IChatCompletion
CurrentAgentId = agent.Id, CurrentAgentId = agent.Id,
MessageId = conversations.LastOrDefault()?.MessageId ?? string.Empty, MessageId = conversations.LastOrDefault()?.MessageId ?? string.Empty,
FunctionName = toolCall?.FunctionName, FunctionName = toolCall?.FunctionName,
FunctionArgs = toolCall?.FunctionArguments?.ToString(), FunctionArgs = toolCall?.FunctionArguments?.ToString()
Indication = value.Content.FirstOrDefault()?.Text
}; };
// Somethings LLM will generate a function name with agent name. // Somethings LLM will generate a function name with agent name.
@ -163,8 +162,7 @@ public class ChatCompletionProvider : IChatCompletion
CurrentAgentId = agent.Id, CurrentAgentId = agent.Id,
MessageId = conversations.LastOrDefault()?.MessageId ?? string.Empty, MessageId = conversations.LastOrDefault()?.MessageId ?? string.Empty,
FunctionName = toolCall?.FunctionName, FunctionName = toolCall?.FunctionName,
FunctionArgs = toolCall?.FunctionArguments?.ToString(), FunctionArgs = toolCall?.FunctionArguments?.ToString()
Indication = value.Content.FirstOrDefault()?.Text
}; };
// Somethings LLM will generate a function name with agent name. // Somethings LLM will generate a function name with agent name.

View file

@ -55,8 +55,7 @@ public class ChatCompletionProvider : IChatCompletion
MessageId = conversations.LastOrDefault()?.MessageId ?? string.Empty, MessageId = conversations.LastOrDefault()?.MessageId ?? string.Empty,
ToolCallId = toolCall?.Id, ToolCallId = toolCall?.Id,
FunctionName = toolCall?.FunctionName, FunctionName = toolCall?.FunctionName,
FunctionArgs = toolCall?.FunctionArguments?.ToString(), FunctionArgs = toolCall?.FunctionArguments?.ToString()
Indication = value.Content.FirstOrDefault()?.Text
}; };
// Somethings LLM will generate a function name with agent name. // Somethings LLM will generate a function name with agent name.
@ -142,8 +141,7 @@ public class ChatCompletionProvider : IChatCompletion
MessageId = conversations.LastOrDefault()?.MessageId ?? string.Empty, MessageId = conversations.LastOrDefault()?.MessageId ?? string.Empty,
ToolCallId = toolCall?.Id, ToolCallId = toolCall?.Id,
FunctionName = toolCall?.FunctionName, FunctionName = toolCall?.FunctionName,
FunctionArgs = toolCall?.FunctionArguments?.ToString(), FunctionArgs = toolCall?.FunctionArguments?.ToString()
Indication = value.Content.FirstOrDefault()?.Text
}; };
// Somethings LLM will generate a function name with agent name. // Somethings LLM will generate a function name with agent name.