Adds missing Clone/Debugs
This commit is contained in:
@@ -33,7 +33,7 @@ impl Content {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct ContentBuilder {
|
pub struct ContentBuilder {
|
||||||
content: Content,
|
content: Content,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use crate::error::{Error, Result};
|
|||||||
|
|
||||||
use super::Content;
|
use super::Content;
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct CountTokensRequest {
|
pub struct CountTokensRequest {
|
||||||
pub contents: Content,
|
pub contents: Content,
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@ impl CountTokensRequest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct CountTokensRequestBuilder {
|
pub struct CountTokensRequestBuilder {
|
||||||
contents: Content,
|
contents: Content,
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ impl CountTokensRequestBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum CountTokensResponse {
|
pub enum CountTokensResponse {
|
||||||
Ok(CountTokensResponseResult),
|
Ok(CountTokensResponseResult),
|
||||||
@@ -53,7 +53,7 @@ impl CountTokensResponse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct CountTokensResponseResult {
|
pub struct CountTokensResponseResult {
|
||||||
pub total_tokens: i32,
|
pub total_tokens: i32,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use serde_json::Value;
|
|||||||
use super::{Content, VertexApiError};
|
use super::{Content, VertexApiError};
|
||||||
use crate::error::Result;
|
use crate::error::Result;
|
||||||
|
|
||||||
#[derive(Clone, Default, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct GenerateContentRequest {
|
pub struct GenerateContentRequest {
|
||||||
pub contents: Vec<Content>,
|
pub contents: Vec<Content>,
|
||||||
@@ -24,6 +24,7 @@ impl GenerateContentRequest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct GenerateContentRequestBuilder {
|
pub struct GenerateContentRequestBuilder {
|
||||||
request: GenerateContentRequest,
|
request: GenerateContentRequest,
|
||||||
}
|
}
|
||||||
@@ -65,7 +66,7 @@ impl GenerateContentRequestBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Default, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||||
pub struct Tools {
|
pub struct Tools {
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub function_declarations: Option<Vec<FunctionDeclaration>>,
|
pub function_declarations: Option<Vec<FunctionDeclaration>>,
|
||||||
@@ -78,10 +79,10 @@ pub struct Tools {
|
|||||||
pub google_search: Option<GoogleSearch>,
|
pub google_search: Option<GoogleSearch>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Default, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||||
pub struct GoogleSearch {}
|
pub struct GoogleSearch {}
|
||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct DynamicRetrievalConfig {
|
pub struct DynamicRetrievalConfig {
|
||||||
pub mode: String,
|
pub mode: String,
|
||||||
@@ -98,7 +99,7 @@ impl Default for DynamicRetrievalConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Default, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct GoogleSearchRetrieval {
|
pub struct GoogleSearchRetrieval {
|
||||||
pub dynamic_retrieval_config: DynamicRetrievalConfig,
|
pub dynamic_retrieval_config: DynamicRetrievalConfig,
|
||||||
@@ -133,6 +134,7 @@ impl GenerationConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct GenerationConfigBuilder {
|
pub struct GenerationConfigBuilder {
|
||||||
generation_config: GenerationConfig,
|
generation_config: GenerationConfig,
|
||||||
}
|
}
|
||||||
@@ -259,7 +261,7 @@ pub enum HarmBlockMethod {
|
|||||||
Probability, // PROBABILITY
|
Probability, // PROBABILITY
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct Candidate {
|
pub struct Candidate {
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
@@ -282,7 +284,7 @@ impl Candidate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct Citation {
|
pub struct Citation {
|
||||||
pub start_index: Option<i32>,
|
pub start_index: Option<i32>,
|
||||||
@@ -290,13 +292,13 @@ pub struct Citation {
|
|||||||
pub uri: Option<String>,
|
pub uri: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct CitationMetadata {
|
pub struct CitationMetadata {
|
||||||
#[serde(alias = "citationSources")]
|
#[serde(alias = "citationSources")]
|
||||||
pub citations: Vec<Citation>,
|
pub citations: Vec<Citation>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct SafetyRating {
|
pub struct SafetyRating {
|
||||||
pub category: String,
|
pub category: String,
|
||||||
@@ -306,7 +308,7 @@ pub struct SafetyRating {
|
|||||||
pub severity_score: Option<f32>,
|
pub severity_score: Option<f32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UsageMetadata {
|
pub struct UsageMetadata {
|
||||||
pub candidates_token_count: Option<u32>,
|
pub candidates_token_count: Option<u32>,
|
||||||
@@ -375,7 +377,7 @@ pub struct FunctionParametersProperty {
|
|||||||
pub description: String,
|
pub description: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum GenerateContentResponse {
|
pub enum GenerateContentResponse {
|
||||||
Ok(GenerateContentResponseResult),
|
Ok(GenerateContentResponseResult),
|
||||||
@@ -391,14 +393,14 @@ impl From<GenerateContentResponse> for Result<GenerateContentResponseResult> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct GenerateContentResponseResult {
|
pub struct GenerateContentResponseResult {
|
||||||
pub candidates: Vec<Candidate>,
|
pub candidates: Vec<Candidate>,
|
||||||
pub usage_metadata: Option<UsageMetadata>,
|
pub usage_metadata: Option<UsageMetadata>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct GenerateContentResponseError {
|
pub struct GenerateContentResponseError {
|
||||||
pub error: VertexApiError,
|
pub error: VertexApiError,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ use serde::{Deserialize, Serialize};
|
|||||||
use serde_with::base64::Base64;
|
use serde_with::base64::Base64;
|
||||||
use serde_with::serde_as;
|
use serde_with::serde_as;
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct PredictImageRequest {
|
pub struct PredictImageRequest {
|
||||||
pub instances: Vec<PredictImageRequestPrompt>,
|
pub instances: Vec<PredictImageRequestPrompt>,
|
||||||
pub parameters: PredictImageRequestParameters,
|
pub parameters: PredictImageRequestParameters,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct PredictImageRequestPrompt {
|
pub struct PredictImageRequestPrompt {
|
||||||
/// The text prompt for the image.
|
/// The text prompt for the image.
|
||||||
/// The following models support different values for this parameter:
|
/// The following models support different values for this parameter:
|
||||||
@@ -20,7 +20,7 @@ pub struct PredictImageRequestPrompt {
|
|||||||
pub prompt: String,
|
pub prompt: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct PredictImageRequestParameters {
|
pub struct PredictImageRequestParameters {
|
||||||
/// The number of images to generate. The default value is 4.
|
/// The number of images to generate. The default value is 4.
|
||||||
@@ -139,7 +139,7 @@ pub struct PredictImageRequestParameters {
|
|||||||
pub storage_uri: Option<String>,
|
pub storage_uri: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct PredictImageRequestParametersOutputOptions {
|
pub struct PredictImageRequestParametersOutputOptions {
|
||||||
/// The image format that the output should be saved as. The following values are supported:
|
/// The image format that the output should be saved as. The following values are supported:
|
||||||
@@ -155,13 +155,13 @@ pub struct PredictImageRequestParametersOutputOptions {
|
|||||||
pub compression_quality: Option<i32>,
|
pub compression_quality: Option<i32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct PredictImageResponse {
|
pub struct PredictImageResponse {
|
||||||
pub predictions: Vec<PredictImageResponsePrediction>,
|
pub predictions: Vec<PredictImageResponsePrediction>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[serde_as]
|
#[serde_as]
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct PredictImageResponsePrediction {
|
pub struct PredictImageResponsePrediction {
|
||||||
#[serde_as(as = "Base64")]
|
#[serde_as(as = "Base64")]
|
||||||
@@ -169,7 +169,7 @@ pub struct PredictImageResponsePrediction {
|
|||||||
pub mime_type: String,
|
pub mime_type: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum PersonGeneration {
|
pub enum PersonGeneration {
|
||||||
DontAllow,
|
DontAllow,
|
||||||
@@ -177,7 +177,7 @@ pub enum PersonGeneration {
|
|||||||
AllowAll,
|
AllowAll,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum PredictImageSafetySetting {
|
pub enum PredictImageSafetySetting {
|
||||||
BlockLowAndAbove,
|
BlockLowAndAbove,
|
||||||
|
|||||||
Reference in New Issue
Block a user