feat: add image support across all endpoints (responses, completions, gemini)

This commit is contained in:
Nikketryhard
2026-02-15 17:25:33 -06:00
parent ca9f808ee3
commit 976c44fdd4
6 changed files with 168 additions and 33 deletions

View File

@@ -343,17 +343,29 @@ impl Backend {
}
/// SendUserCascadeMessage with binary protobuf body.
#[allow(dead_code)]
pub async fn send_message(
&self,
cascade_id: &str,
text: &str,
model_enum: u32,
) -> Result<(u16, Vec<u8>), String> {
self.send_message_with_image(cascade_id, text, model_enum, None).await
}
/// SendUserCascadeMessage with optional image attachment.
pub async fn send_message_with_image(
&self,
cascade_id: &str,
text: &str,
model_enum: u32,
image: Option<&crate::proto::ImageData>,
) -> Result<(u16, Vec<u8>), String> {
let token = self.oauth_token().await;
if token.is_empty() {
return Err("No OAuth token available".to_string());
}
let proto = crate::proto::build_request(cascade_id, text, &token, model_enum);
let proto = crate::proto::build_request_with_image(cascade_id, text, &token, model_enum, image);
self.call_proto("SendUserCascadeMessage", proto).await
}