assistant2: Avoid unnecessary String cloning in tool use (#25725)

This PR removes some unnecessary `String` cloning in the tool use paths.

We now store the data in `Arc<str>`s for cheap cloning.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers
2025-02-27 03:16:09 +00:00
committed by GitHub
parent da22f21dec
commit e7df5ce61c
5 changed files with 19 additions and 16 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ where
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize, Deserialize)]
pub struct LanguageModelToolUse {
pub id: LanguageModelToolUseId,
pub name: String,
pub name: Arc<str>,
pub input: serde_json::Value,
}