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-26 22:16:09 -05:00 committed by GitHub
parent da22f21dec
commit e7df5ce61c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 19 additions and 16 deletions

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,
}