Support images in agent2 threads (#36152)
- Support adding ImageContent to messages through copy/paste and through path completions - Ensure images are fully converted to LanguageModelImageContent before sending them to the model - Update ACP crate to v0.0.24 to enable passing image paths through the protocol Release Notes: - N/A --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
e2ce787c05
commit
b1e806442a
7 changed files with 415 additions and 92 deletions
|
@ -443,9 +443,8 @@ impl ContentBlock {
|
|||
}),
|
||||
..
|
||||
}) => Self::resource_link_md(&uri),
|
||||
acp::ContentBlock::Image(_)
|
||||
| acp::ContentBlock::Audio(_)
|
||||
| acp::ContentBlock::Resource(_) => String::new(),
|
||||
acp::ContentBlock::Image(image) => Self::image_md(&image),
|
||||
acp::ContentBlock::Audio(_) | acp::ContentBlock::Resource(_) => String::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -457,6 +456,10 @@ impl ContentBlock {
|
|||
}
|
||||
}
|
||||
|
||||
fn image_md(_image: &acp::ImageContent) -> String {
|
||||
"`Image`".into()
|
||||
}
|
||||
|
||||
fn to_markdown<'a>(&'a self, cx: &'a App) -> &'a str {
|
||||
match self {
|
||||
ContentBlock::Empty => "",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue