agent: Support pasting images as context (#29177)
https://github.com/user-attachments/assets/d6a27b05-3590-4f40-a820-f6f99f6bd581 Release Notes: - agent: Added support for pasting images as context --------- Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
This commit is contained in:
co-authored by
Danilo Leal
parent
3357736aea
commit
eca6d5a04e
@@ -32,7 +32,14 @@ impl std::fmt::Debug for LanguageModelImage {
|
||||
const ANTHROPIC_SIZE_LIMT: f32 = 1568.;
|
||||
|
||||
impl LanguageModelImage {
|
||||
pub fn from_image(data: Image, cx: &mut App) -> Task<Option<Self>> {
|
||||
pub fn empty() -> Self {
|
||||
Self {
|
||||
source: "".into(),
|
||||
size: size(DevicePixels(0), DevicePixels(0)),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_image(data: Arc<Image>, cx: &mut App) -> Task<Option<Self>> {
|
||||
cx.background_spawn(async move {
|
||||
match data.format() {
|
||||
gpui::ImageFormat::Png
|
||||
|
||||
Reference in New Issue
Block a user