Skip to content

Commit 650281d

Browse files
authored
Fix incompatibility with API requirements (#252)
For `CreateAssistantToolFileSearchResources` struct the API expects only one of the two fields to be used. Even an empty array is not accepted if the other field contains a value. Thus making both `vector_store_ids` and `vector_stores` optional is the way to go. Fixes #251
1 parent 7bb0858 commit 650281d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

async-openai/src/types/assistant.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ pub struct CreateAssistantToolResources {
3838
#[derive(Clone, Serialize, Debug, Deserialize, PartialEq, Default)]
3939
pub struct CreateAssistantToolFileSearchResources {
4040
/// The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant.
41-
pub vector_store_ids: Vec<String>,
41+
pub vector_store_ids: Option<Vec<String>>,
4242
/// A helper to create a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) with file_ids and attach it to this assistant. There can be a maximum of 1 vector store attached to the assistant.
43-
pub vector_stores: Vec<AssistantVectorStore>,
43+
pub vector_stores: Option<Vec<AssistantVectorStore>>,
4444
}
4545

4646
#[derive(Clone, Serialize, Debug, Deserialize, PartialEq, Default)]

0 commit comments

Comments
 (0)