Nenad Crnčec I'm glad that your issue is resolved and thank you for posting your solution so that others experiencing the same thing can easily reference this!
Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer, they can only accept answers by others, I'll repost your solution in case you'd like to Accept the answer.
Error Message:
I am creating a Java Spring boot app that is using assistants SDK https://learn.microsoft.com/en-us/java/api/overview/azure/ai-openai-assistants-readme?view=azure-java-preview
When I create an assistant and attach vector store and files for code interpreter responses are clearly not using those files.
When I check the assistant in Azure AI Studio, I see that files are there, but "toggle" is not turned on.
When I turn on the toggle and query the assistant through AI Studio, assistant returns relevant responses.
As there is no explanation in provided page, or examples on github, it is unclear on how to use or activate code interpreter and vector search through SDK.
Solution:
What was missing is that I need to set ToolResources AND ToolOptions
Examples didn't include CodeInterpeter
createToolResourcesOptions = new CreateToolResourcesOptions();
CreateCodeInterpreterToolResourceOptions codeInterpreter = createToolResourcesOptions.setCodeInterpreter(
new CreateCodeInterpreterToolResourceOptions().setFileIds(assistantDTO.getCodeInterpreterFiles())
).getCodeInterpreter();
if(!assistantDTO.getCodeInterpreterFiles().isEmpty())
createToolResourcesOptions.setCodeInterpreter(codeInterpreter);
toolDefinitions.add(new CodeInterpreterToolDefinition();
AssistantCreationOptions options = new AssistantCreationOptions(model)
.setName(assistantDTO.getName())
.setDescription(assistantDTO.getDescription())
.setInstructions(assistantDTO.getInstructions());
if (createToolResourcesOptions != null) {
options.setToolResources(createToolResourcesOptions);
}
options.setTools(toolDefinitions); // enables tools
Assistant assistant = this.assistantsClient.createAssistant(options);
If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.