Skip to content

Commit

Permalink
Fix incompatibility with API requirements (#252)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vrurg authored Aug 29, 2024
1 parent 7bb0858 commit 650281d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions async-openai/src/types/assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ pub struct CreateAssistantToolResources {
#[derive(Clone, Serialize, Debug, Deserialize, PartialEq, Default)]
pub struct CreateAssistantToolFileSearchResources {
/// 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.
pub vector_store_ids: Vec<String>,
pub vector_store_ids: Option<Vec<String>>,
/// 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.
pub vector_stores: Vec<AssistantVectorStore>,
pub vector_stores: Option<Vec<AssistantVectorStore>>,
}

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

0 comments on commit 650281d

Please sign in to comment.