feat: add image support across all endpoints (responses, completions, gemini)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user