language_model: Add tool uses to message content (#17381)
This PR updates the message content for an LLM request to allow it contain tool uses. We need to send the tool uses back to the model in order for it to recognize the subsequent tool results. Release Notes: - N/A
This commit is contained in:
@@ -267,6 +267,9 @@ pub fn count_anthropic_tokens(
|
||||
MessageContent::Image(image) => {
|
||||
tokens_from_images += image.estimate_tokens();
|
||||
}
|
||||
MessageContent::ToolUse(_tool_use) => {
|
||||
// TODO: Estimate token usage from tool uses.
|
||||
}
|
||||
MessageContent::ToolResult(tool_result) => {
|
||||
string_contents.push_str(&tool_result.content);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user