From 6d01594f949da39aa2ad27974cebdd44a45fabad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Tue, 21 May 2024 20:04:27 +0200 Subject: [PATCH] assistant: don't send null values for tool resources (#226) --- async-openai/src/types/assistant.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/async-openai/src/types/assistant.rs b/async-openai/src/types/assistant.rs index f87d652b..1c193546 100644 --- a/async-openai/src/types/assistant.rs +++ b/async-openai/src/types/assistant.rs @@ -21,13 +21,17 @@ pub struct AssistantToolFileSearchResources { #[derive(Clone, Serialize, Debug, Deserialize, PartialEq)] pub struct AssistantToolResources { + #[serde(skip_serializing_if = "Option::is_none")] pub code_interpreter: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub file_search: Option, } #[derive(Clone, Serialize, Debug, Deserialize, PartialEq)] pub struct CreateAssistantToolResources { + #[serde(skip_serializing_if = "Option::is_none")] pub code_interpreter: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub file_search: Option, }