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

@ -731,7 +731,7 @@ pub fn map_to_language_model_completion_events(
Ok(LanguageModelCompletionEvent::ToolUse(
LanguageModelToolUse {
id: tool_use.id.into(),
name: tool_use.name,
name: tool_use.name.into(),
input: if tool_use.input_json.is_empty()
{
Value::Null