Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateAssistantToolResources fields must be optional? #251

Open
vrurg opened this issue Jul 30, 2024 · 0 comments · May be fixed by #252
Open

CreateAssistantToolResources fields must be optional? #251

vrurg opened this issue Jul 30, 2024 · 0 comments · May be fixed by #252

Comments

@vrurg
Copy link

vrurg commented Jul 30, 2024

I was working on code that creates an assistant with attached pre-existing vector store. Unfortunately, it doesn't seem to be possible. Since both fields are currently non-Option, the only possible way to create an instance is something like:

        let tool_resources = Some(CreateAssistantToolResources {
            file_search: Some(CreateAssistantToolFileSearchResources {
                vector_store_ids,
                vector_stores: vec![],
            }),
            code_interpreter: None,
        });

The point is that one has to specify both vector_store_ids and vector_stores. Unfortunately, the API doesn't accept this kind of request:

Can't create assistant '{aname}': ApiError(ApiError { message: "file_search tool configuration is invalid. Only one of vector_store_ids or vector_stores should be provided.", type: Some("invalid_request_error"), param: Some("tool_resources.file_search"), code: None })

From the error message I conclude that the right way is to make both fields optional.

Now I wonder how do I attach the vector store to a new assistant...

vrurg added a commit to vrurg/async-openai that referenced this issue Jul 30, 2024
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 64bit#251
@vrurg vrurg linked a pull request Jul 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant