Skip to content

Commit dd26a2d

Browse files
authored
make vertex types optional since they sometimes go missing (#1909)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Made several fields optional in `google/types.rs` and `vertex/types.rs` structs and updated dependencies in `uv.lock`. > > - **Struct Changes**: > - In `google/types.rs` and `vertex/types.rs`, made fields in `Citation`, `Date`, `GroundingMetadata`, and `SearchEntryPoint` structs optional. > - **Dependency Changes**: > - In `uv.lock`, changed platform marker for `colorama` dependency from `sys_platform == 'win32'` to `platform_system == 'Windows'`. > - Removed `types-assertpy` from dev-dependencies in `uv.lock`. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for 8587647. You can [customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
1 parent 3c08e83 commit dd26a2d

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

  • engine/baml-runtime/src/internal/llm_client/primitive

engine/baml-runtime/src/internal/llm_client/primitive/google/types.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -300,33 +300,33 @@ pub struct CitationMetadata {
300300
#[derive(Serialize, Deserialize, Debug)]
301301
#[serde(rename_all = "camelCase")]
302302
pub struct Citation {
303-
pub start_index: i32,
304-
pub end_index: i32,
305-
pub uri: String,
306-
pub title: String,
307-
pub license: String,
308-
pub publication_date: Date,
303+
pub start_index: Option<i32>,
304+
pub end_index: Option<i32>,
305+
pub uri: Option<String>,
306+
pub title: Option<String>,
307+
pub license: Option<String>,
308+
pub publication_date: Option<Date>,
309309
}
310310

311311
#[derive(Serialize, Deserialize, Debug)]
312312
pub struct Date {
313-
pub year: i32,
314-
pub month: i32,
315-
pub day: i32,
313+
pub year: Option<i32>,
314+
pub month: Option<i32>,
315+
pub day: Option<i32>,
316316
}
317317

318318
#[derive(Serialize, Deserialize, Debug)]
319319
#[serde(rename_all = "camelCase")]
320320
pub struct GroundingMetadata {
321-
pub web_search_queries: Vec<String>,
322-
pub search_entry_point: SearchEntryPoint,
321+
pub web_search_queries: Option<Vec<String>>,
322+
pub search_entry_point: Option<SearchEntryPoint>,
323323
}
324324

325325
#[derive(Serialize, Deserialize, Debug)]
326326
#[serde(rename_all = "camelCase")]
327327
pub struct SearchEntryPoint {
328-
pub rendered_content: String,
329-
pub sdk_blob: Vec<u8>,
328+
pub rendered_content: Option<String>,
329+
pub sdk_blob: Option<Vec<u8>>,
330330
}
331331

332332
#[derive(Serialize, Deserialize, Debug)]

engine/baml-runtime/src/internal/llm_client/primitive/vertex/types.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,23 +321,23 @@ pub struct Citation {
321321

322322
#[derive(Serialize, Deserialize, Debug)]
323323
pub struct Date {
324-
pub year: i32,
325-
pub month: i32,
326-
pub day: i32,
324+
pub year: Option<i32>,
325+
pub month: Option<i32>,
326+
pub day: Option<i32>,
327327
}
328328

329329
#[derive(Serialize, Deserialize, Debug)]
330330
#[serde(rename_all = "camelCase")]
331331
pub struct GroundingMetadata {
332-
pub web_search_queries: Vec<String>,
333-
pub search_entry_point: SearchEntryPoint,
332+
pub web_search_queries: Option<Vec<String>>,
333+
pub search_entry_point: Option<SearchEntryPoint>,
334334
}
335335

336336
#[derive(Serialize, Deserialize, Debug)]
337337
#[serde(rename_all = "camelCase")]
338338
pub struct SearchEntryPoint {
339-
pub rendered_content: String,
340-
pub sdk_blob: Vec<u8>,
339+
pub rendered_content: Option<String>,
340+
pub sdk_blob: Option<Vec<u8>>,
341341
}
342342

343343
#[derive(Serialize, Deserialize, Debug, Clone)]

0 commit comments

Comments
 (0)