Skip to main content

gproxy_protocol/gemini/
images.rs

1use serde::{Deserialize, Serialize};
2use serde_json::Value;
3
4#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
5#[serde(rename_all = "camelCase")]
6#[derive(gproxy_protocol_macros::WireBuilder)]
7#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
8pub struct ImagenPredictRequest {
9    // models.predict defines each instance as google.protobuf.Value.
10    pub instances: Vec<Value>,
11    /// `upstream_docs/gemini/docs/Models.md`, `models.predict.parameters`:
12    /// prediction parameters are an arbitrary `google.protobuf.Value`.
13    #[serde(skip_serializing_if = "Option::is_none")]
14    pub parameters: Option<Value>,
15    #[serde(default, skip_serializing_if = "serde_json::Map::is_empty", flatten)]
16    pub rest: serde_json::Map<String, Value>,
17}
18
19#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
20#[serde(rename_all = "camelCase")]
21#[derive(gproxy_protocol_macros::WireBuilder)]
22#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
23pub struct ImagenPredictResponse {
24    // models.predict defines each prediction as google.protobuf.Value.
25    #[serde(default, skip_serializing_if = "Vec::is_empty")]
26    pub predictions: Vec<Value>,
27    #[serde(default, skip_serializing_if = "serde_json::Map::is_empty", flatten)]
28    pub rest: serde_json::Map<String, Value>,
29}