language_model: Add tool results to message content (#17363)

This PR updates the message content for an LLM request to allow it
contain tool results.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-09-04 13:29:01 -04:00 committed by GitHub
parent 74907cb3e6
commit 30b2133336
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 73 additions and 38 deletions

View file

@ -423,6 +423,14 @@ pub enum RequestContent {
#[serde(skip_serializing_if = "Option::is_none")]
cache_control: Option<CacheControl>,
},
#[serde(rename = "tool_result")]
ToolResult {
tool_use_id: String,
is_error: bool,
content: String,
#[serde(skip_serializing_if = "Option::is_none")]
cache_control: Option<CacheControl>,
},
}
#[derive(Debug, Serialize, Deserialize)]