undo indication set.
This commit is contained in:
parent
da402f5eb0
commit
48d2e43e38
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue