assistant2: Restructure storage of tool uses and results (#21194)

This PR restructures the storage of the tool uses and results in
`assistant2` so that they don't live on the individual messages.

It also introduces a `LanguageModelToolUseId` newtype for better type
safety.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-11-25 21:53:27 -05:00 committed by GitHub
parent 7e418cc8af
commit 968ffaa3fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 136 additions and 77 deletions

View file

@ -102,7 +102,12 @@ impl AssistantPanel {
let task = tool.run(tool_use.input, self.workspace.clone(), cx);
self.thread.update(cx, |thread, cx| {
thread.insert_tool_output(tool_use.id.clone(), task, cx);
thread.insert_tool_output(
tool_use.assistant_message_id,
tool_use.id.clone(),
task,
cx,
);
});
}
}