Adds support for the response schema field

- Support is added by allowing a serde_json `Value`.
- In the future, this could be improved by using a proper `Schema`
definition.
This commit is contained in:
2024-09-20 15:47:21 +01:00
parent cb954ea5db
commit dc1b5cabdf
2 changed files with 55 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use super::{Content, Part, VertexApiError};
use crate::error::Result;
@@ -66,6 +67,8 @@ pub struct GenerationConfig {
pub candidate_count: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub response_mime_type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub response_schema: Option<Value>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]