From e215d56e9911e7d049017b975a795c65c53aad92 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 3 Jun 2024 17:11:17 +0000 Subject: [PATCH] CodeGen from PR 29297 in Azure/azure-rest-api-specs Merge b05cf2651969c8c8bc7f38a7fe0e5de1a035f951 into bf9738223ed8c1c25485980b74cfb8ef4158b847 --- .../assistants/AssistantsAsyncClient.java | 1348 ++++- .../openai/assistants/AssistantsClient.java | 1315 +++- .../assistants/AssistantsServiceVersion.java | 9 +- .../implementation/AssistantsClientImpl.java | 5375 +++++++++++------ .../CreateVectorStoreFileBatchRequest.java | 85 + .../models/CreateVectorStoreFileRequest.java | 84 + .../OpenAIPageableListOfVectorStore.java | 169 + .../OpenAIPageableListOfVectorStoreFile.java | 171 + .../assistants/models/ApiResponseFormat.java | 57 + .../openai/assistants/models/Assistant.java | 191 +- .../models/AssistantCreationOptions.java | 192 +- .../assistants/models/AssistantThread.java | 69 +- .../AssistantThreadCreationOptions.java | 54 +- .../models/AssistantsApiResponseFormat.java | 94 + .../AssistantsApiResponseFormatMode.java | 57 + .../AssistantsApiToolChoiceOptionMode.java | 57 + .../models/AssistantsNamedToolChoice.java | 118 + .../models/AssistantsNamedToolChoiceType.java | 63 + .../models/CodeInterpreterToolResource.java | 87 + .../models/CreateAndRunThreadOptions.java | 317 + ...ateCodeInterpreterToolResourceOptions.java | 96 + ...eSearchToolResourceVectorStoreOptions.java | 129 + .../assistants/models/CreateRunOptions.java | 315 + .../models/CreateToolResourcesOptions.java | 135 + .../openai/assistants/models/FilePurpose.java | 18 + .../models/FileSearchToolDefinition.java | 80 + .../models/FileSearchToolResource.java | 86 + .../openai/assistants/models/FileState.java | 95 + .../assistants/models/FunctionName.java | 83 + .../assistants/models/MessageAttachment.java | 109 + .../assistants/models/MessageContent.java | 2 +- .../models/MessageImageFileContent.java | 2 +- .../models/MessageImageFileDetails.java | 2 +- .../models/MessageIncompleteDetails.java | 83 + .../models/MessageTextAnnotation.java | 2 +- .../assistants/models/MessageTextContent.java | 2 +- .../assistants/models/MessageTextDetails.java | 2 +- .../MessageTextFileCitationAnnotation.java | 36 +- .../MessageTextFileCitationDetails.java | 2 +- .../models/MessageTextFilePathAnnotation.java | 30 +- .../models/MessageTextFilePathDetails.java | 2 +- .../openai/assistants/models/OpenAIFile.java | 34 + .../assistants/models/RunCompletionUsage.java | 3 +- .../RunStepDeltaFileSearchToolCall.java | 118 + .../models/RunStepDeltaToolCall.java | 4 +- .../models/RunStepFileSearchToolCall.java | 115 + .../assistants/models/RunStepToolCall.java | 4 +- .../assistants/models/ThreadMessage.java | 166 +- .../models/ThreadMessageOptions.java | 195 + .../openai/assistants/models/ThreadRun.java | 202 +- .../assistants/models/ToolDefinition.java | 4 +- .../assistants/models/ToolResources.java | 101 + .../assistants/models/TruncationObject.java | 128 + .../assistants/models/TruncationStrategy.java | 57 + .../models/UpdateAssistantOptions.java | 186 +- .../models/UpdateAssistantThreadOptions.java | 144 + ...ateCodeInterpreterToolResourceOptions.java | 96 + .../UpdateFileSearchToolResourceOptions.java | 97 + .../models/UpdateToolResourcesOptions.java | 136 + .../openai/assistants/models/VectorStore.java | 329 + .../models/VectorStoreDeletionStatus.java | 122 + .../models/VectorStoreExpirationPolicy.java | 106 + .../VectorStoreExpirationPolicyAnchor.java | 51 + .../assistants/models/VectorStoreFile.java | 224 + .../models/VectorStoreFileBatch.java | 198 + .../models/VectorStoreFileBatchStatus.java | 69 + .../models/VectorStoreFileCount.java | 171 + .../models/VectorStoreFileDeletionStatus.java | 122 + .../models/VectorStoreFileError.java | 105 + .../models/VectorStoreFileErrorCode.java | 69 + .../models/VectorStoreFileStatus.java | 69 + .../models/VectorStoreFileStatusFilter.java | 69 + .../assistants/models/VectorStoreOptions.java | 197 + .../assistants/models/VectorStoreStatus.java | 63 + .../models/VectorStoreUpdateOptions.java | 162 + ...-openai-assistants_apiview_properties.json | 136 +- .../tsp-location.yaml | 3 +- 77 files changed, 12623 insertions(+), 2655 deletions(-) create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileBatchRequest.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileRequest.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/OpenAIPageableListOfVectorStore.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/OpenAIPageableListOfVectorStoreFile.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ApiResponseFormat.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormat.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatMode.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiToolChoiceOptionMode.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsNamedToolChoice.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsNamedToolChoiceType.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CodeInterpreterToolResource.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateCodeInterpreterToolResourceOptions.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateFileSearchToolResourceVectorStoreOptions.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateToolResourcesOptions.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolDefinition.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolResource.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileState.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FunctionName.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageAttachment.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageIncompleteDetails.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepDeltaFileSearchToolCall.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepFileSearchToolCall.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadMessageOptions.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ToolResources.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/TruncationObject.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/TruncationStrategy.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateAssistantThreadOptions.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateCodeInterpreterToolResourceOptions.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateFileSearchToolResourceOptions.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateToolResourcesOptions.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStore.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreDeletionStatus.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreExpirationPolicy.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreExpirationPolicyAnchor.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFile.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileBatch.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileBatchStatus.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileCount.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileDeletionStatus.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileError.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileErrorCode.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileStatus.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileStatusFilter.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreOptions.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStatus.java create mode 100644 sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreUpdateOptions.java diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsAsyncClient.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsAsyncClient.java index 51540a80d698d..5c47d5d49d640 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsAsyncClient.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsAsyncClient.java @@ -5,25 +5,22 @@ import com.azure.ai.openai.assistants.implementation.AssistantsClientImpl; import com.azure.ai.openai.assistants.implementation.MultipartFormDataHelper; -import com.azure.ai.openai.assistants.implementation.models.CreateAssistantFileRequest; -import com.azure.ai.openai.assistants.implementation.models.CreateMessageRequest; +import com.azure.ai.openai.assistants.implementation.models.CreateVectorStoreFileBatchRequest; +import com.azure.ai.openai.assistants.implementation.models.CreateVectorStoreFileRequest; import com.azure.ai.openai.assistants.implementation.models.FileListResponse; import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfAssistant; -import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfAssistantFile; -import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfMessageFile; import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfRunStep; import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfThreadMessage; import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfThreadRun; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfVectorStore; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfVectorStoreFile; import com.azure.ai.openai.assistants.implementation.models.SubmitToolOutputsToRunRequest; import com.azure.ai.openai.assistants.implementation.models.UpdateMessageRequest; import com.azure.ai.openai.assistants.implementation.models.UpdateRunRequest; -import com.azure.ai.openai.assistants.implementation.models.UpdateThreadRequest; import com.azure.ai.openai.assistants.implementation.models.UploadFileRequest; import com.azure.ai.openai.assistants.models.Assistant; import com.azure.ai.openai.assistants.models.AssistantCreationOptions; import com.azure.ai.openai.assistants.models.AssistantDeletionStatus; -import com.azure.ai.openai.assistants.models.AssistantFile; -import com.azure.ai.openai.assistants.models.AssistantFileDeletionStatus; import com.azure.ai.openai.assistants.models.AssistantThread; import com.azure.ai.openai.assistants.models.AssistantThreadCreationOptions; import com.azure.ai.openai.assistants.models.CreateAndRunThreadOptions; @@ -32,15 +29,23 @@ import com.azure.ai.openai.assistants.models.FileDetails; import com.azure.ai.openai.assistants.models.FilePurpose; import com.azure.ai.openai.assistants.models.ListSortOrder; -import com.azure.ai.openai.assistants.models.MessageFile; -import com.azure.ai.openai.assistants.models.MessageRole; import com.azure.ai.openai.assistants.models.OpenAIFile; import com.azure.ai.openai.assistants.models.RunStep; import com.azure.ai.openai.assistants.models.ThreadDeletionStatus; import com.azure.ai.openai.assistants.models.ThreadMessage; +import com.azure.ai.openai.assistants.models.ThreadMessageOptions; import com.azure.ai.openai.assistants.models.ThreadRun; import com.azure.ai.openai.assistants.models.ToolOutput; import com.azure.ai.openai.assistants.models.UpdateAssistantOptions; +import com.azure.ai.openai.assistants.models.UpdateAssistantThreadOptions; +import com.azure.ai.openai.assistants.models.VectorStore; +import com.azure.ai.openai.assistants.models.VectorStoreDeletionStatus; +import com.azure.ai.openai.assistants.models.VectorStoreFile; +import com.azure.ai.openai.assistants.models.VectorStoreFileBatch; +import com.azure.ai.openai.assistants.models.VectorStoreFileDeletionStatus; +import com.azure.ai.openai.assistants.models.VectorStoreFileStatusFilter; +import com.azure.ai.openai.assistants.models.VectorStoreOptions; +import com.azure.ai.openai.assistants.models.VectorStoreUpdateOptions; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -58,6 +63,10 @@ import java.util.Objects; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfAssistantFile; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfMessageFile; +import com.azure.ai.openai.assistants.models.AssistantFile; +import com.azure.ai.openai.assistants.models.MessageFile; import com.azure.ai.openai.assistants.implementation.OpenAIUtils; import com.azure.ai.openai.assistants.implementation.streaming.OpenAIServerSentEvents; import com.azure.ai.openai.assistants.models.StreamUpdate; @@ -525,31 +534,6 @@ public Mono deleteAssistant(String assistantId) { .map(protocolMethodData -> protocolMethodData.toObject(AssistantDeletionStatus.class)); } - /** - * Attaches a previously uploaded file to an assistant for use by tools that can read files. - * - * @param assistantId The ID of the assistant to attach the file to. - * @param fileId The ID of the previously uploaded file to attach. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a file attached to an assistant, as used by tools that can read files on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAssistantFile(String assistantId, String fileId) { - // Generated convenience method for createAssistantFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - CreateAssistantFileRequest requestObj = new CreateAssistantFileRequest(fileId); - BinaryData request = BinaryData.fromObject(requestObj); - return createAssistantFileWithResponse(assistantId, request, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(AssistantFile.class)); - } - /** * Gets a list of files attached to a specific assistant, as used by tools that can read files. * @@ -617,29 +601,6 @@ public Mono> listAssistantFiles(String assistantId) assistantList.getLastId(), assistantList.isHasMore())); } - /** - * Unlinks a previously attached file from an assistant, rendering it unavailable for use by tools that can read - * files. - * - * @param assistantId The ID of the assistant from which the specified file should be unlinked. - * @param fileId The ID of the file to unlink from the specified assistant. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of an assistant file deletion operation on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAssistantFile(String assistantId, String fileId) { - // Generated convenience method for deleteAssistantFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteAssistantFileWithResponse(assistantId, fileId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(AssistantFileDeletionStatus.class)); - } - /** * Initializes an instance of AssistantsAsyncClient class. * @@ -1876,29 +1837,6 @@ public Mono getAssistant(String assistantId) { .map(protocolMethodData -> protocolMethodData.toObject(Assistant.class)); } - /** - * Retrieves a file attached to an assistant. - * - * @param assistantId The ID of the assistant associated with the attached file. - * @param fileId The ID of the file to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a file attached to an assistant, as used by tools that can read files on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAssistantFile(String assistantId, String fileId) { - // Generated convenience method for getAssistantFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getAssistantFileWithResponse(assistantId, fileId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(AssistantFile.class)); - } - /** * Creates a new thread. Threads contain messages and can be run by assistants. * @@ -1963,63 +1901,6 @@ public Mono deleteThread(String threadId) { .map(protocolMethodData -> protocolMethodData.toObject(ThreadDeletionStatus.class)); } - /** - * Creates a new message on a specified thread. - * - * @param threadId The ID of the thread to create the new message on. - * @param role The role to associate with the new message. - * @param content The textual content for the new message. - * @param fileIds A list of up to 10 file IDs to associate with the message, as used by tools like - * 'code_interpreter' or 'retrieval' that can read files. - * @param metadata A set of up to 16 key/value pairs that can be attached to an object, used for storing additional - * information about that object in a structured format. Keys may be up to 64 characters in length and values may be - * up to 512 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single, existing message within an assistant thread on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createMessage(String threadId, MessageRole role, String content, List fileIds, - Map metadata) { - // Generated convenience method for createMessageWithResponse - RequestOptions requestOptions = new RequestOptions(); - CreateMessageRequest requestObj - = new CreateMessageRequest(role, content).setFileIds(fileIds).setMetadata(metadata); - BinaryData request = BinaryData.fromObject(requestObj); - return createMessageWithResponse(threadId, request, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ThreadMessage.class)); - } - - /** - * Creates a new message on a specified thread. - * - * @param threadId The ID of the thread to create the new message on. - * @param role The role to associate with the new message. - * @param content The textual content for the new message. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single, existing message within an assistant thread on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createMessage(String threadId, MessageRole role, String content) { - // Generated convenience method for createMessageWithResponse - RequestOptions requestOptions = new RequestOptions(); - CreateMessageRequest requestObj = new CreateMessageRequest(role, content); - BinaryData request = BinaryData.fromObject(requestObj); - return createMessageWithResponse(threadId, request, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ThreadMessage.class)); - } - /** * Gets a list of messages that exist on a thread. * @@ -2176,30 +2057,6 @@ public Mono> listMessageFiles(String threadId, String assistantList.getLastId(), assistantList.isHasMore())); } - /** - * Gets information about a file attachment to a message within a thread. - * - * @param threadId The ID of the thread containing the message to get information from. - * @param messageId The ID of the message to get information from. - * @param fileId The ID of the file to get information about. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a file attachment to a message within a thread on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMessageFile(String threadId, String messageId, String fileId) { - // Generated convenience method for getMessageFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getMessageFileWithResponse(threadId, messageId, fileId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(MessageFile.class)); - } - /** * Gets a list of runs for a specified thread. * @@ -2841,55 +2698,6 @@ public Mono updateAssistant(String assistantId, UpdateAssistantOption .map(protocolMethodData -> protocolMethodData.toObject(Assistant.class)); } - /** - * Modifies an existing thread. - * - * @param threadId The ID of the thread to modify. - * @param metadata A set of up to 16 key/value pairs that can be attached to an object, used for storing additional - * information about that object in a structured format. Keys may be up to 64 characters in length and values may be - * up to 512 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a single thread associated with an assistant on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateThread(String threadId, Map metadata) { - // Generated convenience method for updateThreadWithResponse - RequestOptions requestOptions = new RequestOptions(); - UpdateThreadRequest requestObj = new UpdateThreadRequest().setMetadata(metadata); - BinaryData request = BinaryData.fromObject(requestObj); - return updateThreadWithResponse(threadId, request, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(AssistantThread.class)); - } - - /** - * Modifies an existing thread. - * - * @param threadId The ID of the thread to modify. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a single thread associated with an assistant on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateThread(String threadId) { - // Generated convenience method for updateThreadWithResponse - RequestOptions requestOptions = new RequestOptions(); - UpdateThreadRequest requestObj = new UpdateThreadRequest(); - BinaryData request = BinaryData.fromObject(requestObj); - return updateThreadWithResponse(threadId, request, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(AssistantThread.class)); - } - /** * Modifies an existing message on an existing thread. * @@ -3263,4 +3071,1124 @@ public Mono submitToolOutputsToRun(String threadId, String runId, Lis return submitToolOutputsToRunWithResponse(threadId, runId, request, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(ThreadRun.class)); } + + /** + * Returns a list of vector stores. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for + * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the + * list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     data (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             created_at: long (Required)
+     *             name: String (Required)
+     *             usage_bytes: int (Required)
+     *             file_counts (Required): {
+     *                 in_progress: int (Required)
+     *                 completed: int (Required)
+     *                 failed: int (Required)
+     *                 cancelled: int (Required)
+     *                 total: int (Required)
+     *             }
+     *             status: String(expired/in_progress/completed) (Required)
+     *             expires_after (Optional): {
+     *                 anchor: String(last_active_at) (Required)
+     *                 days: int (Required)
+     *             }
+     *             expires_at: Long (Optional)
+     *             last_active_at: Long (Required)
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Required)
+     *     last_id: String (Required)
+     *     has_more: boolean (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listVectorStoresWithResponse(RequestOptions requestOptions) { + return this.serviceClient.listVectorStoresWithResponseAsync(requestOptions); + } + + /** + * Creates a vector store. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     file_ids (Optional): [
+     *         String (Optional)
+     *     ]
+     *     name: String (Optional)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     name: String (Required)
+     *     usage_bytes: int (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
+     *     status: String(expired/in_progress/completed) (Required)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     expires_at: Long (Optional)
+     *     last_active_at: Long (Required)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreOptions Request object for creating a vector store. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a vector store is a collection of processed files can be used by the `file_search` tool along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createVectorStoreWithResponse(BinaryData vectorStoreOptions, + RequestOptions requestOptions) { + return this.serviceClient.createVectorStoreWithResponseAsync(vectorStoreOptions, requestOptions); + } + + /** + * Returns the vector store object matching the specified ID. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     name: String (Required)
+     *     usage_bytes: int (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
+     *     status: String(expired/in_progress/completed) (Required)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     expires_at: Long (Optional)
+     *     last_active_at: Long (Required)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a vector store is a collection of processed files can be used by the `file_search` tool along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getVectorStoreWithResponse(String vectorStoreId, RequestOptions requestOptions) { + return this.serviceClient.getVectorStoreWithResponseAsync(vectorStoreId, requestOptions); + } + + /** + * The ID of the vector store to modify. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     name: String (Required)
+     *     usage_bytes: int (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
+     *     status: String(expired/in_progress/completed) (Required)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     expires_at: Long (Optional)
+     *     last_active_at: Long (Required)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store to modify. + * @param vectorStoreUpdateOptions Request object for updating a vector store. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a vector store is a collection of processed files can be used by the `file_search` tool along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> modifyVectorStoreWithResponse(String vectorStoreId, + BinaryData vectorStoreUpdateOptions, RequestOptions requestOptions) { + return this.serviceClient.modifyVectorStoreWithResponseAsync(vectorStoreId, vectorStoreUpdateOptions, + requestOptions); + } + + /** + * Deletes the vector store object matching the specified ID. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     deleted: boolean (Required)
+     *     object: String (Required)
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store to delete. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response object for deleting a vector store along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteVectorStoreWithResponse(String vectorStoreId, + RequestOptions requestOptions) { + return this.serviceClient.deleteVectorStoreWithResponseAsync(vectorStoreId, requestOptions); + } + + /** + * Returns a list of vector store files. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter by file status. Allowed values: "in_progress", + * "completed", "failed", "cancelled".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for + * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the + * list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     data (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             usage_bytes: int (Required)
+     *             created_at: long (Required)
+     *             vector_store_id: String (Required)
+     *             status: String(in_progress/completed/failed/cancelled) (Required)
+     *             last_error (Required): {
+     *                 code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
+     *                 message: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Required)
+     *     last_id: String (Required)
+     *     has_more: boolean (Required)
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store that the files belong to. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listVectorStoreFilesWithResponse(String vectorStoreId, + RequestOptions requestOptions) { + return this.serviceClient.listVectorStoreFilesWithResponseAsync(vectorStoreId, requestOptions); + } + + /** + * Create a vector store file by attaching a file to a vector store. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     file_id: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     usage_bytes: int (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/failed/cancelled) (Required)
+     *     last_error (Required): {
+     *         code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store for which to create a File. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return description of a file attached to a vector store along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createVectorStoreFileWithResponse(String vectorStoreId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createVectorStoreFileWithResponseAsync(vectorStoreId, request, requestOptions); + } + + /** + * Retrieves a vector store file. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     usage_bytes: int (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/failed/cancelled) (Required)
+     *     last_error (Required): {
+     *         code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store that the file belongs to. + * @param fileId The ID of the file being retrieved. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return description of a file attached to a vector store along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getVectorStoreFileWithResponse(String vectorStoreId, String fileId, + RequestOptions requestOptions) { + return this.serviceClient.getVectorStoreFileWithResponseAsync(vectorStoreId, fileId, requestOptions); + } + + /** + * Delete a vector store file. This will remove the file from the vector store but the file itself will not be + * deleted. + * To delete the file, use the delete file endpoint. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     deleted: boolean (Required)
+     *     object: String (Required)
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store that the file belongs to. + * @param fileId The ID of the file to delete its relationship to the vector store. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response object for deleting a vector store file relationship along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteVectorStoreFileWithResponse(String vectorStoreId, String fileId, + RequestOptions requestOptions) { + return this.serviceClient.deleteVectorStoreFileWithResponseAsync(vectorStoreId, fileId, requestOptions); + } + + /** + * Create a vector store file batch. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     file_ids (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/cancelled/failed) (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store for which to create a File Batch. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a batch of files attached to a vector store along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createVectorStoreFileBatchWithResponse(String vectorStoreId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createVectorStoreFileBatchWithResponseAsync(vectorStoreId, request, requestOptions); + } + + /** + * Retrieve a vector store file batch. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/cancelled/failed) (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch being retrieved. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a batch of files attached to a vector store along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getVectorStoreFileBatchWithResponse(String vectorStoreId, String batchId, + RequestOptions requestOptions) { + return this.serviceClient.getVectorStoreFileBatchWithResponseAsync(vectorStoreId, batchId, requestOptions); + } + + /** + * Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as + * possible. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/cancelled/failed) (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch to cancel. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a batch of files attached to a vector store along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelVectorStoreFileBatchWithResponse(String vectorStoreId, String batchId, + RequestOptions requestOptions) { + return this.serviceClient.cancelVectorStoreFileBatchWithResponseAsync(vectorStoreId, batchId, requestOptions); + } + + /** + * Returns a list of vector store files in a batch. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter by file status. Allowed values: "in_progress", + * "completed", "failed", "cancelled".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for + * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the + * list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     data (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             usage_bytes: int (Required)
+     *             created_at: long (Required)
+     *             vector_store_id: String (Required)
+     *             status: String(in_progress/completed/failed/cancelled) (Required)
+     *             last_error (Required): {
+     *                 code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
+     *                 message: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Required)
+     *     last_id: String (Required)
+     *     has_more: boolean (Required)
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch that the files belong to. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listVectorStoreFileBatchFilesWithResponse(String vectorStoreId, String batchId, + RequestOptions requestOptions) { + return this.serviceClient.listVectorStoreFileBatchFilesWithResponseAsync(vectorStoreId, batchId, + requestOptions); + } + + /** + * Modifies an existing thread. + * + * @param threadId The ID of the thread to modify. + * @param updateAssistantThreadOptions The details used to update an existing assistant thread. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a single thread associated with an assistant on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateThread(String threadId, + UpdateAssistantThreadOptions updateAssistantThreadOptions) { + // Generated convenience method for updateThreadWithResponse + RequestOptions requestOptions = new RequestOptions(); + return updateThreadWithResponse(threadId, BinaryData.fromObject(updateAssistantThreadOptions), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AssistantThread.class)); + } + + /** + * Creates a new message on a specified thread. + * + * @param threadId The ID of the thread to create the new message on. + * @param threadMessageOptions A single message within an assistant thread, as provided during that thread's + * creation for its initial state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single, existing message within an assistant thread on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createMessage(String threadId, ThreadMessageOptions threadMessageOptions) { + // Generated convenience method for createMessageWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createMessageWithResponse(threadId, BinaryData.fromObject(threadMessageOptions), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ThreadMessage.class)); + } + + /** + * Returns a list of vector stores. + * + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default + * is 20. + * @param order Sort order by the created_at timestamp of the objects. asc for ascending order and desc for + * descending order. + * @param after A cursor for use in pagination. after is an object ID that defines your place in the list. For + * instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can + * include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. before is an object ID that defines your place in the list. For + * instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can + * include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listVectorStores(Integer limit, ListSortOrder order, String after, + String before) { + // Generated convenience method for listVectorStoresWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return listVectorStoresWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OpenAIPageableListOfVectorStore.class)); + } + + /** + * Returns a list of vector stores. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listVectorStores() { + // Generated convenience method for listVectorStoresWithResponse + RequestOptions requestOptions = new RequestOptions(); + return listVectorStoresWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OpenAIPageableListOfVectorStore.class)); + } + + /** + * Creates a vector store. + * + * @param vectorStoreOptions Request object for creating a vector store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vector store is a collection of processed files can be used by the `file_search` tool on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createVectorStore(VectorStoreOptions vectorStoreOptions) { + // Generated convenience method for createVectorStoreWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createVectorStoreWithResponse(BinaryData.fromObject(vectorStoreOptions), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(VectorStore.class)); + } + + /** + * Returns the vector store object matching the specified ID. + * + * @param vectorStoreId The ID of the vector store to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vector store is a collection of processed files can be used by the `file_search` tool on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getVectorStore(String vectorStoreId) { + // Generated convenience method for getVectorStoreWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getVectorStoreWithResponse(vectorStoreId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(VectorStore.class)); + } + + /** + * The ID of the vector store to modify. + * + * @param vectorStoreId The ID of the vector store to modify. + * @param vectorStoreUpdateOptions Request object for updating a vector store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vector store is a collection of processed files can be used by the `file_search` tool on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono modifyVectorStore(String vectorStoreId, + VectorStoreUpdateOptions vectorStoreUpdateOptions) { + // Generated convenience method for modifyVectorStoreWithResponse + RequestOptions requestOptions = new RequestOptions(); + return modifyVectorStoreWithResponse(vectorStoreId, BinaryData.fromObject(vectorStoreUpdateOptions), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(VectorStore.class)); + } + + /** + * Deletes the vector store object matching the specified ID. + * + * @param vectorStoreId The ID of the vector store to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response object for deleting a vector store on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteVectorStore(String vectorStoreId) { + // Generated convenience method for deleteVectorStoreWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteVectorStoreWithResponse(vectorStoreId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(VectorStoreDeletionStatus.class)); + } + + /** + * Returns a list of vector store files. + * + * @param vectorStoreId The ID of the vector store that the files belong to. + * @param filter Filter by file status. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default + * is 20. + * @param order Sort order by the created_at timestamp of the objects. asc for ascending order and desc for + * descending order. + * @param after A cursor for use in pagination. after is an object ID that defines your place in the list. For + * instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can + * include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. before is an object ID that defines your place in the list. For + * instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can + * include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listVectorStoreFiles(String vectorStoreId, + VectorStoreFileStatusFilter filter, Integer limit, ListSortOrder order, String after, String before) { + // Generated convenience method for listVectorStoreFilesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter.toString(), false); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return listVectorStoreFilesWithResponse(vectorStoreId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OpenAIPageableListOfVectorStoreFile.class)); + } + + /** + * Returns a list of vector store files. + * + * @param vectorStoreId The ID of the vector store that the files belong to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listVectorStoreFiles(String vectorStoreId) { + // Generated convenience method for listVectorStoreFilesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return listVectorStoreFilesWithResponse(vectorStoreId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OpenAIPageableListOfVectorStoreFile.class)); + } + + /** + * Create a vector store file by attaching a file to a vector store. + * + * @param vectorStoreId The ID of the vector store for which to create a File. + * @param fileId A File ID that the vector store should use. Useful for tools like `file_search` that can access + * files. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a file attached to a vector store on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createVectorStoreFile(String vectorStoreId, String fileId) { + // Generated convenience method for createVectorStoreFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateVectorStoreFileRequest requestObj = new CreateVectorStoreFileRequest(fileId); + BinaryData request = BinaryData.fromObject(requestObj); + return createVectorStoreFileWithResponse(vectorStoreId, request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(VectorStoreFile.class)); + } + + /** + * Retrieves a vector store file. + * + * @param vectorStoreId The ID of the vector store that the file belongs to. + * @param fileId The ID of the file being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a file attached to a vector store on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getVectorStoreFile(String vectorStoreId, String fileId) { + // Generated convenience method for getVectorStoreFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getVectorStoreFileWithResponse(vectorStoreId, fileId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(VectorStoreFile.class)); + } + + /** + * Delete a vector store file. This will remove the file from the vector store but the file itself will not be + * deleted. + * To delete the file, use the delete file endpoint. + * + * @param vectorStoreId The ID of the vector store that the file belongs to. + * @param fileId The ID of the file to delete its relationship to the vector store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response object for deleting a vector store file relationship on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteVectorStoreFile(String vectorStoreId, String fileId) { + // Generated convenience method for deleteVectorStoreFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteVectorStoreFileWithResponse(vectorStoreId, fileId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(VectorStoreFileDeletionStatus.class)); + } + + /** + * Create a vector store file batch. + * + * @param vectorStoreId The ID of the vector store for which to create a File Batch. + * @param fileIds A list of File IDs that the vector store should use. Useful for tools like `file_search` that can + * access files. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a batch of files attached to a vector store on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createVectorStoreFileBatch(String vectorStoreId, List fileIds) { + // Generated convenience method for createVectorStoreFileBatchWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateVectorStoreFileBatchRequest requestObj = new CreateVectorStoreFileBatchRequest(fileIds); + BinaryData request = BinaryData.fromObject(requestObj); + return createVectorStoreFileBatchWithResponse(vectorStoreId, request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(VectorStoreFileBatch.class)); + } + + /** + * Retrieve a vector store file batch. + * + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a batch of files attached to a vector store on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getVectorStoreFileBatch(String vectorStoreId, String batchId) { + // Generated convenience method for getVectorStoreFileBatchWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getVectorStoreFileBatchWithResponse(vectorStoreId, batchId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(VectorStoreFileBatch.class)); + } + + /** + * Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as + * possible. + * + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a batch of files attached to a vector store on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelVectorStoreFileBatch(String vectorStoreId, String batchId) { + // Generated convenience method for cancelVectorStoreFileBatchWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cancelVectorStoreFileBatchWithResponse(vectorStoreId, batchId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(VectorStoreFileBatch.class)); + } + + /** + * Returns a list of vector store files in a batch. + * + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch that the files belong to. + * @param filter Filter by file status. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default + * is 20. + * @param order Sort order by the created_at timestamp of the objects. asc for ascending order and desc for + * descending order. + * @param after A cursor for use in pagination. after is an object ID that defines your place in the list. For + * instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can + * include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. before is an object ID that defines your place in the list. For + * instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can + * include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listVectorStoreFileBatchFiles(String vectorStoreId, String batchId, + VectorStoreFileStatusFilter filter, Integer limit, ListSortOrder order, String after, String before) { + // Generated convenience method for listVectorStoreFileBatchFilesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter.toString(), false); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return listVectorStoreFileBatchFilesWithResponse(vectorStoreId, batchId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OpenAIPageableListOfVectorStoreFile.class)); + } + + /** + * Returns a list of vector store files in a batch. + * + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch that the files belong to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listVectorStoreFileBatchFiles(String vectorStoreId, + String batchId) { + // Generated convenience method for listVectorStoreFileBatchFilesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return listVectorStoreFileBatchFilesWithResponse(vectorStoreId, batchId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OpenAIPageableListOfVectorStoreFile.class)); + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClient.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClient.java index 20d0f7e0ad3dc..e783251157fa4 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClient.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClient.java @@ -5,25 +5,22 @@ import com.azure.ai.openai.assistants.implementation.AssistantsClientImpl; import com.azure.ai.openai.assistants.implementation.MultipartFormDataHelper; -import com.azure.ai.openai.assistants.implementation.models.CreateAssistantFileRequest; -import com.azure.ai.openai.assistants.implementation.models.CreateMessageRequest; +import com.azure.ai.openai.assistants.implementation.models.CreateVectorStoreFileBatchRequest; +import com.azure.ai.openai.assistants.implementation.models.CreateVectorStoreFileRequest; import com.azure.ai.openai.assistants.implementation.models.FileListResponse; import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfAssistant; -import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfAssistantFile; -import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfMessageFile; import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfRunStep; import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfThreadMessage; import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfThreadRun; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfVectorStore; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfVectorStoreFile; import com.azure.ai.openai.assistants.implementation.models.SubmitToolOutputsToRunRequest; import com.azure.ai.openai.assistants.implementation.models.UpdateMessageRequest; import com.azure.ai.openai.assistants.implementation.models.UpdateRunRequest; -import com.azure.ai.openai.assistants.implementation.models.UpdateThreadRequest; import com.azure.ai.openai.assistants.implementation.models.UploadFileRequest; import com.azure.ai.openai.assistants.models.Assistant; import com.azure.ai.openai.assistants.models.AssistantCreationOptions; import com.azure.ai.openai.assistants.models.AssistantDeletionStatus; -import com.azure.ai.openai.assistants.models.AssistantFile; -import com.azure.ai.openai.assistants.models.AssistantFileDeletionStatus; import com.azure.ai.openai.assistants.models.AssistantThread; import com.azure.ai.openai.assistants.models.AssistantThreadCreationOptions; import com.azure.ai.openai.assistants.models.CreateAndRunThreadOptions; @@ -32,15 +29,23 @@ import com.azure.ai.openai.assistants.models.FileDetails; import com.azure.ai.openai.assistants.models.FilePurpose; import com.azure.ai.openai.assistants.models.ListSortOrder; -import com.azure.ai.openai.assistants.models.MessageFile; -import com.azure.ai.openai.assistants.models.MessageRole; import com.azure.ai.openai.assistants.models.OpenAIFile; import com.azure.ai.openai.assistants.models.RunStep; import com.azure.ai.openai.assistants.models.ThreadDeletionStatus; import com.azure.ai.openai.assistants.models.ThreadMessage; +import com.azure.ai.openai.assistants.models.ThreadMessageOptions; import com.azure.ai.openai.assistants.models.ThreadRun; import com.azure.ai.openai.assistants.models.ToolOutput; import com.azure.ai.openai.assistants.models.UpdateAssistantOptions; +import com.azure.ai.openai.assistants.models.UpdateAssistantThreadOptions; +import com.azure.ai.openai.assistants.models.VectorStore; +import com.azure.ai.openai.assistants.models.VectorStoreDeletionStatus; +import com.azure.ai.openai.assistants.models.VectorStoreFile; +import com.azure.ai.openai.assistants.models.VectorStoreFileBatch; +import com.azure.ai.openai.assistants.models.VectorStoreFileDeletionStatus; +import com.azure.ai.openai.assistants.models.VectorStoreFileStatusFilter; +import com.azure.ai.openai.assistants.models.VectorStoreOptions; +import com.azure.ai.openai.assistants.models.VectorStoreUpdateOptions; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -55,6 +60,10 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfAssistantFile; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfMessageFile; +import com.azure.ai.openai.assistants.models.AssistantFile; +import com.azure.ai.openai.assistants.models.MessageFile; import com.azure.ai.openai.assistants.implementation.OpenAIUtils; import com.azure.ai.openai.assistants.implementation.streaming.OpenAIServerSentEvents; import com.azure.ai.openai.assistants.models.StreamUpdate; @@ -517,30 +526,6 @@ public AssistantDeletionStatus deleteAssistant(String assistantId) { .toObject(AssistantDeletionStatus.class); } - /** - * Attaches a previously uploaded file to an assistant for use by tools that can read files. - * - * @param assistantId The ID of the assistant to attach the file to. - * @param fileId The ID of the previously uploaded file to attach. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a file attached to an assistant, as used by tools that can read files. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public AssistantFile createAssistantFile(String assistantId, String fileId) { - // Generated convenience method for createAssistantFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - CreateAssistantFileRequest requestObj = new CreateAssistantFileRequest(fileId); - BinaryData request = BinaryData.fromObject(requestObj); - return createAssistantFileWithResponse(assistantId, request, requestOptions).getValue() - .toObject(AssistantFile.class); - } - /** * Gets a list of files attached to a specific assistant, as used by tools that can read files. * @@ -608,29 +593,6 @@ public PageableList listAssistantFiles(String assistantId) { assistantFileList.getLastId(), assistantFileList.isHasMore()); } - /** - * Unlinks a previously attached file from an assistant, rendering it unavailable for use by tools that can read - * files. - * - * @param assistantId The ID of the assistant from which the specified file should be unlinked. - * @param fileId The ID of the file to unlink from the specified assistant. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of an assistant file deletion operation. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public AssistantFileDeletionStatus deleteAssistantFile(String assistantId, String fileId) { - // Generated convenience method for deleteAssistantFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteAssistantFileWithResponse(assistantId, fileId, requestOptions).getValue() - .toObject(AssistantFileDeletionStatus.class); - } - /** * Initializes an instance of AssistantsClient class. * @@ -1847,28 +1809,6 @@ public Assistant getAssistant(String assistantId) { return getAssistantWithResponse(assistantId, requestOptions).getValue().toObject(Assistant.class); } - /** - * Retrieves a file attached to an assistant. - * - * @param assistantId The ID of the assistant associated with the attached file. - * @param fileId The ID of the file to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a file attached to an assistant, as used by tools that can read files. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public AssistantFile getAssistantFile(String assistantId, String fileId) { - // Generated convenience method for getAssistantFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getAssistantFileWithResponse(assistantId, fileId, requestOptions).getValue() - .toObject(AssistantFile.class); - } - /** * Creates a new thread. Threads contain messages and can be run by assistants. * @@ -1931,61 +1871,6 @@ public ThreadDeletionStatus deleteThread(String threadId) { return deleteThreadWithResponse(threadId, requestOptions).getValue().toObject(ThreadDeletionStatus.class); } - /** - * Creates a new message on a specified thread. - * - * @param threadId The ID of the thread to create the new message on. - * @param role The role to associate with the new message. - * @param content The textual content for the new message. - * @param fileIds A list of up to 10 file IDs to associate with the message, as used by tools like - * 'code_interpreter' or 'retrieval' that can read files. - * @param metadata A set of up to 16 key/value pairs that can be attached to an object, used for storing additional - * information about that object in a structured format. Keys may be up to 64 characters in length and values may be - * up to 512 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single, existing message within an assistant thread. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public ThreadMessage createMessage(String threadId, MessageRole role, String content, List fileIds, - Map metadata) { - // Generated convenience method for createMessageWithResponse - RequestOptions requestOptions = new RequestOptions(); - CreateMessageRequest requestObj - = new CreateMessageRequest(role, content).setFileIds(fileIds).setMetadata(metadata); - BinaryData request = BinaryData.fromObject(requestObj); - return createMessageWithResponse(threadId, request, requestOptions).getValue().toObject(ThreadMessage.class); - } - - /** - * Creates a new message on a specified thread. - * - * @param threadId The ID of the thread to create the new message on. - * @param role The role to associate with the new message. - * @param content The textual content for the new message. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single, existing message within an assistant thread. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public ThreadMessage createMessage(String threadId, MessageRole role, String content) { - // Generated convenience method for createMessageWithResponse - RequestOptions requestOptions = new RequestOptions(); - CreateMessageRequest requestObj = new CreateMessageRequest(role, content); - BinaryData request = BinaryData.fromObject(requestObj); - return createMessageWithResponse(threadId, request, requestOptions).getValue().toObject(ThreadMessage.class); - } - /** * Gets a list of messages that exist on a thread. * @@ -2143,29 +2028,6 @@ public PageableList listMessageFiles(String threadId, String messag messageFileList.getLastId(), messageFileList.isHasMore()); } - /** - * Gets information about a file attachment to a message within a thread. - * - * @param threadId The ID of the thread containing the message to get information from. - * @param messageId The ID of the message to get information from. - * @param fileId The ID of the file to get information about. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a file attachment to a message within a thread. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public MessageFile getMessageFile(String threadId, String messageId, String fileId) { - // Generated convenience method for getMessageFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getMessageFileWithResponse(threadId, messageId, fileId, requestOptions).getValue() - .toObject(MessageFile.class); - } - /** * Gets a list of runs for a specified thread. * @@ -2791,53 +2653,6 @@ public Assistant updateAssistant(String assistantId, UpdateAssistantOptions upda .toObject(Assistant.class); } - /** - * Modifies an existing thread. - * - * @param threadId The ID of the thread to modify. - * @param metadata A set of up to 16 key/value pairs that can be attached to an object, used for storing additional - * information about that object in a structured format. Keys may be up to 64 characters in length and values may be - * up to 512 characters in length. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a single thread associated with an assistant. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public AssistantThread updateThread(String threadId, Map metadata) { - // Generated convenience method for updateThreadWithResponse - RequestOptions requestOptions = new RequestOptions(); - UpdateThreadRequest requestObj = new UpdateThreadRequest().setMetadata(metadata); - BinaryData request = BinaryData.fromObject(requestObj); - return updateThreadWithResponse(threadId, request, requestOptions).getValue().toObject(AssistantThread.class); - } - - /** - * Modifies an existing thread. - * - * @param threadId The ID of the thread to modify. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a single thread associated with an assistant. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public AssistantThread updateThread(String threadId) { - // Generated convenience method for updateThreadWithResponse - RequestOptions requestOptions = new RequestOptions(); - UpdateThreadRequest requestObj = new UpdateThreadRequest(); - BinaryData request = BinaryData.fromObject(requestObj); - return updateThreadWithResponse(threadId, request, requestOptions).getValue().toObject(AssistantThread.class); - } - /** * Modifies an existing message on an existing thread. * @@ -3229,4 +3044,1098 @@ public ThreadRun submitToolOutputsToRun(String threadId, String runId, ListQuery Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for + * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the + * list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     data (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             created_at: long (Required)
+     *             name: String (Required)
+     *             usage_bytes: int (Required)
+     *             file_counts (Required): {
+     *                 in_progress: int (Required)
+     *                 completed: int (Required)
+     *                 failed: int (Required)
+     *                 cancelled: int (Required)
+     *                 total: int (Required)
+     *             }
+     *             status: String(expired/in_progress/completed) (Required)
+     *             expires_after (Optional): {
+     *                 anchor: String(last_active_at) (Required)
+     *                 days: int (Required)
+     *             }
+     *             expires_at: Long (Optional)
+     *             last_active_at: Long (Required)
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Required)
+     *     last_id: String (Required)
+     *     has_more: boolean (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listVectorStoresWithResponse(RequestOptions requestOptions) { + return this.serviceClient.listVectorStoresWithResponse(requestOptions); + } + + /** + * Creates a vector store. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     file_ids (Optional): [
+     *         String (Optional)
+     *     ]
+     *     name: String (Optional)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     name: String (Required)
+     *     usage_bytes: int (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
+     *     status: String(expired/in_progress/completed) (Required)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     expires_at: Long (Optional)
+     *     last_active_at: Long (Required)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreOptions Request object for creating a vector store. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a vector store is a collection of processed files can be used by the `file_search` tool along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createVectorStoreWithResponse(BinaryData vectorStoreOptions, + RequestOptions requestOptions) { + return this.serviceClient.createVectorStoreWithResponse(vectorStoreOptions, requestOptions); + } + + /** + * Returns the vector store object matching the specified ID. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     name: String (Required)
+     *     usage_bytes: int (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
+     *     status: String(expired/in_progress/completed) (Required)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     expires_at: Long (Optional)
+     *     last_active_at: Long (Required)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a vector store is a collection of processed files can be used by the `file_search` tool along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVectorStoreWithResponse(String vectorStoreId, RequestOptions requestOptions) { + return this.serviceClient.getVectorStoreWithResponse(vectorStoreId, requestOptions); + } + + /** + * The ID of the vector store to modify. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     name: String (Required)
+     *     usage_bytes: int (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
+     *     status: String(expired/in_progress/completed) (Required)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     expires_at: Long (Optional)
+     *     last_active_at: Long (Required)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store to modify. + * @param vectorStoreUpdateOptions Request object for updating a vector store. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a vector store is a collection of processed files can be used by the `file_search` tool along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response modifyVectorStoreWithResponse(String vectorStoreId, BinaryData vectorStoreUpdateOptions, + RequestOptions requestOptions) { + return this.serviceClient.modifyVectorStoreWithResponse(vectorStoreId, vectorStoreUpdateOptions, + requestOptions); + } + + /** + * Deletes the vector store object matching the specified ID. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     deleted: boolean (Required)
+     *     object: String (Required)
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store to delete. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response object for deleting a vector store along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteVectorStoreWithResponse(String vectorStoreId, RequestOptions requestOptions) { + return this.serviceClient.deleteVectorStoreWithResponse(vectorStoreId, requestOptions); + } + + /** + * Returns a list of vector store files. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter by file status. Allowed values: "in_progress", + * "completed", "failed", "cancelled".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for + * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the + * list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     data (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             usage_bytes: int (Required)
+     *             created_at: long (Required)
+     *             vector_store_id: String (Required)
+     *             status: String(in_progress/completed/failed/cancelled) (Required)
+     *             last_error (Required): {
+     *                 code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
+     *                 message: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Required)
+     *     last_id: String (Required)
+     *     has_more: boolean (Required)
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store that the files belong to. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listVectorStoreFilesWithResponse(String vectorStoreId, RequestOptions requestOptions) { + return this.serviceClient.listVectorStoreFilesWithResponse(vectorStoreId, requestOptions); + } + + /** + * Create a vector store file by attaching a file to a vector store. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     file_id: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     usage_bytes: int (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/failed/cancelled) (Required)
+     *     last_error (Required): {
+     *         code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store for which to create a File. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return description of a file attached to a vector store along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createVectorStoreFileWithResponse(String vectorStoreId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createVectorStoreFileWithResponse(vectorStoreId, request, requestOptions); + } + + /** + * Retrieves a vector store file. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     usage_bytes: int (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/failed/cancelled) (Required)
+     *     last_error (Required): {
+     *         code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store that the file belongs to. + * @param fileId The ID of the file being retrieved. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return description of a file attached to a vector store along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVectorStoreFileWithResponse(String vectorStoreId, String fileId, + RequestOptions requestOptions) { + return this.serviceClient.getVectorStoreFileWithResponse(vectorStoreId, fileId, requestOptions); + } + + /** + * Delete a vector store file. This will remove the file from the vector store but the file itself will not be + * deleted. + * To delete the file, use the delete file endpoint. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     deleted: boolean (Required)
+     *     object: String (Required)
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store that the file belongs to. + * @param fileId The ID of the file to delete its relationship to the vector store. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response object for deleting a vector store file relationship along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteVectorStoreFileWithResponse(String vectorStoreId, String fileId, + RequestOptions requestOptions) { + return this.serviceClient.deleteVectorStoreFileWithResponse(vectorStoreId, fileId, requestOptions); + } + + /** + * Create a vector store file batch. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     file_ids (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/cancelled/failed) (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store for which to create a File Batch. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a batch of files attached to a vector store along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createVectorStoreFileBatchWithResponse(String vectorStoreId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createVectorStoreFileBatchWithResponse(vectorStoreId, request, requestOptions); + } + + /** + * Retrieve a vector store file batch. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/cancelled/failed) (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch being retrieved. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a batch of files attached to a vector store along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVectorStoreFileBatchWithResponse(String vectorStoreId, String batchId, + RequestOptions requestOptions) { + return this.serviceClient.getVectorStoreFileBatchWithResponse(vectorStoreId, batchId, requestOptions); + } + + /** + * Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as + * possible. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/cancelled/failed) (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch to cancel. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a batch of files attached to a vector store along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelVectorStoreFileBatchWithResponse(String vectorStoreId, String batchId, + RequestOptions requestOptions) { + return this.serviceClient.cancelVectorStoreFileBatchWithResponse(vectorStoreId, batchId, requestOptions); + } + + /** + * Returns a list of vector store files in a batch. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter by file status. Allowed values: "in_progress", + * "completed", "failed", "cancelled".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for + * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the + * list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     data (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             usage_bytes: int (Required)
+     *             created_at: long (Required)
+     *             vector_store_id: String (Required)
+     *             status: String(in_progress/completed/failed/cancelled) (Required)
+     *             last_error (Required): {
+     *                 code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
+     *                 message: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Required)
+     *     last_id: String (Required)
+     *     has_more: boolean (Required)
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch that the files belong to. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listVectorStoreFileBatchFilesWithResponse(String vectorStoreId, String batchId, + RequestOptions requestOptions) { + return this.serviceClient.listVectorStoreFileBatchFilesWithResponse(vectorStoreId, batchId, requestOptions); + } + + /** + * Modifies an existing thread. + * + * @param threadId The ID of the thread to modify. + * @param updateAssistantThreadOptions The details used to update an existing assistant thread. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a single thread associated with an assistant. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AssistantThread updateThread(String threadId, UpdateAssistantThreadOptions updateAssistantThreadOptions) { + // Generated convenience method for updateThreadWithResponse + RequestOptions requestOptions = new RequestOptions(); + return updateThreadWithResponse(threadId, BinaryData.fromObject(updateAssistantThreadOptions), requestOptions) + .getValue() + .toObject(AssistantThread.class); + } + + /** + * Creates a new message on a specified thread. + * + * @param threadId The ID of the thread to create the new message on. + * @param threadMessageOptions A single message within an assistant thread, as provided during that thread's + * creation for its initial state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single, existing message within an assistant thread. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ThreadMessage createMessage(String threadId, ThreadMessageOptions threadMessageOptions) { + // Generated convenience method for createMessageWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createMessageWithResponse(threadId, BinaryData.fromObject(threadMessageOptions), requestOptions) + .getValue() + .toObject(ThreadMessage.class); + } + + /** + * Returns a list of vector stores. + * + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default + * is 20. + * @param order Sort order by the created_at timestamp of the objects. asc for ascending order and desc for + * descending order. + * @param after A cursor for use in pagination. after is an object ID that defines your place in the list. For + * instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can + * include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. before is an object ID that defines your place in the list. For + * instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can + * include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenAIPageableListOfVectorStore listVectorStores(Integer limit, ListSortOrder order, String after, + String before) { + // Generated convenience method for listVectorStoresWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return listVectorStoresWithResponse(requestOptions).getValue().toObject(OpenAIPageableListOfVectorStore.class); + } + + /** + * Returns a list of vector stores. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenAIPageableListOfVectorStore listVectorStores() { + // Generated convenience method for listVectorStoresWithResponse + RequestOptions requestOptions = new RequestOptions(); + return listVectorStoresWithResponse(requestOptions).getValue().toObject(OpenAIPageableListOfVectorStore.class); + } + + /** + * Creates a vector store. + * + * @param vectorStoreOptions Request object for creating a vector store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vector store is a collection of processed files can be used by the `file_search` tool. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public VectorStore createVectorStore(VectorStoreOptions vectorStoreOptions) { + // Generated convenience method for createVectorStoreWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createVectorStoreWithResponse(BinaryData.fromObject(vectorStoreOptions), requestOptions).getValue() + .toObject(VectorStore.class); + } + + /** + * Returns the vector store object matching the specified ID. + * + * @param vectorStoreId The ID of the vector store to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vector store is a collection of processed files can be used by the `file_search` tool. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public VectorStore getVectorStore(String vectorStoreId) { + // Generated convenience method for getVectorStoreWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getVectorStoreWithResponse(vectorStoreId, requestOptions).getValue().toObject(VectorStore.class); + } + + /** + * The ID of the vector store to modify. + * + * @param vectorStoreId The ID of the vector store to modify. + * @param vectorStoreUpdateOptions Request object for updating a vector store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vector store is a collection of processed files can be used by the `file_search` tool. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public VectorStore modifyVectorStore(String vectorStoreId, VectorStoreUpdateOptions vectorStoreUpdateOptions) { + // Generated convenience method for modifyVectorStoreWithResponse + RequestOptions requestOptions = new RequestOptions(); + return modifyVectorStoreWithResponse(vectorStoreId, BinaryData.fromObject(vectorStoreUpdateOptions), + requestOptions).getValue().toObject(VectorStore.class); + } + + /** + * Deletes the vector store object matching the specified ID. + * + * @param vectorStoreId The ID of the vector store to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response object for deleting a vector store. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public VectorStoreDeletionStatus deleteVectorStore(String vectorStoreId) { + // Generated convenience method for deleteVectorStoreWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteVectorStoreWithResponse(vectorStoreId, requestOptions).getValue() + .toObject(VectorStoreDeletionStatus.class); + } + + /** + * Returns a list of vector store files. + * + * @param vectorStoreId The ID of the vector store that the files belong to. + * @param filter Filter by file status. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default + * is 20. + * @param order Sort order by the created_at timestamp of the objects. asc for ascending order and desc for + * descending order. + * @param after A cursor for use in pagination. after is an object ID that defines your place in the list. For + * instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can + * include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. before is an object ID that defines your place in the list. For + * instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can + * include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenAIPageableListOfVectorStoreFile listVectorStoreFiles(String vectorStoreId, + VectorStoreFileStatusFilter filter, Integer limit, ListSortOrder order, String after, String before) { + // Generated convenience method for listVectorStoreFilesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter.toString(), false); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return listVectorStoreFilesWithResponse(vectorStoreId, requestOptions).getValue() + .toObject(OpenAIPageableListOfVectorStoreFile.class); + } + + /** + * Returns a list of vector store files. + * + * @param vectorStoreId The ID of the vector store that the files belong to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenAIPageableListOfVectorStoreFile listVectorStoreFiles(String vectorStoreId) { + // Generated convenience method for listVectorStoreFilesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return listVectorStoreFilesWithResponse(vectorStoreId, requestOptions).getValue() + .toObject(OpenAIPageableListOfVectorStoreFile.class); + } + + /** + * Create a vector store file by attaching a file to a vector store. + * + * @param vectorStoreId The ID of the vector store for which to create a File. + * @param fileId A File ID that the vector store should use. Useful for tools like `file_search` that can access + * files. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a file attached to a vector store. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public VectorStoreFile createVectorStoreFile(String vectorStoreId, String fileId) { + // Generated convenience method for createVectorStoreFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateVectorStoreFileRequest requestObj = new CreateVectorStoreFileRequest(fileId); + BinaryData request = BinaryData.fromObject(requestObj); + return createVectorStoreFileWithResponse(vectorStoreId, request, requestOptions).getValue() + .toObject(VectorStoreFile.class); + } + + /** + * Retrieves a vector store file. + * + * @param vectorStoreId The ID of the vector store that the file belongs to. + * @param fileId The ID of the file being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a file attached to a vector store. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public VectorStoreFile getVectorStoreFile(String vectorStoreId, String fileId) { + // Generated convenience method for getVectorStoreFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getVectorStoreFileWithResponse(vectorStoreId, fileId, requestOptions).getValue() + .toObject(VectorStoreFile.class); + } + + /** + * Delete a vector store file. This will remove the file from the vector store but the file itself will not be + * deleted. + * To delete the file, use the delete file endpoint. + * + * @param vectorStoreId The ID of the vector store that the file belongs to. + * @param fileId The ID of the file to delete its relationship to the vector store. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response object for deleting a vector store file relationship. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public VectorStoreFileDeletionStatus deleteVectorStoreFile(String vectorStoreId, String fileId) { + // Generated convenience method for deleteVectorStoreFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteVectorStoreFileWithResponse(vectorStoreId, fileId, requestOptions).getValue() + .toObject(VectorStoreFileDeletionStatus.class); + } + + /** + * Create a vector store file batch. + * + * @param vectorStoreId The ID of the vector store for which to create a File Batch. + * @param fileIds A list of File IDs that the vector store should use. Useful for tools like `file_search` that can + * access files. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a batch of files attached to a vector store. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public VectorStoreFileBatch createVectorStoreFileBatch(String vectorStoreId, List fileIds) { + // Generated convenience method for createVectorStoreFileBatchWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateVectorStoreFileBatchRequest requestObj = new CreateVectorStoreFileBatchRequest(fileIds); + BinaryData request = BinaryData.fromObject(requestObj); + return createVectorStoreFileBatchWithResponse(vectorStoreId, request, requestOptions).getValue() + .toObject(VectorStoreFileBatch.class); + } + + /** + * Retrieve a vector store file batch. + * + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a batch of files attached to a vector store. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public VectorStoreFileBatch getVectorStoreFileBatch(String vectorStoreId, String batchId) { + // Generated convenience method for getVectorStoreFileBatchWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getVectorStoreFileBatchWithResponse(vectorStoreId, batchId, requestOptions).getValue() + .toObject(VectorStoreFileBatch.class); + } + + /** + * Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as + * possible. + * + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a batch of files attached to a vector store. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public VectorStoreFileBatch cancelVectorStoreFileBatch(String vectorStoreId, String batchId) { + // Generated convenience method for cancelVectorStoreFileBatchWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cancelVectorStoreFileBatchWithResponse(vectorStoreId, batchId, requestOptions).getValue() + .toObject(VectorStoreFileBatch.class); + } + + /** + * Returns a list of vector store files in a batch. + * + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch that the files belong to. + * @param filter Filter by file status. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default + * is 20. + * @param order Sort order by the created_at timestamp of the objects. asc for ascending order and desc for + * descending order. + * @param after A cursor for use in pagination. after is an object ID that defines your place in the list. For + * instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can + * include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. before is an object ID that defines your place in the list. For + * instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can + * include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenAIPageableListOfVectorStoreFile listVectorStoreFileBatchFiles(String vectorStoreId, String batchId, + VectorStoreFileStatusFilter filter, Integer limit, ListSortOrder order, String after, String before) { + // Generated convenience method for listVectorStoreFileBatchFilesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter.toString(), false); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return listVectorStoreFileBatchFilesWithResponse(vectorStoreId, batchId, requestOptions).getValue() + .toObject(OpenAIPageableListOfVectorStoreFile.class); + } + + /** + * Returns a list of vector store files in a batch. + * + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch that the files belong to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenAIPageableListOfVectorStoreFile listVectorStoreFileBatchFiles(String vectorStoreId, String batchId) { + // Generated convenience method for listVectorStoreFileBatchFilesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return listVectorStoreFileBatchFilesWithResponse(vectorStoreId, batchId, requestOptions).getValue() + .toObject(OpenAIPageableListOfVectorStoreFile.class); + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsServiceVersion.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsServiceVersion.java index c6a3f83c4e5b8..a715a01de4e44 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsServiceVersion.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsServiceVersion.java @@ -13,7 +13,12 @@ public enum AssistantsServiceVersion implements ServiceVersion { /** * Enum value 2024-02-15-preview. */ - V2024_02_15_PREVIEW("2024-02-15-preview"); + V2024_02_15_PREVIEW("2024-02-15-preview"), + + /** + * Enum value 2024-05-01-preview. + */ + V2024_05_01_PREVIEW("2024-05-01-preview"); private final String version; @@ -35,6 +40,6 @@ public String getVersion() { * @return The latest {@link AssistantsServiceVersion}. */ public static AssistantsServiceVersion getLatest() { - return V2024_02_15_PREVIEW; + return V2024_05_01_PREVIEW; } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java index 8b7451126c1c6..c422a626c763b 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java @@ -247,86 +247,6 @@ Response deleteAssistantSync(@HostParam("endpoint") String endpoint, @PathParam("assistantId") String assistantId, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - @Post("/assistants/{assistantId}/files") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createAssistantFile(@HostParam("endpoint") String endpoint, - @PathParam("assistantId") String assistantId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); - - @Post("/assistants/{assistantId}/files") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createAssistantFileSync(@HostParam("endpoint") String endpoint, - @PathParam("assistantId") String assistantId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); - - @Get("/assistants/{assistantId}/files") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listAssistantFiles(@HostParam("endpoint") String endpoint, - @PathParam("assistantId") String assistantId, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/assistants/{assistantId}/files") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listAssistantFilesSync(@HostParam("endpoint") String endpoint, - @PathParam("assistantId") String assistantId, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/assistants/{assistantId}/files/{fileId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAssistantFile(@HostParam("endpoint") String endpoint, - @PathParam("assistantId") String assistantId, @PathParam("fileId") String fileId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/assistants/{assistantId}/files/{fileId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAssistantFileSync(@HostParam("endpoint") String endpoint, - @PathParam("assistantId") String assistantId, @PathParam("fileId") String fileId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/assistants/{assistantId}/files/{fileId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteAssistantFile(@HostParam("endpoint") String endpoint, - @PathParam("assistantId") String assistantId, @PathParam("fileId") String fileId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/assistants/{assistantId}/files/{fileId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteAssistantFileSync(@HostParam("endpoint") String endpoint, - @PathParam("assistantId") String assistantId, @PathParam("fileId") String fileId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - @Post("/threads") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -377,7 +297,8 @@ Response getThreadSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> updateThread(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData updateAssistantThreadOptions, RequestOptions requestOptions, + Context context); @Post("/threads/{threadId}") @ExpectedResponses({ 200 }) @@ -387,7 +308,8 @@ Mono> updateThread(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateThreadSync(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData updateAssistantThreadOptions, RequestOptions requestOptions, + Context context); @Delete("/threads/{threadId}") @ExpectedResponses({ 200 }) @@ -417,7 +339,8 @@ Response deleteThreadSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createMessage(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData threadMessageOptions, RequestOptions requestOptions, + Context context); @Post("/threads/{threadId}/messages") @ExpectedResponses({ 200 }) @@ -427,7 +350,8 @@ Mono> createMessage(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response createMessageSync(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData threadMessageOptions, RequestOptions requestOptions, + Context context); @Get("/threads/{threadId}/messages") @ExpectedResponses({ 200 }) @@ -491,48 +415,6 @@ Response updateMessageSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); - @Get("/threads/{threadId}/messages/{messageId}/files") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listMessageFiles(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @PathParam("messageId") String messageId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/threads/{threadId}/messages/{messageId}/files") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listMessageFilesSync(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @PathParam("messageId") String messageId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/threads/{threadId}/messages/{messageId}/files/{fileId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMessageFile(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @PathParam("messageId") String messageId, - @PathParam("fileId") String fileId, @HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("/threads/{threadId}/messages/{messageId}/files/{fileId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMessageFileSync(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @PathParam("messageId") String messageId, - @PathParam("fileId") String fileId, @HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); - @Post("/threads/{threadId}/runs") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -815,151 +697,451 @@ Mono> getFileContent(@HostParam("endpoint") String endpoint Response getFileContentSync(@HostParam("endpoint") String endpoint, @PathParam("fileId") String fileId, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - } - /** - * Creates a new assistant. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     model: String (Required)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     instructions: String (Optional)
-     *     tools (Optional): [
-     *          (Optional){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     file_ids (Optional): [
-     *         String (Optional)
-     *     ]
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     object: String (Required)
-     *     created_at: long (Required)
-     *     name: String (Required)
-     *     description: String (Required)
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
-     *          (Required){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * - * @param assistantCreationOptions The request details to use when creating a new assistant. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an assistant that can call the model and use tools along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createAssistantWithResponseAsync(BinaryData assistantCreationOptions, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createAssistant(this.getEndpoint(), accept, - assistantCreationOptions, requestOptions, context)); - } + @Get("/vector_stores") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listVectorStores(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - /** - * Creates a new assistant. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     model: String (Required)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     instructions: String (Optional)
-     *     tools (Optional): [
-     *          (Optional){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     file_ids (Optional): [
-     *         String (Optional)
-     *     ]
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     object: String (Required)
-     *     created_at: long (Required)
-     *     name: String (Required)
-     *     description: String (Required)
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
-     *          (Required){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * - * @param assistantCreationOptions The request details to use when creating a new assistant. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an assistant that can call the model and use tools along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createAssistantWithResponse(BinaryData assistantCreationOptions, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.createAssistantSync(this.getEndpoint(), accept, assistantCreationOptions, requestOptions, - Context.NONE); - } + @Get("/vector_stores") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listVectorStoresSync(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - /** - * Gets a list of assistants that were previously created. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for - * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + @Post("/vector_stores") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createVectorStore(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData vectorStoreOptions, + RequestOptions requestOptions, Context context); + + @Post("/vector_stores") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createVectorStoreSync(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData vectorStoreOptions, + RequestOptions requestOptions, Context context); + + @Get("/vector_stores/{vectorStoreId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getVectorStore(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/vector_stores/{vectorStoreId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getVectorStoreSync(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/vector_stores/{vectorStoreId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> modifyVectorStore(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData vectorStoreUpdateOptions, RequestOptions requestOptions, + Context context); + + @Post("/vector_stores/{vectorStoreId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response modifyVectorStoreSync(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData vectorStoreUpdateOptions, RequestOptions requestOptions, + Context context); + + @Delete("/vector_stores/{vectorStoreId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteVectorStore(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Delete("/vector_stores/{vectorStoreId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteVectorStoreSync(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/vector_stores/{vectorStoreId}/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listVectorStoreFiles(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/vector_stores/{vectorStoreId}/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listVectorStoreFilesSync(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/vector_stores/{vectorStoreId}/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createVectorStoreFile(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/vector_stores/{vectorStoreId}/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createVectorStoreFileSync(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Get("/vector_stores/{vectorStoreId}/files/{fileId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getVectorStoreFile(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @PathParam("fileId") String fileId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/vector_stores/{vectorStoreId}/files/{fileId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getVectorStoreFileSync(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @PathParam("fileId") String fileId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/vector_stores/{vectorStoreId}/files/{fileId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteVectorStoreFile(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @PathParam("fileId") String fileId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/vector_stores/{vectorStoreId}/files/{fileId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteVectorStoreFileSync(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @PathParam("fileId") String fileId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/vector_stores/{vectorStoreId}/file_batches") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createVectorStoreFileBatch(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/vector_stores/{vectorStoreId}/file_batches") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createVectorStoreFileBatchSync(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Get("/vector_stores/{vectorStoreId}/file_batches/{batchId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getVectorStoreFileBatch(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @PathParam("batchId") String batchId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/vector_stores/{vectorStoreId}/file_batches/{batchId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getVectorStoreFileBatchSync(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @PathParam("batchId") String batchId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/vector_stores/{vectorStoreId}/file_batches/{batchId}/cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> cancelVectorStoreFileBatch(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @PathParam("batchId") String batchId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/vector_stores/{vectorStoreId}/file_batches/{batchId}/cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response cancelVectorStoreFileBatchSync(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @PathParam("batchId") String batchId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/vector_stores/{vectorStoreId}/file_batches/{batchId}/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listVectorStoreFileBatchFiles(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @PathParam("batchId") String batchId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/vector_stores/{vectorStoreId}/file_batches/{batchId}/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listVectorStoreFileBatchFilesSync(@HostParam("endpoint") String endpoint, + @PathParam("vectorStoreId") String vectorStoreId, @PathParam("batchId") String batchId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * Creates a new assistant. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     model: String (Required)
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     instructions: String (Optional)
+     *     tools (Optional): [
+     *          (Optional){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_resources (Optional): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *         file_search: BinaryData (Optional)
+     *     }
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     response_format: BinaryData (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     name: String (Required)
+     *     description: String (Required)
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_resources (Required): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
+     *     temperature: Double (Required)
+     *     top_p: Double (Required)
+     *     response_format: BinaryData (Optional)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param assistantCreationOptions The request details to use when creating a new assistant. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents an assistant that can call the model and use tools along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createAssistantWithResponseAsync(BinaryData assistantCreationOptions, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createAssistant(this.getEndpoint(), accept, + assistantCreationOptions, requestOptions, context)); + } + + /** + * Creates a new assistant. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     model: String (Required)
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     instructions: String (Optional)
+     *     tools (Optional): [
+     *          (Optional){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_resources (Optional): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *         file_search: BinaryData (Optional)
+     *     }
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     response_format: BinaryData (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     name: String (Required)
+     *     description: String (Required)
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_resources (Required): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
+     *     temperature: Double (Required)
+     *     top_p: Double (Required)
+     *     response_format: BinaryData (Optional)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param assistantCreationOptions The request details to use when creating a new assistant. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents an assistant that can call the model and use tools along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createAssistantWithResponse(BinaryData assistantCreationOptions, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.createAssistantSync(this.getEndpoint(), accept, assistantCreationOptions, requestOptions, + Context.NONE); + } + + /** + * Gets a list of assistants that were previously created. + *

Query Parameters

+ * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for + * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with @@ -972,116 +1154,641 @@ public Response createAssistantWithResponse(BinaryData assistantCrea *
{@code
      * {
      *     object: String (Required)
-     *     data (Required): [
+     *     data (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             created_at: long (Required)
+     *             name: String (Required)
+     *             description: String (Required)
+     *             model: String (Required)
+     *             instructions: String (Required)
+     *             tools (Required): [
+     *                  (Required){
+     *                     type: String (Required)
+     *                 }
+     *             ]
+     *             tool_resources (Required): {
+     *                 code_interpreter (Optional): {
+     *                     file_ids (Required): [
+     *                         String (Required)
+     *                     ]
+     *                 }
+     *                 file_search (Optional): {
+     *                     vector_store_ids (Optional): [
+     *                         String (Optional)
+     *                     ]
+     *                 }
+     *             }
+     *             temperature: Double (Required)
+     *             top_p: Double (Required)
+     *             response_format: BinaryData (Optional)
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Required)
+     *     last_id: String (Required)
+     *     has_more: boolean (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of assistants that were previously created along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAssistantsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAssistants(this.getEndpoint(), accept, requestOptions, context)); + } + + /** + * Gets a list of assistants that were previously created. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for + * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the + * list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     object: String (Required)
+     *     data (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             created_at: long (Required)
+     *             name: String (Required)
+     *             description: String (Required)
+     *             model: String (Required)
+     *             instructions: String (Required)
+     *             tools (Required): [
+     *                  (Required){
+     *                     type: String (Required)
+     *                 }
+     *             ]
+     *             tool_resources (Required): {
+     *                 code_interpreter (Optional): {
+     *                     file_ids (Required): [
+     *                         String (Required)
+     *                     ]
+     *                 }
+     *                 file_search (Optional): {
+     *                     vector_store_ids (Optional): [
+     *                         String (Optional)
+     *                     ]
+     *                 }
+     *             }
+     *             temperature: Double (Required)
+     *             top_p: Double (Required)
+     *             response_format: BinaryData (Optional)
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Required)
+     *     last_id: String (Required)
+     *     has_more: boolean (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of assistants that were previously created along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAssistantsWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.listAssistantsSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * Retrieves an existing assistant. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     name: String (Required)
+     *     description: String (Required)
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_resources (Required): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
+     *     temperature: Double (Required)
+     *     top_p: Double (Required)
+     *     response_format: BinaryData (Optional)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param assistantId The ID of the assistant to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents an assistant that can call the model and use tools along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAssistantWithResponseAsync(String assistantId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.getAssistant(this.getEndpoint(), assistantId, accept, requestOptions, context)); + } + + /** + * Retrieves an existing assistant. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     name: String (Required)
+     *     description: String (Required)
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_resources (Required): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
+     *     temperature: Double (Required)
+     *     top_p: Double (Required)
+     *     response_format: BinaryData (Optional)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param assistantId The ID of the assistant to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents an assistant that can call the model and use tools along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAssistantWithResponse(String assistantId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getAssistantSync(this.getEndpoint(), assistantId, accept, requestOptions, Context.NONE); + } + + /** + * Modifies an existing assistant. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     model: String (Optional)
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     instructions: String (Optional)
+     *     tools (Optional): [
+     *          (Optional){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_resources (Optional): {
+     *         code_interpreter (Optional): {
+     *             fileIds (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     response_format: BinaryData (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     name: String (Required)
+     *     description: String (Required)
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
      *          (Required){
-     *             id: String (Required)
-     *             object: String (Required)
-     *             created_at: long (Required)
-     *             name: String (Required)
-     *             description: String (Required)
-     *             model: String (Required)
-     *             instructions: String (Required)
-     *             tools (Required): [
-     *                  (Required){
-     *                     type: String (Required)
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_resources (Required): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
+     *     temperature: Double (Required)
+     *     top_p: Double (Required)
+     *     response_format: BinaryData (Optional)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param assistantId The ID of the assistant to modify. + * @param updateAssistantOptions The request details to use when modifying an existing assistant. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents an assistant that can call the model and use tools along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateAssistantWithResponseAsync(String assistantId, + BinaryData updateAssistantOptions, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updateAssistant(this.getEndpoint(), assistantId, accept, + updateAssistantOptions, requestOptions, context)); + } + + /** + * Modifies an existing assistant. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     model: String (Optional)
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     instructions: String (Optional)
+     *     tools (Optional): [
+     *          (Optional){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_resources (Optional): {
+     *         code_interpreter (Optional): {
+     *             fileIds (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     response_format: BinaryData (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     name: String (Required)
+     *     description: String (Required)
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_resources (Required): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
+     *     temperature: Double (Required)
+     *     top_p: Double (Required)
+     *     response_format: BinaryData (Optional)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param assistantId The ID of the assistant to modify. + * @param updateAssistantOptions The request details to use when modifying an existing assistant. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents an assistant that can call the model and use tools along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateAssistantWithResponse(String assistantId, BinaryData updateAssistantOptions, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.updateAssistantSync(this.getEndpoint(), assistantId, accept, updateAssistantOptions, + requestOptions, Context.NONE); + } + + /** + * Deletes an assistant. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     deleted: boolean (Required)
+     *     object: String (Required)
+     * }
+     * }
+ * + * @param assistantId The ID of the assistant to delete. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an assistant deletion operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteAssistantWithResponseAsync(String assistantId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.deleteAssistant(this.getEndpoint(), assistantId, accept, requestOptions, context)); + } + + /** + * Deletes an assistant. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     deleted: boolean (Required)
+     *     object: String (Required)
+     * }
+     * }
+ * + * @param assistantId The ID of the assistant to delete. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an assistant deletion operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAssistantWithResponse(String assistantId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteAssistantSync(this.getEndpoint(), assistantId, accept, requestOptions, Context.NONE); + } + + /** + * Creates a new thread. Threads contain messages and can be run by assistants. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     messages (Optional): [
+     *          (Optional){
+     *             role: String(user/assistant) (Required)
+     *             content: String (Required)
+     *             attachments (Optional): [
+     *                  (Optional){
+     *                     file_id: String (Required)
+     *                     tools (Required): [
+     *                         BinaryData (Required)
+     *                     ]
      *                 }
      *             ]
+     *             metadata (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     tool_resources (Optional): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *         file_search: BinaryData (Optional)
+     *     }
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     tool_resources (Required): {
+     *         code_interpreter (Optional): {
      *             file_ids (Required): [
      *                 String (Required)
      *             ]
-     *             metadata (Required): {
-     *                 String: String (Required)
-     *             }
      *         }
-     *     ]
-     *     first_id: String (Required)
-     *     last_id: String (Required)
-     *     has_more: boolean (Required)
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
      * }
      * }
* + * @param assistantThreadCreationOptions The details used to create a new assistant thread. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of assistants that were previously created along with {@link Response} on successful completion of - * {@link Mono}. + * @return information about a single thread associated with an assistant along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAssistantsWithResponseAsync(RequestOptions requestOptions) { + public Mono> createThreadWithResponseAsync(BinaryData assistantThreadCreationOptions, + RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAssistants(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.createThread(this.getEndpoint(), accept, + assistantThreadCreationOptions, requestOptions, context)); } /** - * Gets a list of assistants that were previously created. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for - * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with - * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with - * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the - * list.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

+ * Creates a new thread. Threads contain messages and can be run by assistants. + *

Request Body Schema

* *
{@code
      * {
-     *     object: String (Required)
-     *     data (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             object: String (Required)
-     *             created_at: long (Required)
-     *             name: String (Required)
-     *             description: String (Required)
-     *             model: String (Required)
-     *             instructions: String (Required)
-     *             tools (Required): [
-     *                  (Required){
-     *                     type: String (Required)
+     *     messages (Optional): [
+     *          (Optional){
+     *             role: String(user/assistant) (Required)
+     *             content: String (Required)
+     *             attachments (Optional): [
+     *                  (Optional){
+     *                     file_id: String (Required)
+     *                     tools (Required): [
+     *                         BinaryData (Required)
+     *                     ]
      *                 }
      *             ]
-     *             file_ids (Required): [
-     *                 String (Required)
-     *             ]
-     *             metadata (Required): {
+     *             metadata (Optional): {
      *                 String: String (Required)
      *             }
      *         }
      *     ]
-     *     first_id: String (Required)
-     *     last_id: String (Required)
-     *     has_more: boolean (Required)
+     *     tool_resources (Optional): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *         file_search: BinaryData (Optional)
+     *     }
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     tool_resources (Required): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
      * }
      * }
* + * @param assistantThreadCreationOptions The details used to create a new assistant thread. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of assistants that were previously created along with {@link Response}. + * @return information about a single thread associated with an assistant along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAssistantsWithResponse(RequestOptions requestOptions) { + public Response createThreadWithResponse(BinaryData assistantThreadCreationOptions, + RequestOptions requestOptions) { final String accept = "application/json"; - return service.listAssistantsSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.createThreadSync(this.getEndpoint(), accept, assistantThreadCreationOptions, requestOptions, + Context.NONE); } /** - * Retrieves an existing assistant. + * Gets information about an existing thread. *

Response Body Schema

* *
{@code
@@ -1089,42 +1796,42 @@ public Response listAssistantsWithResponse(RequestOptions requestOpt
      *     id: String (Required)
      *     object: String (Required)
      *     created_at: long (Required)
-     *     name: String (Required)
-     *     description: String (Required)
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
-     *          (Required){
-     *             type: String (Required)
+     *     tool_resources (Required): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Required): [
+     *                 String (Required)
+     *             ]
      *         }
-     *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param assistantId The ID of the assistant to retrieve. + * @param threadId The ID of the thread to retrieve information about. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an assistant that can call the model and use tools along with {@link Response} on successful - * completion of {@link Mono}. + * @return information about an existing thread along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAssistantWithResponseAsync(String assistantId, RequestOptions requestOptions) { + public Mono> getThreadWithResponseAsync(String threadId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getAssistant(this.getEndpoint(), assistantId, accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getThread(this.getEndpoint(), threadId, accept, requestOptions, context)); } /** - * Retrieves an existing assistant. + * Gets information about an existing thread. *

Response Body Schema

* *
{@code
@@ -1132,56 +1839,56 @@ public Mono> getAssistantWithResponseAsync(String assistant
      *     id: String (Required)
      *     object: String (Required)
      *     created_at: long (Required)
-     *     name: String (Required)
-     *     description: String (Required)
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
-     *          (Required){
-     *             type: String (Required)
+     *     tool_resources (Required): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Required): [
+     *                 String (Required)
+     *             ]
      *         }
-     *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param assistantId The ID of the assistant to retrieve. + * @param threadId The ID of the thread to retrieve information about. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an assistant that can call the model and use tools along with {@link Response}. + * @return information about an existing thread along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAssistantWithResponse(String assistantId, RequestOptions requestOptions) { + public Response getThreadWithResponse(String threadId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAssistantSync(this.getEndpoint(), assistantId, accept, requestOptions, Context.NONE); + return service.getThreadSync(this.getEndpoint(), threadId, accept, requestOptions, Context.NONE); } /** - * Modifies an existing assistant. + * Modifies an existing thread. *

Request Body Schema

* *
{@code
      * {
-     *     model: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     instructions: String (Optional)
-     *     tools (Optional): [
-     *          (Optional){
-     *             type: String (Required)
+     *     tool_resources (Optional): {
+     *         code_interpreter (Optional): {
+     *             fileIds (Optional): [
+     *                 String (Optional)
+     *             ]
      *         }
-     *     ]
-     *     file_ids (Optional): [
-     *         String (Optional)
-     *     ]
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
      *     metadata (Optional): {
      *         String: String (Required)
      *     }
@@ -1195,60 +1902,60 @@ public Response getAssistantWithResponse(String assistantId, Request
      *     id: String (Required)
      *     object: String (Required)
      *     created_at: long (Required)
-     *     name: String (Required)
-     *     description: String (Required)
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
-     *          (Required){
-     *             type: String (Required)
+     *     tool_resources (Required): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Required): [
+     *                 String (Required)
+     *             ]
      *         }
-     *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param assistantId The ID of the assistant to modify. - * @param updateAssistantOptions The request details to use when modifying an existing assistant. + * @param threadId The ID of the thread to modify. + * @param updateAssistantThreadOptions The details used to update an existing assistant thread. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an assistant that can call the model and use tools along with {@link Response} on successful + * @return information about a single thread associated with an assistant along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateAssistantWithResponseAsync(String assistantId, - BinaryData updateAssistantOptions, RequestOptions requestOptions) { + public Mono> updateThreadWithResponseAsync(String threadId, + BinaryData updateAssistantThreadOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateAssistant(this.getEndpoint(), assistantId, accept, - updateAssistantOptions, requestOptions, context)); + return FluxUtil.withContext(context -> service.updateThread(this.getEndpoint(), threadId, accept, + updateAssistantThreadOptions, requestOptions, context)); } /** - * Modifies an existing assistant. + * Modifies an existing thread. *

Request Body Schema

* *
{@code
      * {
-     *     model: String (Optional)
-     *     name: String (Optional)
-     *     description: String (Optional)
-     *     instructions: String (Optional)
-     *     tools (Optional): [
-     *          (Optional){
-     *             type: String (Required)
+     *     tool_resources (Optional): {
+     *         code_interpreter (Optional): {
+     *             fileIds (Optional): [
+     *                 String (Optional)
+     *             ]
      *         }
-     *     ]
-     *     file_ids (Optional): [
-     *         String (Optional)
-     *     ]
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
      *     metadata (Optional): {
      *         String: String (Required)
      *     }
@@ -1259,46 +1966,46 @@ public Mono> updateAssistantWithResponseAsync(String assist
      * 
      * 
{@code
      * {
-     *     id: String (Required)
-     *     object: String (Required)
-     *     created_at: long (Required)
-     *     name: String (Required)
-     *     description: String (Required)
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
-     *          (Required){
-     *             type: String (Required)
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     tool_resources (Required): {
+     *         code_interpreter (Optional): {
+     *             file_ids (Required): [
+     *                 String (Required)
+     *             ]
      *         }
-     *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param assistantId The ID of the assistant to modify. - * @param updateAssistantOptions The request details to use when modifying an existing assistant. + * @param threadId The ID of the thread to modify. + * @param updateAssistantThreadOptions The details used to update an existing assistant thread. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an assistant that can call the model and use tools along with {@link Response}. + * @return information about a single thread associated with an assistant along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateAssistantWithResponse(String assistantId, BinaryData updateAssistantOptions, + public Response updateThreadWithResponse(String threadId, BinaryData updateAssistantThreadOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return service.updateAssistantSync(this.getEndpoint(), assistantId, accept, updateAssistantOptions, + return service.updateThreadSync(this.getEndpoint(), threadId, accept, updateAssistantThreadOptions, requestOptions, Context.NONE); } /** - * Deletes an assistant. + * Deletes an existing thread. *

Response Body Schema

* *
{@code
@@ -1309,25 +2016,24 @@ public Response updateAssistantWithResponse(String assistantId, Bina
      * }
      * }
* - * @param assistantId The ID of the assistant to delete. + * @param threadId The ID of the thread to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the status of an assistant deletion operation along with {@link Response} on successful completion of + * @return the status of a thread deletion operation along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteAssistantWithResponseAsync(String assistantId, - RequestOptions requestOptions) { + public Mono> deleteThreadWithResponseAsync(String threadId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( - context -> service.deleteAssistant(this.getEndpoint(), assistantId, accept, requestOptions, context)); + context -> service.deleteThread(this.getEndpoint(), threadId, accept, requestOptions, context)); } /** - * Deletes an assistant. + * Deletes an existing thread. *

Response Body Schema

* *
{@code
@@ -1338,27 +2044,39 @@ public Mono> deleteAssistantWithResponseAsync(String assist
      * }
      * }
* - * @param assistantId The ID of the assistant to delete. + * @param threadId The ID of the thread to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the status of an assistant deletion operation along with {@link Response}. + * @return the status of a thread deletion operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAssistantWithResponse(String assistantId, RequestOptions requestOptions) { + public Response deleteThreadWithResponse(String threadId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.deleteAssistantSync(this.getEndpoint(), assistantId, accept, requestOptions, Context.NONE); + return service.deleteThreadSync(this.getEndpoint(), threadId, accept, requestOptions, Context.NONE); } /** - * Attaches a previously uploaded file to an assistant for use by tools that can read files. + * Creates a new message on a specified thread. *

Request Body Schema

* *
{@code
      * {
-     *     file_id: String (Required)
+     *     role: String(user/assistant) (Required)
+     *     content: String (Required)
+     *     attachments (Optional): [
+     *          (Optional){
+     *             file_id: String (Required)
+     *             tools (Required): [
+     *                 BinaryData (Required)
+     *             ]
+     *         }
+     *     ]
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
      * }
      * }
* @@ -1369,35 +2087,73 @@ public Response deleteAssistantWithResponse(String assistantId, Requ * id: String (Required) * object: String (Required) * created_at: long (Required) + * thread_id: String (Required) + * status: String(in_progress/incomplete/completed) (Required) + * incomplete_details (Required): { + * reason: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required) + * } + * completed_at: Long (Required) + * incomplete_at: Long (Required) + * role: String(user/assistant) (Required) + * content (Required): [ + * (Required){ + * type: String (Required) + * } + * ] * assistant_id: String (Required) + * run_id: String (Required) + * attachments (Required): [ + * (Required){ + * file_id: String (Required) + * tools (Required): [ + * BinaryData (Required) + * ] + * } + * ] + * metadata (Required): { + * String: String (Required) + * } * } * }
* - * @param assistantId The ID of the assistant to attach the file to. - * @param request The request parameter. + * @param threadId The ID of the thread to create the new message on. + * @param threadMessageOptions A single message within an assistant thread, as provided during that thread's + * creation for its initial state. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return information about a file attached to an assistant, as used by tools that can read files along with - * {@link Response} on successful completion of {@link Mono}. + * @return a single, existing message within an assistant thread along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createAssistantFileWithResponseAsync(String assistantId, BinaryData request, + public Mono> createMessageWithResponseAsync(String threadId, BinaryData threadMessageOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createAssistantFile(this.getEndpoint(), assistantId, accept, - request, requestOptions, context)); + return FluxUtil.withContext(context -> service.createMessage(this.getEndpoint(), threadId, accept, + threadMessageOptions, requestOptions, context)); } /** - * Attaches a previously uploaded file to an assistant for use by tools that can read files. + * Creates a new message on a specified thread. *

Request Body Schema

* *
{@code
      * {
-     *     file_id: String (Required)
+     *     role: String(user/assistant) (Required)
+     *     content: String (Required)
+     *     attachments (Optional): [
+     *          (Optional){
+     *             file_id: String (Required)
+     *             tools (Required): [
+     *                 BinaryData (Required)
+     *             ]
+     *         }
+     *     ]
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
      * }
      * }
* @@ -1408,34 +2164,60 @@ public Mono> createAssistantFileWithResponseAsync(String as * id: String (Required) * object: String (Required) * created_at: long (Required) + * thread_id: String (Required) + * status: String(in_progress/incomplete/completed) (Required) + * incomplete_details (Required): { + * reason: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required) + * } + * completed_at: Long (Required) + * incomplete_at: Long (Required) + * role: String(user/assistant) (Required) + * content (Required): [ + * (Required){ + * type: String (Required) + * } + * ] * assistant_id: String (Required) + * run_id: String (Required) + * attachments (Required): [ + * (Required){ + * file_id: String (Required) + * tools (Required): [ + * BinaryData (Required) + * ] + * } + * ] + * metadata (Required): { + * String: String (Required) + * } * } * } * - * @param assistantId The ID of the assistant to attach the file to. - * @param request The request parameter. + * @param threadId The ID of the thread to create the new message on. + * @param threadMessageOptions A single message within an assistant thread, as provided during that thread's + * creation for its initial state. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return information about a file attached to an assistant, as used by tools that can read files along with - * {@link Response}. + * @return a single, existing message within an assistant thread along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createAssistantFileWithResponse(String assistantId, BinaryData request, + public Response createMessageWithResponse(String threadId, BinaryData threadMessageOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return service.createAssistantFileSync(this.getEndpoint(), assistantId, accept, request, requestOptions, + return service.createMessageSync(this.getEndpoint(), threadId, accept, threadMessageOptions, requestOptions, Context.NONE); } /** - * Gets a list of files attached to a specific assistant, as used by tools that can read files. + * Gets a list of messages that exist on a thread. *

Query Parameters

* * * + * * *
Query Parameters
NameTypeRequiredDescription
runIdStringNoFilter messages by the run ID that generated them.
limitIntegerNoA limit on the number of objects to be returned. Limit can range * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for @@ -1459,7 +2241,32 @@ public Response createAssistantFileWithResponse(String assistantId, * id: String (Required) * object: String (Required) * created_at: long (Required) + * thread_id: String (Required) + * status: String(in_progress/incomplete/completed) (Required) + * incomplete_details (Required): { + * reason: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required) + * } + * completed_at: Long (Required) + * incomplete_at: Long (Required) + * role: String(user/assistant) (Required) + * content (Required): [ + * (Required){ + * type: String (Required) + * } + * ] * assistant_id: String (Required) + * run_id: String (Required) + * attachments (Required): [ + * (Required){ + * file_id: String (Required) + * tools (Required): [ + * BinaryData (Required) + * ] + * } + * ] + * metadata (Required): { + * String: String (Required) + * } * } * ] * first_id: String (Required) @@ -1468,29 +2275,29 @@ public Response createAssistantFileWithResponse(String assistantId, * } * } * - * @param assistantId The ID of the assistant to retrieve the list of attached files for. + * @param threadId The ID of the thread to list messages from. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of files attached to a specific assistant, as used by tools that can read files along with - * {@link Response} on successful completion of {@link Mono}. + * @return a list of messages that exist on a thread along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAssistantFilesWithResponseAsync(String assistantId, - RequestOptions requestOptions) { + public Mono> listMessagesWithResponseAsync(String threadId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( - context -> service.listAssistantFiles(this.getEndpoint(), assistantId, accept, requestOptions, context)); + context -> service.listMessages(this.getEndpoint(), threadId, accept, requestOptions, context)); } /** - * Gets a list of files attached to a specific assistant, as used by tools that can read files. + * Gets a list of messages that exist on a thread. *

Query Parameters

* * * + * * *
Query Parameters
NameTypeRequiredDescription
runIdStringNoFilter messages by the run ID that generated them.
limitIntegerNoA limit on the number of objects to be returned. Limit can range * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for @@ -1514,32 +2321,176 @@ public Mono> listAssistantFilesWithResponseAsync(String ass * id: String (Required) * object: String (Required) * created_at: long (Required) + * thread_id: String (Required) + * status: String(in_progress/incomplete/completed) (Required) + * incomplete_details (Required): { + * reason: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required) + * } + * completed_at: Long (Required) + * incomplete_at: Long (Required) + * role: String(user/assistant) (Required) + * content (Required): [ + * (Required){ + * type: String (Required) + * } + * ] * assistant_id: String (Required) + * run_id: String (Required) + * attachments (Required): [ + * (Required){ + * file_id: String (Required) + * tools (Required): [ + * BinaryData (Required) + * ] + * } + * ] + * metadata (Required): { + * String: String (Required) + * } + * } + * ] + * first_id: String (Required) + * last_id: String (Required) + * has_more: boolean (Required) + * } + * } + * + * @param threadId The ID of the thread to list messages from. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of messages that exist on a thread along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listMessagesWithResponse(String threadId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.listMessagesSync(this.getEndpoint(), threadId, accept, requestOptions, Context.NONE); + } + + /** + * Gets an existing message from an existing thread. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     thread_id: String (Required)
+     *     status: String(in_progress/incomplete/completed) (Required)
+     *     incomplete_details (Required): {
+     *         reason: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required)
+     *     }
+     *     completed_at: Long (Required)
+     *     incomplete_at: Long (Required)
+     *     role: String(user/assistant) (Required)
+     *     content (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     assistant_id: String (Required)
+     *     run_id: String (Required)
+     *     attachments (Required): [
+     *          (Required){
+     *             file_id: String (Required)
+     *             tools (Required): [
+     *                 BinaryData (Required)
+     *             ]
+     *         }
+     *     ]
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param threadId The ID of the thread to retrieve the specified message from. + * @param messageId The ID of the message to retrieve from the specified thread. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an existing message from an existing thread along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMessageWithResponseAsync(String threadId, String messageId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.getMessage(this.getEndpoint(), threadId, messageId, accept, requestOptions, context)); + } + + /** + * Gets an existing message from an existing thread. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     created_at: long (Required)
+     *     thread_id: String (Required)
+     *     status: String(in_progress/incomplete/completed) (Required)
+     *     incomplete_details (Required): {
+     *         reason: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required)
+     *     }
+     *     completed_at: Long (Required)
+     *     incomplete_at: Long (Required)
+     *     role: String(user/assistant) (Required)
+     *     content (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     assistant_id: String (Required)
+     *     run_id: String (Required)
+     *     attachments (Required): [
+     *          (Required){
+     *             file_id: String (Required)
+     *             tools (Required): [
+     *                 BinaryData (Required)
+     *             ]
      *         }
      *     ]
-     *     first_id: String (Required)
-     *     last_id: String (Required)
-     *     has_more: boolean (Required)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
      * }
      * }
* - * @param assistantId The ID of the assistant to retrieve the list of attached files for. + * @param threadId The ID of the thread to retrieve the specified message from. + * @param messageId The ID of the message to retrieve from the specified thread. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of files attached to a specific assistant, as used by tools that can read files along with - * {@link Response}. + * @return an existing message from an existing thread along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAssistantFilesWithResponse(String assistantId, RequestOptions requestOptions) { + public Response getMessageWithResponse(String threadId, String messageId, + RequestOptions requestOptions) { final String accept = "application/json"; - return service.listAssistantFilesSync(this.getEndpoint(), assistantId, accept, requestOptions, Context.NONE); + return service.getMessageSync(this.getEndpoint(), threadId, messageId, accept, requestOptions, Context.NONE); } /** - * Retrieves a file attached to an assistant. + * Modifies an existing message on an existing thread. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * *

Response Body Schema

* *
{@code
@@ -1547,30 +2498,66 @@ public Response listAssistantFilesWithResponse(String assistantId, R
      *     id: String (Required)
      *     object: String (Required)
      *     created_at: long (Required)
+     *     thread_id: String (Required)
+     *     status: String(in_progress/incomplete/completed) (Required)
+     *     incomplete_details (Required): {
+     *         reason: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required)
+     *     }
+     *     completed_at: Long (Required)
+     *     incomplete_at: Long (Required)
+     *     role: String(user/assistant) (Required)
+     *     content (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
      *     assistant_id: String (Required)
+     *     run_id: String (Required)
+     *     attachments (Required): [
+     *          (Required){
+     *             file_id: String (Required)
+     *             tools (Required): [
+     *                 BinaryData (Required)
+     *             ]
+     *         }
+     *     ]
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
      * }
      * }
* - * @param assistantId The ID of the assistant associated with the attached file. - * @param fileId The ID of the file to retrieve. + * @param threadId The ID of the thread containing the specified message to modify. + * @param messageId The ID of the message to modify on the specified thread. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return information about a file attached to an assistant, as used by tools that can read files along with - * {@link Response} on successful completion of {@link Mono}. + * @return a single, existing message within an assistant thread along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAssistantFileWithResponseAsync(String assistantId, String fileId, - RequestOptions requestOptions) { + public Mono> updateMessageWithResponseAsync(String threadId, String messageId, + BinaryData request, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAssistantFile(this.getEndpoint(), assistantId, fileId, accept, - requestOptions, context)); + return FluxUtil.withContext(context -> service.updateMessage(this.getEndpoint(), threadId, messageId, accept, + request, requestOptions, context)); } /** - * Retrieves a file attached to an assistant. + * Modifies an existing message on an existing thread. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * *

Response Body Schema

* *
{@code
@@ -1578,107 +2565,246 @@ public Mono> getAssistantFileWithResponseAsync(String assis
      *     id: String (Required)
      *     object: String (Required)
      *     created_at: long (Required)
+     *     thread_id: String (Required)
+     *     status: String(in_progress/incomplete/completed) (Required)
+     *     incomplete_details (Required): {
+     *         reason: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required)
+     *     }
+     *     completed_at: Long (Required)
+     *     incomplete_at: Long (Required)
+     *     role: String(user/assistant) (Required)
+     *     content (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
      *     assistant_id: String (Required)
+     *     run_id: String (Required)
+     *     attachments (Required): [
+     *          (Required){
+     *             file_id: String (Required)
+     *             tools (Required): [
+     *                 BinaryData (Required)
+     *             ]
+     *         }
+     *     ]
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
      * }
      * }
* - * @param assistantId The ID of the assistant associated with the attached file. - * @param fileId The ID of the file to retrieve. + * @param threadId The ID of the thread containing the specified message to modify. + * @param messageId The ID of the message to modify on the specified thread. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return information about a file attached to an assistant, as used by tools that can read files along with - * {@link Response}. + * @return a single, existing message within an assistant thread along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAssistantFileWithResponse(String assistantId, String fileId, + public Response updateMessageWithResponse(String threadId, String messageId, BinaryData request, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAssistantFileSync(this.getEndpoint(), assistantId, fileId, accept, requestOptions, + return service.updateMessageSync(this.getEndpoint(), threadId, messageId, accept, request, requestOptions, Context.NONE); } /** - * Unlinks a previously attached file from an assistant, rendering it unavailable for use by tools that can read - * files. - *

Response Body Schema

+ * Creates a new run for an assistant thread. + *

Request Body Schema

* *
{@code
      * {
-     *     id: String (Required)
-     *     deleted: boolean (Required)
-     *     object: String (Required)
+     *     assistant_id: String (Required)
+     *     model: String (Optional)
+     *     instructions: String (Optional)
+     *     additional_instructions: String (Optional)
+     *     additional_messages (Optional): [
+     *          (Optional){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             created_at: long (Required)
+     *             thread_id: String (Required)
+     *             status: String(in_progress/incomplete/completed) (Required)
+     *             incomplete_details (Required): {
+     *                 reason: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required)
+     *             }
+     *             completed_at: Long (Required)
+     *             incomplete_at: Long (Required)
+     *             role: String(user/assistant) (Required)
+     *             content (Required): [
+     *                  (Required){
+     *                     type: String (Required)
+     *                 }
+     *             ]
+     *             assistant_id: String (Required)
+     *             run_id: String (Required)
+     *             attachments (Required): [
+     *                  (Required){
+     *                     file_id: String (Required)
+     *                     tools (Required): [
+     *                         BinaryData (Required)
+     *                     ]
+     *                 }
+     *             ]
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     tools (Optional): [
+     *          (Optional){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     stream: Boolean (Optional)
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_prompt_tokens: Integer (Optional)
+     *     max_completion_tokens: Integer (Optional)
+     *     truncation_strategy (Optional): {
+     *         type: String(auto/last_messages) (Required)
+     *         last_messages: Integer (Optional)
+     *     }
+     *     tool_choice: BinaryData (Optional)
+     *     response_format: BinaryData (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
      * }
      * }
* - * @param assistantId The ID of the assistant from which the specified file should be unlinked. - * @param fileId The ID of the file to unlink from the specified assistant. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the status of an assistant file deletion operation along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteAssistantFileWithResponseAsync(String assistantId, String fileId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteAssistantFile(this.getEndpoint(), assistantId, fileId, - accept, requestOptions, context)); - } - - /** - * Unlinks a previously attached file from an assistant, rendering it unavailable for use by tools that can read - * files. *

Response Body Schema

* *
{@code
      * {
      *     id: String (Required)
-     *     deleted: boolean (Required)
      *     object: String (Required)
+     *     thread_id: String (Required)
+     *     assistant_id: String (Required)
+     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
+     *     required_action (Optional): {
+     *         type: String (Required)
+     *     }
+     *     last_error (Required): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     created_at: long (Required)
+     *     expires_at: Long (Required)
+     *     started_at: Long (Required)
+     *     completed_at: Long (Required)
+     *     cancelled_at: Long (Required)
+     *     failed_at: Long (Required)
+     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
+     *     usage (Required): {
+     *         completion_tokens: long (Required)
+     *         prompt_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_prompt_tokens: Integer (Required)
+     *     max_completion_tokens: Integer (Required)
+     *     truncation_strategy (Required): {
+     *         type: String(auto/last_messages) (Required)
+     *         last_messages: Integer (Optional)
+     *     }
+     *     tool_choice: BinaryData (Required)
+     *     response_format: BinaryData (Required)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
      * }
      * }
* - * @param assistantId The ID of the assistant from which the specified file should be unlinked. - * @param fileId The ID of the file to unlink from the specified assistant. + * @param threadId The ID of the thread to run. + * @param createRunOptions The details for the run to create. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the status of an assistant file deletion operation along with {@link Response}. + * @return data representing a single evaluation run of an assistant thread along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAssistantFileWithResponse(String assistantId, String fileId, + public Mono> createRunWithResponseAsync(String threadId, BinaryData createRunOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return service.deleteAssistantFileSync(this.getEndpoint(), assistantId, fileId, accept, requestOptions, - Context.NONE); + return FluxUtil.withContext(context -> service.createRun(this.getEndpoint(), threadId, accept, createRunOptions, + requestOptions, context)); } /** - * Creates a new thread. Threads contain messages and can be run by assistants. + * Creates a new run for an assistant thread. *

Request Body Schema

* *
{@code
      * {
-     *     messages (Optional): [
+     *     assistant_id: String (Required)
+     *     model: String (Optional)
+     *     instructions: String (Optional)
+     *     additional_instructions: String (Optional)
+     *     additional_messages (Optional): [
      *          (Optional){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             created_at: long (Required)
+     *             thread_id: String (Required)
+     *             status: String(in_progress/incomplete/completed) (Required)
+     *             incomplete_details (Required): {
+     *                 reason: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required)
+     *             }
+     *             completed_at: Long (Required)
+     *             incomplete_at: Long (Required)
      *             role: String(user/assistant) (Required)
-     *             content: String (Required)
-     *             file_ids (Optional): [
-     *                 String (Optional)
+     *             content (Required): [
+     *                  (Required){
+     *                     type: String (Required)
+     *                 }
      *             ]
-     *             metadata (Optional): {
+     *             assistant_id: String (Required)
+     *             run_id: String (Required)
+     *             attachments (Required): [
+     *                  (Required){
+     *                     file_id: String (Required)
+     *                     tools (Required): [
+     *                         BinaryData (Required)
+     *                     ]
+     *                 }
+     *             ]
+     *             metadata (Required): {
      *                 String: String (Required)
      *             }
      *         }
      *     ]
+     *     tools (Optional): [
+     *          (Optional){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     stream: Boolean (Optional)
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_prompt_tokens: Integer (Optional)
+     *     max_completion_tokens: Integer (Optional)
+     *     truncation_strategy (Optional): {
+     *         type: String(auto/last_messages) (Required)
+     *         last_messages: Integer (Optional)
+     *     }
+     *     tool_choice: BinaryData (Optional)
+     *     response_format: BinaryData (Optional)
      *     metadata (Optional): {
      *         String: String (Required)
      *     }
@@ -1691,145 +2817,395 @@ public Response deleteAssistantFileWithResponse(String assistantId,
      * {
      *     id: String (Required)
      *     object: String (Required)
+     *     thread_id: String (Required)
+     *     assistant_id: String (Required)
+     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
+     *     required_action (Optional): {
+     *         type: String (Required)
+     *     }
+     *     last_error (Required): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
      *     created_at: long (Required)
+     *     expires_at: Long (Required)
+     *     started_at: Long (Required)
+     *     completed_at: Long (Required)
+     *     cancelled_at: Long (Required)
+     *     failed_at: Long (Required)
+     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
+     *     usage (Required): {
+     *         completion_tokens: long (Required)
+     *         prompt_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_prompt_tokens: Integer (Required)
+     *     max_completion_tokens: Integer (Required)
+     *     truncation_strategy (Required): {
+     *         type: String(auto/last_messages) (Required)
+     *         last_messages: Integer (Optional)
+     *     }
+     *     tool_choice: BinaryData (Required)
+     *     response_format: BinaryData (Required)
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param assistantThreadCreationOptions The details used to create a new assistant thread. + * @param threadId The ID of the thread to run. + * @param createRunOptions The details for the run to create. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return information about a single thread associated with an assistant along with {@link Response} on successful - * completion of {@link Mono}. + * @return data representing a single evaluation run of an assistant thread along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createThreadWithResponseAsync(BinaryData assistantThreadCreationOptions, + public Response createRunWithResponse(String threadId, BinaryData createRunOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createThread(this.getEndpoint(), accept, - assistantThreadCreationOptions, requestOptions, context)); + return service.createRunSync(this.getEndpoint(), threadId, accept, createRunOptions, requestOptions, + Context.NONE); } /** - * Creates a new thread. Threads contain messages and can be run by assistants. - *

Request Body Schema

+ * Gets a list of runs for a specified thread. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for + * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the + * list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

* *
{@code
      * {
-     *     messages (Optional): [
-     *          (Optional){
-     *             role: String(user/assistant) (Required)
-     *             content: String (Required)
-     *             file_ids (Optional): [
-     *                 String (Optional)
+     *     object: String (Required)
+     *     data (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             thread_id: String (Required)
+     *             assistant_id: String (Required)
+     *             status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
+     *             required_action (Optional): {
+     *                 type: String (Required)
+     *             }
+     *             last_error (Required): {
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *             model: String (Required)
+     *             instructions: String (Required)
+     *             tools (Required): [
+     *                  (Required){
+     *                     type: String (Required)
+     *                 }
      *             ]
-     *             metadata (Optional): {
+     *             created_at: long (Required)
+     *             expires_at: Long (Required)
+     *             started_at: Long (Required)
+     *             completed_at: Long (Required)
+     *             cancelled_at: Long (Required)
+     *             failed_at: Long (Required)
+     *             incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
+     *             usage (Required): {
+     *                 completion_tokens: long (Required)
+     *                 prompt_tokens: long (Required)
+     *                 total_tokens: long (Required)
+     *             }
+     *             temperature: Double (Optional)
+     *             top_p: Double (Optional)
+     *             max_prompt_tokens: Integer (Required)
+     *             max_completion_tokens: Integer (Required)
+     *             truncation_strategy (Required): {
+     *                 type: String(auto/last_messages) (Required)
+     *                 last_messages: Integer (Optional)
+     *             }
+     *             tool_choice: BinaryData (Required)
+     *             response_format: BinaryData (Required)
+     *             metadata (Required): {
      *                 String: String (Required)
      *             }
      *         }
      *     ]
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     first_id: String (Required)
+     *     last_id: String (Required)
+     *     has_more: boolean (Required)
      * }
      * }
* + * @param threadId The ID of the thread to list runs from. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of runs for a specified thread along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listRunsWithResponseAsync(String threadId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listRuns(this.getEndpoint(), threadId, accept, requestOptions, context)); + } + + /** + * Gets a list of runs for a specified thread. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for + * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the + * list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
{@code
      * {
-     *     id: String (Required)
      *     object: String (Required)
-     *     created_at: long (Required)
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
+     *     data (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             thread_id: String (Required)
+     *             assistant_id: String (Required)
+     *             status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
+     *             required_action (Optional): {
+     *                 type: String (Required)
+     *             }
+     *             last_error (Required): {
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *             model: String (Required)
+     *             instructions: String (Required)
+     *             tools (Required): [
+     *                  (Required){
+     *                     type: String (Required)
+     *                 }
+     *             ]
+     *             created_at: long (Required)
+     *             expires_at: Long (Required)
+     *             started_at: Long (Required)
+     *             completed_at: Long (Required)
+     *             cancelled_at: Long (Required)
+     *             failed_at: Long (Required)
+     *             incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
+     *             usage (Required): {
+     *                 completion_tokens: long (Required)
+     *                 prompt_tokens: long (Required)
+     *                 total_tokens: long (Required)
+     *             }
+     *             temperature: Double (Optional)
+     *             top_p: Double (Optional)
+     *             max_prompt_tokens: Integer (Required)
+     *             max_completion_tokens: Integer (Required)
+     *             truncation_strategy (Required): {
+     *                 type: String(auto/last_messages) (Required)
+     *                 last_messages: Integer (Optional)
+     *             }
+     *             tool_choice: BinaryData (Required)
+     *             response_format: BinaryData (Required)
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Required)
+     *     last_id: String (Required)
+     *     has_more: boolean (Required)
      * }
      * }
* - * @param assistantThreadCreationOptions The details used to create a new assistant thread. + * @param threadId The ID of the thread to list runs from. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return information about a single thread associated with an assistant along with {@link Response}. + * @return a list of runs for a specified thread along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createThreadWithResponse(BinaryData assistantThreadCreationOptions, - RequestOptions requestOptions) { + public Response listRunsWithResponse(String threadId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.createThreadSync(this.getEndpoint(), accept, assistantThreadCreationOptions, requestOptions, - Context.NONE); + return service.listRunsSync(this.getEndpoint(), threadId, accept, requestOptions, Context.NONE); } /** - * Gets information about an existing thread. + * Gets an existing run from an existing thread. *

Response Body Schema

* *
{@code
      * {
      *     id: String (Required)
      *     object: String (Required)
+     *     thread_id: String (Required)
+     *     assistant_id: String (Required)
+     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
+     *     required_action (Optional): {
+     *         type: String (Required)
+     *     }
+     *     last_error (Required): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
      *     created_at: long (Required)
+     *     expires_at: Long (Required)
+     *     started_at: Long (Required)
+     *     completed_at: Long (Required)
+     *     cancelled_at: Long (Required)
+     *     failed_at: Long (Required)
+     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
+     *     usage (Required): {
+     *         completion_tokens: long (Required)
+     *         prompt_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_prompt_tokens: Integer (Required)
+     *     max_completion_tokens: Integer (Required)
+     *     truncation_strategy (Required): {
+     *         type: String(auto/last_messages) (Required)
+     *         last_messages: Integer (Optional)
+     *     }
+     *     tool_choice: BinaryData (Required)
+     *     response_format: BinaryData (Required)
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param threadId The ID of the thread to retrieve information about. + * @param threadId The ID of the thread to retrieve run information from. + * @param runId The ID of the thread to retrieve information about. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return information about an existing thread along with {@link Response} on successful completion of + * @return an existing run from an existing thread along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getThreadWithResponseAsync(String threadId, RequestOptions requestOptions) { + public Mono> getRunWithResponseAsync(String threadId, String runId, + RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getThread(this.getEndpoint(), threadId, accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getRun(this.getEndpoint(), threadId, runId, accept, requestOptions, context)); } /** - * Gets information about an existing thread. + * Gets an existing run from an existing thread. *

Response Body Schema

* *
{@code
      * {
      *     id: String (Required)
      *     object: String (Required)
+     *     thread_id: String (Required)
+     *     assistant_id: String (Required)
+     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
+     *     required_action (Optional): {
+     *         type: String (Required)
+     *     }
+     *     last_error (Required): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
      *     created_at: long (Required)
+     *     expires_at: Long (Required)
+     *     started_at: Long (Required)
+     *     completed_at: Long (Required)
+     *     cancelled_at: Long (Required)
+     *     failed_at: Long (Required)
+     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
+     *     usage (Required): {
+     *         completion_tokens: long (Required)
+     *         prompt_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_prompt_tokens: Integer (Required)
+     *     max_completion_tokens: Integer (Required)
+     *     truncation_strategy (Required): {
+     *         type: String(auto/last_messages) (Required)
+     *         last_messages: Integer (Optional)
+     *     }
+     *     tool_choice: BinaryData (Required)
+     *     response_format: BinaryData (Required)
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param threadId The ID of the thread to retrieve information about. + * @param threadId The ID of the thread to retrieve run information from. + * @param runId The ID of the thread to retrieve information about. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return information about an existing thread along with {@link Response}. + * @return an existing run from an existing thread along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getThreadWithResponse(String threadId, RequestOptions requestOptions) { + public Response getRunWithResponse(String threadId, String runId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getThreadSync(this.getEndpoint(), threadId, accept, requestOptions, Context.NONE); + return service.getRunSync(this.getEndpoint(), threadId, runId, accept, requestOptions, Context.NONE); } /** - * Modifies an existing thread. + * Modifies an existing thread run. *

Request Body Schema

* *
{@code
@@ -1846,33 +3222,72 @@ public Response getThreadWithResponse(String threadId, RequestOption
      * {
      *     id: String (Required)
      *     object: String (Required)
+     *     thread_id: String (Required)
+     *     assistant_id: String (Required)
+     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
+     *     required_action (Optional): {
+     *         type: String (Required)
+     *     }
+     *     last_error (Required): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
      *     created_at: long (Required)
+     *     expires_at: Long (Required)
+     *     started_at: Long (Required)
+     *     completed_at: Long (Required)
+     *     cancelled_at: Long (Required)
+     *     failed_at: Long (Required)
+     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
+     *     usage (Required): {
+     *         completion_tokens: long (Required)
+     *         prompt_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_prompt_tokens: Integer (Required)
+     *     max_completion_tokens: Integer (Required)
+     *     truncation_strategy (Required): {
+     *         type: String(auto/last_messages) (Required)
+     *         last_messages: Integer (Optional)
+     *     }
+     *     tool_choice: BinaryData (Required)
+     *     response_format: BinaryData (Required)
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param threadId The ID of the thread to modify. + * @param threadId The ID of the thread associated with the specified run. + * @param runId The ID of the run to modify. * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return information about a single thread associated with an assistant along with {@link Response} on successful - * completion of {@link Mono}. + * @return data representing a single evaluation run of an assistant thread along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateThreadWithResponseAsync(String threadId, BinaryData request, + public Mono> updateRunWithResponseAsync(String threadId, String runId, BinaryData request, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.updateThread(this.getEndpoint(), threadId, accept, request, requestOptions, context)); + return FluxUtil.withContext(context -> service.updateRun(this.getEndpoint(), threadId, runId, accept, request, + requestOptions, context)); } /** - * Modifies an existing thread. + * Modifies an existing thread run. *

Request Body Schema

* *
{@code
@@ -1889,97 +3304,83 @@ public Mono> updateThreadWithResponseAsync(String threadId,
      * {
      *     id: String (Required)
      *     object: String (Required)
+     *     thread_id: String (Required)
+     *     assistant_id: String (Required)
+     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
+     *     required_action (Optional): {
+     *         type: String (Required)
+     *     }
+     *     last_error (Required): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
+     *          (Required){
+     *             type: String (Required)
+     *         }
+     *     ]
      *     created_at: long (Required)
+     *     expires_at: Long (Required)
+     *     started_at: Long (Required)
+     *     completed_at: Long (Required)
+     *     cancelled_at: Long (Required)
+     *     failed_at: Long (Required)
+     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
+     *     usage (Required): {
+     *         completion_tokens: long (Required)
+     *         prompt_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_prompt_tokens: Integer (Required)
+     *     max_completion_tokens: Integer (Required)
+     *     truncation_strategy (Required): {
+     *         type: String(auto/last_messages) (Required)
+     *         last_messages: Integer (Optional)
+     *     }
+     *     tool_choice: BinaryData (Required)
+     *     response_format: BinaryData (Required)
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param threadId The ID of the thread to modify. + * @param threadId The ID of the thread associated with the specified run. + * @param runId The ID of the run to modify. * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return information about a single thread associated with an assistant along with {@link Response}. + * @return data representing a single evaluation run of an assistant thread along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateThreadWithResponse(String threadId, BinaryData request, + public Response updateRunWithResponse(String threadId, String runId, BinaryData request, RequestOptions requestOptions) { final String accept = "application/json"; - return service.updateThreadSync(this.getEndpoint(), threadId, accept, request, requestOptions, Context.NONE); - } - - /** - * Deletes an existing thread. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     deleted: boolean (Required)
-     *     object: String (Required)
-     * }
-     * }
- * - * @param threadId The ID of the thread to delete. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the status of a thread deletion operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteThreadWithResponseAsync(String threadId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteThread(this.getEndpoint(), threadId, accept, requestOptions, context)); - } - - /** - * Deletes an existing thread. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     deleted: boolean (Required)
-     *     object: String (Required)
-     * }
-     * }
- * - * @param threadId The ID of the thread to delete. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the status of a thread deletion operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteThreadWithResponse(String threadId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteThreadSync(this.getEndpoint(), threadId, accept, requestOptions, Context.NONE); + return service.updateRunSync(this.getEndpoint(), threadId, runId, accept, request, requestOptions, + Context.NONE); } /** - * Creates a new message on a specified thread. + * Submits outputs from tools as requested by tool calls in a run. Runs that need submitted tool outputs will have a + * status of 'requires_action' with a required_action.type of 'submit_tool_outputs'. *

Request Body Schema

* *
{@code
      * {
-     *     role: String(user/assistant) (Required)
-     *     content: String (Required)
-     *     file_ids (Optional): [
-     *         String (Optional)
+     *     tool_outputs (Required): [
+     *          (Required){
+     *             tool_call_id: String (Optional)
+     *             output: String (Optional)
+     *         }
      *     ]
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     stream: Boolean (Optional)
      * }
      * }
* @@ -1989,61 +3390,84 @@ public Response deleteThreadWithResponse(String threadId, RequestOpt * { * id: String (Required) * object: String (Required) - * created_at: long (Required) * thread_id: String (Required) - * status: String(in_progress/incomplete/completed) (Required) - * incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required) - * completed_at: Long (Required) - * incomplete_at: Long (Required) - * role: String(user/assistant) (Required) - * content (Required): [ + * assistant_id: String (Required) + * status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required) + * required_action (Optional): { + * type: String (Required) + * } + * last_error (Required): { + * code: String (Required) + * message: String (Required) + * } + * model: String (Required) + * instructions: String (Required) + * tools (Required): [ * (Required){ * type: String (Required) * } * ] - * assistant_id: String (Optional) - * run_id: String (Optional) - * file_ids (Required): [ - * String (Required) - * ] + * created_at: long (Required) + * expires_at: Long (Required) + * started_at: Long (Required) + * completed_at: Long (Required) + * cancelled_at: Long (Required) + * failed_at: Long (Required) + * incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required) + * usage (Required): { + * completion_tokens: long (Required) + * prompt_tokens: long (Required) + * total_tokens: long (Required) + * } + * temperature: Double (Optional) + * top_p: Double (Optional) + * max_prompt_tokens: Integer (Required) + * max_completion_tokens: Integer (Required) + * truncation_strategy (Required): { + * type: String(auto/last_messages) (Required) + * last_messages: Integer (Optional) + * } + * tool_choice: BinaryData (Required) + * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) * } * } * } * - * @param threadId The ID of the thread to create the new message on. + * @param threadId The ID of the thread that was run. + * @param runId The ID of the run that requires tool outputs. * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a single, existing message within an assistant thread along with {@link Response} on successful - * completion of {@link Mono}. + * @return data representing a single evaluation run of an assistant thread along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createMessageWithResponseAsync(String threadId, BinaryData request, - RequestOptions requestOptions) { + public Mono> submitToolOutputsToRunWithResponseAsync(String threadId, String runId, + BinaryData request, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.createMessage(this.getEndpoint(), threadId, accept, request, requestOptions, context)); + return FluxUtil.withContext(context -> service.submitToolOutputsToRun(this.getEndpoint(), threadId, runId, + accept, request, requestOptions, context)); } /** - * Creates a new message on a specified thread. + * Submits outputs from tools as requested by tool calls in a run. Runs that need submitted tool outputs will have a + * status of 'requires_action' with a required_action.type of 'submit_tool_outputs'. *

Request Body Schema

* *
{@code
      * {
-     *     role: String(user/assistant) (Required)
-     *     content: String (Required)
-     *     file_ids (Optional): [
-     *         String (Optional)
+     *     tool_outputs (Required): [
+     *          (Required){
+     *             tool_call_id: String (Optional)
+     *             output: String (Optional)
+     *         }
      *     ]
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     stream: Boolean (Optional)
      * }
      * }
* @@ -2053,404 +3477,599 @@ public Mono> createMessageWithResponseAsync(String threadId * { * id: String (Required) * object: String (Required) - * created_at: long (Required) * thread_id: String (Required) - * status: String(in_progress/incomplete/completed) (Required) - * incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required) - * completed_at: Long (Required) - * incomplete_at: Long (Required) - * role: String(user/assistant) (Required) - * content (Required): [ + * assistant_id: String (Required) + * status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required) + * required_action (Optional): { + * type: String (Required) + * } + * last_error (Required): { + * code: String (Required) + * message: String (Required) + * } + * model: String (Required) + * instructions: String (Required) + * tools (Required): [ * (Required){ * type: String (Required) * } * ] - * assistant_id: String (Optional) - * run_id: String (Optional) - * file_ids (Required): [ - * String (Required) - * ] + * created_at: long (Required) + * expires_at: Long (Required) + * started_at: Long (Required) + * completed_at: Long (Required) + * cancelled_at: Long (Required) + * failed_at: Long (Required) + * incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required) + * usage (Required): { + * completion_tokens: long (Required) + * prompt_tokens: long (Required) + * total_tokens: long (Required) + * } + * temperature: Double (Optional) + * top_p: Double (Optional) + * max_prompt_tokens: Integer (Required) + * max_completion_tokens: Integer (Required) + * truncation_strategy (Required): { + * type: String(auto/last_messages) (Required) + * last_messages: Integer (Optional) + * } + * tool_choice: BinaryData (Required) + * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) * } * } * } * - * @param threadId The ID of the thread to create the new message on. + * @param threadId The ID of the thread that was run. + * @param runId The ID of the run that requires tool outputs. * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a single, existing message within an assistant thread along with {@link Response}. + * @return data representing a single evaluation run of an assistant thread along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createMessageWithResponse(String threadId, BinaryData request, + public Response submitToolOutputsToRunWithResponse(String threadId, String runId, BinaryData request, RequestOptions requestOptions) { final String accept = "application/json"; - return service.createMessageSync(this.getEndpoint(), threadId, accept, request, requestOptions, Context.NONE); + return service.submitToolOutputsToRunSync(this.getEndpoint(), threadId, runId, accept, request, requestOptions, + Context.NONE); } /** - * Gets a list of messages that exist on a thread. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for - * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with - * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with - * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the - * list.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Cancels a run of an in progress thread. *

Response Body Schema

* *
{@code
      * {
+     *     id: String (Required)
      *     object: String (Required)
-     *     data (Required): [
+     *     thread_id: String (Required)
+     *     assistant_id: String (Required)
+     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
+     *     required_action (Optional): {
+     *         type: String (Required)
+     *     }
+     *     last_error (Required): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
      *          (Required){
-     *             id: String (Required)
-     *             object: String (Required)
-     *             created_at: long (Required)
-     *             thread_id: String (Required)
-     *             status: String(in_progress/incomplete/completed) (Required)
-     *             incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required)
-     *             completed_at: Long (Required)
-     *             incomplete_at: Long (Required)
-     *             role: String(user/assistant) (Required)
-     *             content (Required): [
-     *                  (Required){
-     *                     type: String (Required)
-     *                 }
-     *             ]
-     *             assistant_id: String (Optional)
-     *             run_id: String (Optional)
-     *             file_ids (Required): [
-     *                 String (Required)
-     *             ]
-     *             metadata (Required): {
-     *                 String: String (Required)
-     *             }
+     *             type: String (Required)
      *         }
      *     ]
-     *     first_id: String (Required)
-     *     last_id: String (Required)
-     *     has_more: boolean (Required)
+     *     created_at: long (Required)
+     *     expires_at: Long (Required)
+     *     started_at: Long (Required)
+     *     completed_at: Long (Required)
+     *     cancelled_at: Long (Required)
+     *     failed_at: Long (Required)
+     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
+     *     usage (Required): {
+     *         completion_tokens: long (Required)
+     *         prompt_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_prompt_tokens: Integer (Required)
+     *     max_completion_tokens: Integer (Required)
+     *     truncation_strategy (Required): {
+     *         type: String(auto/last_messages) (Required)
+     *         last_messages: Integer (Optional)
+     *     }
+     *     tool_choice: BinaryData (Required)
+     *     response_format: BinaryData (Required)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
      * }
      * }
* - * @param threadId The ID of the thread to list messages from. + * @param threadId The ID of the thread being run. + * @param runId The ID of the run to cancel. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of messages that exist on a thread along with {@link Response} on successful completion of - * {@link Mono}. + * @return data representing a single evaluation run of an assistant thread along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listMessagesWithResponseAsync(String threadId, RequestOptions requestOptions) { + public Mono> cancelRunWithResponseAsync(String threadId, String runId, + RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( - context -> service.listMessages(this.getEndpoint(), threadId, accept, requestOptions, context)); + context -> service.cancelRun(this.getEndpoint(), threadId, runId, accept, requestOptions, context)); } /** - * Gets a list of messages that exist on a thread. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for - * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with - * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with - * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the - * list.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Cancels a run of an in progress thread. *

Response Body Schema

* *
{@code
      * {
+     *     id: String (Required)
      *     object: String (Required)
-     *     data (Required): [
+     *     thread_id: String (Required)
+     *     assistant_id: String (Required)
+     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
+     *     required_action (Optional): {
+     *         type: String (Required)
+     *     }
+     *     last_error (Required): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
      *          (Required){
-     *             id: String (Required)
-     *             object: String (Required)
-     *             created_at: long (Required)
-     *             thread_id: String (Required)
-     *             status: String(in_progress/incomplete/completed) (Required)
-     *             incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required)
-     *             completed_at: Long (Required)
-     *             incomplete_at: Long (Required)
-     *             role: String(user/assistant) (Required)
-     *             content (Required): [
-     *                  (Required){
-     *                     type: String (Required)
-     *                 }
-     *             ]
-     *             assistant_id: String (Optional)
-     *             run_id: String (Optional)
-     *             file_ids (Required): [
-     *                 String (Required)
-     *             ]
-     *             metadata (Required): {
-     *                 String: String (Required)
-     *             }
+     *             type: String (Required)
      *         }
      *     ]
-     *     first_id: String (Required)
-     *     last_id: String (Required)
-     *     has_more: boolean (Required)
+     *     created_at: long (Required)
+     *     expires_at: Long (Required)
+     *     started_at: Long (Required)
+     *     completed_at: Long (Required)
+     *     cancelled_at: Long (Required)
+     *     failed_at: Long (Required)
+     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
+     *     usage (Required): {
+     *         completion_tokens: long (Required)
+     *         prompt_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_prompt_tokens: Integer (Required)
+     *     max_completion_tokens: Integer (Required)
+     *     truncation_strategy (Required): {
+     *         type: String(auto/last_messages) (Required)
+     *         last_messages: Integer (Optional)
+     *     }
+     *     tool_choice: BinaryData (Required)
+     *     response_format: BinaryData (Required)
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
      * }
      * }
* - * @param threadId The ID of the thread to list messages from. + * @param threadId The ID of the thread being run. + * @param runId The ID of the run to cancel. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of messages that exist on a thread along with {@link Response}. + * @return data representing a single evaluation run of an assistant thread along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listMessagesWithResponse(String threadId, RequestOptions requestOptions) { + public Response cancelRunWithResponse(String threadId, String runId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.listMessagesSync(this.getEndpoint(), threadId, accept, requestOptions, Context.NONE); + return service.cancelRunSync(this.getEndpoint(), threadId, runId, accept, requestOptions, Context.NONE); } /** - * Gets an existing message from an existing thread. + * Creates a new assistant thread and immediately starts a run using that new thread. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     assistant_id: String (Required)
+     *     thread (Optional): {
+     *         messages (Optional): [
+     *              (Optional){
+     *                 role: String(user/assistant) (Required)
+     *                 content: String (Required)
+     *                 attachments (Optional): [
+     *                      (Optional){
+     *                         file_id: String (Required)
+     *                         tools (Required): [
+     *                             BinaryData (Required)
+     *                         ]
+     *                     }
+     *                 ]
+     *                 metadata (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *             }
+     *         ]
+     *         tool_resources (Optional): {
+     *             code_interpreter (Optional): {
+     *                 file_ids (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *             file_search: BinaryData (Optional)
+     *         }
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *     }
+     *     model: String (Optional)
+     *     instructions: String (Optional)
+     *     tools (Optional): [
+     *          (Optional){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_resources (Optional): {
+     *         code_interpreter (Optional): {
+     *             fileIds (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
+     *     stream: Boolean (Optional)
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_prompt_tokens: Integer (Optional)
+     *     max_completion_tokens: Integer (Optional)
+     *     truncation_strategy (Optional): {
+     *         type: String(auto/last_messages) (Required)
+     *         last_messages: Integer (Optional)
+     *     }
+     *     tool_choice: BinaryData (Optional)
+     *     response_format: BinaryData (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * *

Response Body Schema

* *
{@code
      * {
      *     id: String (Required)
      *     object: String (Required)
-     *     created_at: long (Required)
      *     thread_id: String (Required)
-     *     status: String(in_progress/incomplete/completed) (Required)
-     *     incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required)
-     *     completed_at: Long (Required)
-     *     incomplete_at: Long (Required)
-     *     role: String(user/assistant) (Required)
-     *     content (Required): [
+     *     assistant_id: String (Required)
+     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
+     *     required_action (Optional): {
+     *         type: String (Required)
+     *     }
+     *     last_error (Required): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
      *          (Required){
      *             type: String (Required)
      *         }
      *     ]
-     *     assistant_id: String (Optional)
-     *     run_id: String (Optional)
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
+     *     created_at: long (Required)
+     *     expires_at: Long (Required)
+     *     started_at: Long (Required)
+     *     completed_at: Long (Required)
+     *     cancelled_at: Long (Required)
+     *     failed_at: Long (Required)
+     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
+     *     usage (Required): {
+     *         completion_tokens: long (Required)
+     *         prompt_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_prompt_tokens: Integer (Required)
+     *     max_completion_tokens: Integer (Required)
+     *     truncation_strategy (Required): {
+     *         type: String(auto/last_messages) (Required)
+     *         last_messages: Integer (Optional)
+     *     }
+     *     tool_choice: BinaryData (Required)
+     *     response_format: BinaryData (Required)
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param threadId The ID of the thread to retrieve the specified message from. - * @param messageId The ID of the message to retrieve from the specified thread. + * @param createAndRunThreadOptions The details used when creating and immediately running a new assistant thread. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return an existing message from an existing thread along with {@link Response} on successful completion of - * {@link Mono}. + * @return data representing a single evaluation run of an assistant thread along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMessageWithResponseAsync(String threadId, String messageId, + public Mono> createThreadAndRunWithResponseAsync(BinaryData createAndRunThreadOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getMessage(this.getEndpoint(), threadId, messageId, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.createThreadAndRun(this.getEndpoint(), accept, + createAndRunThreadOptions, requestOptions, context)); } /** - * Gets an existing message from an existing thread. + * Creates a new assistant thread and immediately starts a run using that new thread. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     assistant_id: String (Required)
+     *     thread (Optional): {
+     *         messages (Optional): [
+     *              (Optional){
+     *                 role: String(user/assistant) (Required)
+     *                 content: String (Required)
+     *                 attachments (Optional): [
+     *                      (Optional){
+     *                         file_id: String (Required)
+     *                         tools (Required): [
+     *                             BinaryData (Required)
+     *                         ]
+     *                     }
+     *                 ]
+     *                 metadata (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *             }
+     *         ]
+     *         tool_resources (Optional): {
+     *             code_interpreter (Optional): {
+     *                 file_ids (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *             file_search: BinaryData (Optional)
+     *         }
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *     }
+     *     model: String (Optional)
+     *     instructions: String (Optional)
+     *     tools (Optional): [
+     *          (Optional){
+     *             type: String (Required)
+     *         }
+     *     ]
+     *     tool_resources (Optional): {
+     *         code_interpreter (Optional): {
+     *             fileIds (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *         file_search (Optional): {
+     *             vector_store_ids (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     }
+     *     stream: Boolean (Optional)
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_prompt_tokens: Integer (Optional)
+     *     max_completion_tokens: Integer (Optional)
+     *     truncation_strategy (Optional): {
+     *         type: String(auto/last_messages) (Required)
+     *         last_messages: Integer (Optional)
+     *     }
+     *     tool_choice: BinaryData (Optional)
+     *     response_format: BinaryData (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * *

Response Body Schema

* *
{@code
      * {
      *     id: String (Required)
      *     object: String (Required)
-     *     created_at: long (Required)
      *     thread_id: String (Required)
-     *     status: String(in_progress/incomplete/completed) (Required)
-     *     incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required)
-     *     completed_at: Long (Required)
-     *     incomplete_at: Long (Required)
-     *     role: String(user/assistant) (Required)
-     *     content (Required): [
+     *     assistant_id: String (Required)
+     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
+     *     required_action (Optional): {
+     *         type: String (Required)
+     *     }
+     *     last_error (Required): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     *     model: String (Required)
+     *     instructions: String (Required)
+     *     tools (Required): [
      *          (Required){
      *             type: String (Required)
      *         }
      *     ]
-     *     assistant_id: String (Optional)
-     *     run_id: String (Optional)
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
+     *     created_at: long (Required)
+     *     expires_at: Long (Required)
+     *     started_at: Long (Required)
+     *     completed_at: Long (Required)
+     *     cancelled_at: Long (Required)
+     *     failed_at: Long (Required)
+     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
+     *     usage (Required): {
+     *         completion_tokens: long (Required)
+     *         prompt_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     max_prompt_tokens: Integer (Required)
+     *     max_completion_tokens: Integer (Required)
+     *     truncation_strategy (Required): {
+     *         type: String(auto/last_messages) (Required)
+     *         last_messages: Integer (Optional)
+     *     }
+     *     tool_choice: BinaryData (Required)
+     *     response_format: BinaryData (Required)
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param threadId The ID of the thread to retrieve the specified message from. - * @param messageId The ID of the message to retrieve from the specified thread. + * @param createAndRunThreadOptions The details used when creating and immediately running a new assistant thread. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return an existing message from an existing thread along with {@link Response}. + * @return data representing a single evaluation run of an assistant thread along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMessageWithResponse(String threadId, String messageId, + public Response createThreadAndRunWithResponse(BinaryData createAndRunThreadOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getMessageSync(this.getEndpoint(), threadId, messageId, accept, requestOptions, Context.NONE); + return service.createThreadAndRunSync(this.getEndpoint(), accept, createAndRunThreadOptions, requestOptions, + Context.NONE); } /** - * Modifies an existing message on an existing thread. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * + * Gets a single run step from a thread run. *

Response Body Schema

* *
{@code
      * {
      *     id: String (Required)
      *     object: String (Required)
-     *     created_at: long (Required)
+     *     type: String(message_creation/tool_calls) (Required)
+     *     assistant_id: String (Required)
      *     thread_id: String (Required)
-     *     status: String(in_progress/incomplete/completed) (Required)
-     *     incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required)
+     *     run_id: String (Required)
+     *     status: String(in_progress/cancelled/failed/completed/expired) (Required)
+     *     step_details (Required): {
+     *         type: String(message_creation/tool_calls) (Required)
+     *     }
+     *     last_error (Required): {
+     *         code: String(server_error/rate_limit_exceeded) (Required)
+     *         message: String (Required)
+     *     }
+     *     created_at: long (Required)
+     *     expired_at: Long (Required)
      *     completed_at: Long (Required)
-     *     incomplete_at: Long (Required)
-     *     role: String(user/assistant) (Required)
-     *     content (Required): [
-     *          (Required){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     assistant_id: String (Optional)
-     *     run_id: String (Optional)
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
+     *     cancelled_at: Long (Required)
+     *     failed_at: Long (Required)
+     *     usage (Optional): {
+     *         completion_tokens: long (Required)
+     *         prompt_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param threadId The ID of the thread containing the specified message to modify. - * @param messageId The ID of the message to modify on the specified thread. - * @param request The request parameter. + * @param threadId The ID of the thread that was run. + * @param runId The ID of the specific run to retrieve the step from. + * @param stepId The ID of the step to retrieve information about. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a single, existing message within an assistant thread along with {@link Response} on successful - * completion of {@link Mono}. + * @return a single run step from a thread run along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateMessageWithResponseAsync(String threadId, String messageId, - BinaryData request, RequestOptions requestOptions) { + public Mono> getRunStepWithResponseAsync(String threadId, String runId, String stepId, + RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateMessage(this.getEndpoint(), threadId, messageId, accept, - request, requestOptions, context)); + return FluxUtil.withContext(context -> service.getRunStep(this.getEndpoint(), threadId, runId, stepId, accept, + requestOptions, context)); } /** - * Modifies an existing message on an existing thread. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * + * Gets a single run step from a thread run. *

Response Body Schema

* *
{@code
      * {
      *     id: String (Required)
      *     object: String (Required)
-     *     created_at: long (Required)
+     *     type: String(message_creation/tool_calls) (Required)
+     *     assistant_id: String (Required)
      *     thread_id: String (Required)
-     *     status: String(in_progress/incomplete/completed) (Required)
-     *     incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed/run_expired) (Required)
+     *     run_id: String (Required)
+     *     status: String(in_progress/cancelled/failed/completed/expired) (Required)
+     *     step_details (Required): {
+     *         type: String(message_creation/tool_calls) (Required)
+     *     }
+     *     last_error (Required): {
+     *         code: String(server_error/rate_limit_exceeded) (Required)
+     *         message: String (Required)
+     *     }
+     *     created_at: long (Required)
+     *     expired_at: Long (Required)
      *     completed_at: Long (Required)
-     *     incomplete_at: Long (Required)
-     *     role: String(user/assistant) (Required)
-     *     content (Required): [
-     *          (Required){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     assistant_id: String (Optional)
-     *     run_id: String (Optional)
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
+     *     cancelled_at: Long (Required)
+     *     failed_at: Long (Required)
+     *     usage (Optional): {
+     *         completion_tokens: long (Required)
+     *         prompt_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param threadId The ID of the thread containing the specified message to modify. - * @param messageId The ID of the message to modify on the specified thread. - * @param request The request parameter. + * @param threadId The ID of the thread that was run. + * @param runId The ID of the specific run to retrieve the step from. + * @param stepId The ID of the step to retrieve information about. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a single, existing message within an assistant thread along with {@link Response}. + * @return a single run step from a thread run along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateMessageWithResponse(String threadId, String messageId, BinaryData request, + public Response getRunStepWithResponse(String threadId, String runId, String stepId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.updateMessageSync(this.getEndpoint(), threadId, messageId, accept, request, requestOptions, + return service.getRunStepSync(this.getEndpoint(), threadId, runId, stepId, accept, requestOptions, Context.NONE); } /** - * Gets a list of previously uploaded files associated with a message from a thread. + * Gets a list of run steps from a thread run. *

Query Parameters

* * @@ -2477,8 +4096,31 @@ public Response updateMessageWithResponse(String threadId, String me * (Required){ * id: String (Required) * object: String (Required) + * type: String(message_creation/tool_calls) (Required) + * assistant_id: String (Required) + * thread_id: String (Required) + * run_id: String (Required) + * status: String(in_progress/cancelled/failed/completed/expired) (Required) + * step_details (Required): { + * type: String(message_creation/tool_calls) (Required) + * } + * last_error (Required): { + * code: String(server_error/rate_limit_exceeded) (Required) + * message: String (Required) + * } * created_at: long (Required) - * message_id: String (Required) + * expired_at: Long (Required) + * completed_at: Long (Required) + * cancelled_at: Long (Required) + * failed_at: Long (Required) + * usage (Optional): { + * completion_tokens: long (Required) + * prompt_tokens: long (Required) + * total_tokens: long (Required) + * } + * metadata (Required): { + * String: String (Required) + * } * } * ] * first_id: String (Required) @@ -2487,26 +4129,26 @@ public Response updateMessageWithResponse(String threadId, String me * } * } * - * @param threadId The ID of the thread containing the message to list files from. - * @param messageId The ID of the message to list files from. + * @param threadId The ID of the thread that was run. + * @param runId The ID of the run to list steps from. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of previously uploaded files associated with a message from a thread along with {@link Response} - * on successful completion of {@link Mono}. + * @return a list of run steps from a thread run along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listMessageFilesWithResponseAsync(String threadId, String messageId, + public Mono> listRunStepsWithResponseAsync(String threadId, String runId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listMessageFiles(this.getEndpoint(), threadId, messageId, accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.listRunSteps(this.getEndpoint(), threadId, runId, accept, requestOptions, context)); } /** - * Gets a list of previously uploaded files associated with a message from a thread. + * Gets a list of run steps from a thread run. *

Query Parameters

*
Query Parameters
* @@ -2533,8 +4175,31 @@ public Mono> listMessageFilesWithResponseAsync(String threa * (Required){ * id: String (Required) * object: String (Required) + * type: String(message_creation/tool_calls) (Required) + * assistant_id: String (Required) + * thread_id: String (Required) + * run_id: String (Required) + * status: String(in_progress/cancelled/failed/completed/expired) (Required) + * step_details (Required): { + * type: String(message_creation/tool_calls) (Required) + * } + * last_error (Required): { + * code: String(server_error/rate_limit_exceeded) (Required) + * message: String (Required) + * } * created_at: long (Required) - * message_id: String (Required) + * expired_at: Long (Required) + * completed_at: Long (Required) + * cancelled_at: Long (Required) + * failed_at: Long (Required) + * usage (Optional): { + * completion_tokens: long (Required) + * prompt_tokens: long (Required) + * total_tokens: long (Required) + * } + * metadata (Required): { + * String: String (Required) + * } * } * ] * first_id: String (Required) @@ -2543,713 +4208,495 @@ public Mono> listMessageFilesWithResponseAsync(String threa * } * } * - * @param threadId The ID of the thread containing the message to list files from. - * @param messageId The ID of the message to list files from. + * @param threadId The ID of the thread that was run. + * @param runId The ID of the run to list steps from. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of previously uploaded files associated with a message from a thread along with {@link Response}. + * @return a list of run steps from a thread run along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listMessageFilesWithResponse(String threadId, String messageId, - RequestOptions requestOptions) { + public Response listRunStepsWithResponse(String threadId, String runId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.listMessageFilesSync(this.getEndpoint(), threadId, messageId, accept, requestOptions, - Context.NONE); + return service.listRunStepsSync(this.getEndpoint(), threadId, runId, accept, requestOptions, Context.NONE); } /** - * Gets information about a file attachment to a message within a thread. + * Gets a list of previously uploaded files. + *

Query Parameters

+ *
Query Parameters
+ * + * + * + *
Query Parameters
NameTypeRequiredDescription
purposeStringNoA value that, when provided, limits list results to files + * matching the corresponding purpose. Allowed values: "fine-tune", "fine-tune-results", "assistants", + * "assistants_output", "batch", "batch_output", "vision".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
{@code
      * {
-     *     id: String (Required)
      *     object: String (Required)
-     *     created_at: long (Required)
-     *     message_id: String (Required)
+     *     data (Required): [
+     *          (Required){
+     *             object: String (Required)
+     *             id: String (Required)
+     *             bytes: int (Required)
+     *             filename: String (Required)
+     *             created_at: long (Required)
+     *             purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
+     *             status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
+     *             status_details: String (Optional)
+     *         }
+     *     ]
      * }
      * }
* - * @param threadId The ID of the thread containing the message to get information from. - * @param messageId The ID of the message to get information from. - * @param fileId The ID of the file to get information about. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return information about a file attachment to a message within a thread along with {@link Response} on - * successful completion of {@link Mono}. + * @return a list of previously uploaded files along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMessageFileWithResponseAsync(String threadId, String messageId, String fileId, - RequestOptions requestOptions) { + public Mono> listFilesWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMessageFile(this.getEndpoint(), threadId, messageId, fileId, - accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.listFiles(this.getEndpoint(), accept, requestOptions, context)); } /** - * Gets information about a file attachment to a message within a thread. + * Gets a list of previously uploaded files. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
purposeStringNoA value that, when provided, limits list results to files + * matching the corresponding purpose. Allowed values: "fine-tune", "fine-tune-results", "assistants", + * "assistants_output", "batch", "batch_output", "vision".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
{@code
      * {
-     *     id: String (Required)
      *     object: String (Required)
-     *     created_at: long (Required)
-     *     message_id: String (Required)
+     *     data (Required): [
+     *          (Required){
+     *             object: String (Required)
+     *             id: String (Required)
+     *             bytes: int (Required)
+     *             filename: String (Required)
+     *             created_at: long (Required)
+     *             purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
+     *             status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
+     *             status_details: String (Optional)
+     *         }
+     *     ]
      * }
      * }
* - * @param threadId The ID of the thread containing the message to get information from. - * @param messageId The ID of the message to get information from. - * @param fileId The ID of the file to get information about. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return information about a file attachment to a message within a thread along with {@link Response}. + * @return a list of previously uploaded files along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMessageFileWithResponse(String threadId, String messageId, String fileId, - RequestOptions requestOptions) { + public Response listFilesWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getMessageFileSync(this.getEndpoint(), threadId, messageId, fileId, accept, requestOptions, - Context.NONE); + return service.listFilesSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** - * Creates a new run for an assistant thread. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     assistant_id: String (Required)
-     *     model: String (Optional)
-     *     instructions: String (Optional)
-     *     additional_instructions: String (Optional)
-     *     tools (Optional): [
-     *          (Optional){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     stream: Boolean (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * + * Uploads a file for use by other operations. *

Response Body Schema

* *
{@code
      * {
-     *     id: String (Required)
      *     object: String (Required)
-     *     thread_id: String (Required)
-     *     assistant_id: String (Required)
-     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
-     *     required_action (Optional): {
-     *         type: String (Required)
-     *     }
-     *     last_error (Required): {
-     *         code: String (Required)
-     *         message: String (Required)
-     *     }
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
-     *          (Required){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
+     *     id: String (Required)
+     *     bytes: int (Required)
+     *     filename: String (Required)
      *     created_at: long (Required)
-     *     expires_at: Long (Required)
-     *     started_at: Long (Required)
-     *     completed_at: Long (Required)
-     *     cancelled_at: Long (Required)
-     *     failed_at: Long (Required)
-     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
-     *     usage (Required): {
-     *         completion_tokens: long (Required)
-     *         prompt_tokens: long (Required)
-     *         total_tokens: long (Required)
-     *     }
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
+     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
+     *     status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
+     *     status_details: String (Optional)
      * }
      * }
* - * @param threadId The ID of the thread to run. - * @param createRunOptions The details for the run to create. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return data representing a single evaluation run of an assistant thread along with {@link Response} on - * successful completion of {@link Mono}. + * @return represents an assistant that can call the model and use tools along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createRunWithResponseAsync(String threadId, BinaryData createRunOptions, - RequestOptions requestOptions) { + public Mono> uploadFileWithResponseAsync(BinaryData request, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createRun(this.getEndpoint(), threadId, accept, createRunOptions, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.uploadFile(this.getEndpoint(), contentType, accept, request, requestOptions, context)); } /** - * Creates a new run for an assistant thread. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     assistant_id: String (Required)
-     *     model: String (Optional)
-     *     instructions: String (Optional)
-     *     additional_instructions: String (Optional)
-     *     tools (Optional): [
-     *          (Optional){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     stream: Boolean (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * + * Uploads a file for use by other operations. *

Response Body Schema

* *
{@code
      * {
-     *     id: String (Required)
      *     object: String (Required)
-     *     thread_id: String (Required)
-     *     assistant_id: String (Required)
-     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
-     *     required_action (Optional): {
-     *         type: String (Required)
-     *     }
-     *     last_error (Required): {
-     *         code: String (Required)
-     *         message: String (Required)
-     *     }
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
-     *          (Required){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
+     *     id: String (Required)
+     *     bytes: int (Required)
+     *     filename: String (Required)
      *     created_at: long (Required)
-     *     expires_at: Long (Required)
-     *     started_at: Long (Required)
-     *     completed_at: Long (Required)
-     *     cancelled_at: Long (Required)
-     *     failed_at: Long (Required)
-     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
-     *     usage (Required): {
-     *         completion_tokens: long (Required)
-     *         prompt_tokens: long (Required)
-     *         total_tokens: long (Required)
-     *     }
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
+     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
+     *     status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
+     *     status_details: String (Optional)
      * }
      * }
* - * @param threadId The ID of the thread to run. - * @param createRunOptions The details for the run to create. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return data representing a single evaluation run of an assistant thread along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createRunWithResponse(String threadId, BinaryData createRunOptions, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.createRunSync(this.getEndpoint(), threadId, accept, createRunOptions, requestOptions, - Context.NONE); - } - - /** - * Gets a list of runs for a specified thread. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for - * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with - * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with - * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the - * list.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents an assistant that can call the model and use tools along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uploadFileWithResponse(BinaryData request, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return service.uploadFileSync(this.getEndpoint(), contentType, accept, request, requestOptions, Context.NONE); + } + + /** + * Delete a previously uploaded file. *

Response Body Schema

* *
{@code
      * {
+     *     id: String (Required)
+     *     deleted: boolean (Required)
      *     object: String (Required)
-     *     data (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             object: String (Required)
-     *             thread_id: String (Required)
-     *             assistant_id: String (Required)
-     *             status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
-     *             required_action (Optional): {
-     *                 type: String (Required)
-     *             }
-     *             last_error (Required): {
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *             model: String (Required)
-     *             instructions: String (Required)
-     *             tools (Required): [
-     *                  (Required){
-     *                     type: String (Required)
-     *                 }
-     *             ]
-     *             file_ids (Required): [
-     *                 String (Required)
-     *             ]
-     *             created_at: long (Required)
-     *             expires_at: Long (Required)
-     *             started_at: Long (Required)
-     *             completed_at: Long (Required)
-     *             cancelled_at: Long (Required)
-     *             failed_at: Long (Required)
-     *             incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
-     *             usage (Required): {
-     *                 completion_tokens: long (Required)
-     *                 prompt_tokens: long (Required)
-     *                 total_tokens: long (Required)
-     *             }
-     *             metadata (Required): {
-     *                 String: String (Required)
-     *             }
-     *         }
-     *     ]
-     *     first_id: String (Required)
-     *     last_id: String (Required)
-     *     has_more: boolean (Required)
      * }
      * }
* - * @param threadId The ID of the thread to list runs from. + * @param fileId The ID of the file to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of runs for a specified thread along with {@link Response} on successful completion of + * @return a status response from a file deletion operation along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listRunsWithResponseAsync(String threadId, RequestOptions requestOptions) { + public Mono> deleteFileWithResponseAsync(String fileId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listRuns(this.getEndpoint(), threadId, accept, requestOptions, context)); + .withContext(context -> service.deleteFile(this.getEndpoint(), fileId, accept, requestOptions, context)); } /** - * Gets a list of runs for a specified thread. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for - * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with - * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with - * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the - * list.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Delete a previously uploaded file. *

Response Body Schema

* *
{@code
      * {
+     *     id: String (Required)
+     *     deleted: boolean (Required)
      *     object: String (Required)
-     *     data (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             object: String (Required)
-     *             thread_id: String (Required)
-     *             assistant_id: String (Required)
-     *             status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
-     *             required_action (Optional): {
-     *                 type: String (Required)
-     *             }
-     *             last_error (Required): {
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *             model: String (Required)
-     *             instructions: String (Required)
-     *             tools (Required): [
-     *                  (Required){
-     *                     type: String (Required)
-     *                 }
-     *             ]
-     *             file_ids (Required): [
-     *                 String (Required)
-     *             ]
-     *             created_at: long (Required)
-     *             expires_at: Long (Required)
-     *             started_at: Long (Required)
-     *             completed_at: Long (Required)
-     *             cancelled_at: Long (Required)
-     *             failed_at: Long (Required)
-     *             incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
-     *             usage (Required): {
-     *                 completion_tokens: long (Required)
-     *                 prompt_tokens: long (Required)
-     *                 total_tokens: long (Required)
-     *             }
-     *             metadata (Required): {
-     *                 String: String (Required)
-     *             }
-     *         }
-     *     ]
-     *     first_id: String (Required)
-     *     last_id: String (Required)
-     *     has_more: boolean (Required)
      * }
      * }
* - * @param threadId The ID of the thread to list runs from. + * @param fileId The ID of the file to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of runs for a specified thread along with {@link Response}. + * @return a status response from a file deletion operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listRunsWithResponse(String threadId, RequestOptions requestOptions) { + public Response deleteFileWithResponse(String fileId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.listRunsSync(this.getEndpoint(), threadId, accept, requestOptions, Context.NONE); + return service.deleteFileSync(this.getEndpoint(), fileId, accept, requestOptions, Context.NONE); } /** - * Gets an existing run from an existing thread. + * Returns information about a specific file. Does not retrieve file content. *

Response Body Schema

* *
{@code
      * {
-     *     id: String (Required)
      *     object: String (Required)
-     *     thread_id: String (Required)
-     *     assistant_id: String (Required)
-     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
-     *     required_action (Optional): {
-     *         type: String (Required)
-     *     }
-     *     last_error (Required): {
-     *         code: String (Required)
-     *         message: String (Required)
-     *     }
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
-     *          (Required){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
+     *     id: String (Required)
+     *     bytes: int (Required)
+     *     filename: String (Required)
      *     created_at: long (Required)
-     *     expires_at: Long (Required)
-     *     started_at: Long (Required)
-     *     completed_at: Long (Required)
-     *     cancelled_at: Long (Required)
-     *     failed_at: Long (Required)
-     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
-     *     usage (Required): {
-     *         completion_tokens: long (Required)
-     *         prompt_tokens: long (Required)
-     *         total_tokens: long (Required)
-     *     }
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
+     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
+     *     status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
+     *     status_details: String (Optional)
      * }
      * }
* - * @param threadId The ID of the thread to retrieve run information from. - * @param runId The ID of the thread to retrieve information about. + * @param fileId The ID of the file to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return an existing run from an existing thread along with {@link Response} on successful completion of - * {@link Mono}. + * @return represents an assistant that can call the model and use tools along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRunWithResponseAsync(String threadId, String runId, - RequestOptions requestOptions) { + public Mono> getFileWithResponseAsync(String fileId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getRun(this.getEndpoint(), threadId, runId, accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getFile(this.getEndpoint(), fileId, accept, requestOptions, context)); } /** - * Gets an existing run from an existing thread. + * Returns information about a specific file. Does not retrieve file content. *

Response Body Schema

* *
{@code
      * {
-     *     id: String (Required)
      *     object: String (Required)
-     *     thread_id: String (Required)
-     *     assistant_id: String (Required)
-     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
-     *     required_action (Optional): {
-     *         type: String (Required)
-     *     }
-     *     last_error (Required): {
-     *         code: String (Required)
-     *         message: String (Required)
-     *     }
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
-     *          (Required){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
+     *     id: String (Required)
+     *     bytes: int (Required)
+     *     filename: String (Required)
      *     created_at: long (Required)
-     *     expires_at: Long (Required)
-     *     started_at: Long (Required)
-     *     completed_at: Long (Required)
-     *     cancelled_at: Long (Required)
-     *     failed_at: Long (Required)
-     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
-     *     usage (Required): {
-     *         completion_tokens: long (Required)
-     *         prompt_tokens: long (Required)
-     *         total_tokens: long (Required)
-     *     }
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
+     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output/batch/batch_output/vision) (Required)
+     *     status: String(uploaded/pending/running/processed/error/deleting/deleted) (Optional)
+     *     status_details: String (Optional)
      * }
      * }
* - * @param threadId The ID of the thread to retrieve run information from. - * @param runId The ID of the thread to retrieve information about. + * @param fileId The ID of the file to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents an assistant that can call the model and use tools along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFileWithResponse(String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getFileSync(this.getEndpoint(), fileId, accept, requestOptions, Context.NONE); + } + + /** + * Returns information about a specific file. Does not retrieve file content. + *

Response Body Schema

+ * + *
{@code
+     * byte[]
+     * }
+ * + * @param fileId The ID of the file to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return an existing run from an existing thread along with {@link Response}. + * @return represent a byte array along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRunWithResponse(String threadId, String runId, RequestOptions requestOptions) { + public Mono> getFileContentWithResponseAsync(String fileId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getRunSync(this.getEndpoint(), threadId, runId, accept, requestOptions, Context.NONE); + return FluxUtil.withContext( + context -> service.getFileContent(this.getEndpoint(), fileId, accept, requestOptions, context)); } /** - * Modifies an existing thread run. - *

Request Body Schema

+ * Returns information about a specific file. Does not retrieve file content. + *

Response Body Schema

* *
{@code
-     * {
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
+     * byte[]
      * }
* + * @param fileId The ID of the file to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represent a byte array along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFileContentWithResponse(String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getFileContentSync(this.getEndpoint(), fileId, accept, requestOptions, Context.NONE); + } + + /** + * Returns a list of vector stores. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for + * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the + * list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
{@code
      * {
-     *     id: String (Required)
      *     object: String (Required)
-     *     thread_id: String (Required)
-     *     assistant_id: String (Required)
-     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
-     *     required_action (Optional): {
-     *         type: String (Required)
-     *     }
-     *     last_error (Required): {
-     *         code: String (Required)
-     *         message: String (Required)
-     *     }
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
+     *     data (Required): [
      *          (Required){
-     *             type: String (Required)
+     *             id: String (Required)
+     *             object: String (Required)
+     *             created_at: long (Required)
+     *             name: String (Required)
+     *             usage_bytes: int (Required)
+     *             file_counts (Required): {
+     *                 in_progress: int (Required)
+     *                 completed: int (Required)
+     *                 failed: int (Required)
+     *                 cancelled: int (Required)
+     *                 total: int (Required)
+     *             }
+     *             status: String(expired/in_progress/completed) (Required)
+     *             expires_after (Optional): {
+     *                 anchor: String(last_active_at) (Required)
+     *                 days: int (Required)
+     *             }
+     *             expires_at: Long (Optional)
+     *             last_active_at: Long (Required)
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
-     *     created_at: long (Required)
-     *     expires_at: Long (Required)
-     *     started_at: Long (Required)
-     *     completed_at: Long (Required)
-     *     cancelled_at: Long (Required)
-     *     failed_at: Long (Required)
-     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
-     *     usage (Required): {
-     *         completion_tokens: long (Required)
-     *         prompt_tokens: long (Required)
-     *         total_tokens: long (Required)
-     *     }
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
+     *     first_id: String (Required)
+     *     last_id: String (Required)
+     *     has_more: boolean (Required)
      * }
      * }
* - * @param threadId The ID of the thread associated with the specified run. - * @param runId The ID of the run to modify. - * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return data representing a single evaluation run of an assistant thread along with {@link Response} on - * successful completion of {@link Mono}. + * @return the response data for a requested list of items along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateRunWithResponseAsync(String threadId, String runId, BinaryData request, - RequestOptions requestOptions) { + public Mono> listVectorStoresWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateRun(this.getEndpoint(), threadId, runId, accept, request, - requestOptions, context)); + return FluxUtil + .withContext(context -> service.listVectorStores(this.getEndpoint(), accept, requestOptions, context)); } /** - * Modifies an existing thread run. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * + * Returns a list of vector stores. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for + * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the + * list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
{@code
      * {
-     *     id: String (Required)
      *     object: String (Required)
-     *     thread_id: String (Required)
-     *     assistant_id: String (Required)
-     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
-     *     required_action (Optional): {
-     *         type: String (Required)
-     *     }
-     *     last_error (Required): {
-     *         code: String (Required)
-     *         message: String (Required)
-     *     }
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
+     *     data (Required): [
      *          (Required){
-     *             type: String (Required)
+     *             id: String (Required)
+     *             object: String (Required)
+     *             created_at: long (Required)
+     *             name: String (Required)
+     *             usage_bytes: int (Required)
+     *             file_counts (Required): {
+     *                 in_progress: int (Required)
+     *                 completed: int (Required)
+     *                 failed: int (Required)
+     *                 cancelled: int (Required)
+     *                 total: int (Required)
+     *             }
+     *             status: String(expired/in_progress/completed) (Required)
+     *             expires_after (Optional): {
+     *                 anchor: String(last_active_at) (Required)
+     *                 days: int (Required)
+     *             }
+     *             expires_at: Long (Optional)
+     *             last_active_at: Long (Required)
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
-     *     created_at: long (Required)
-     *     expires_at: Long (Required)
-     *     started_at: Long (Required)
-     *     completed_at: Long (Required)
-     *     cancelled_at: Long (Required)
-     *     failed_at: Long (Required)
-     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
-     *     usage (Required): {
-     *         completion_tokens: long (Required)
-     *         prompt_tokens: long (Required)
-     *         total_tokens: long (Required)
-     *     }
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
+     *     first_id: String (Required)
+     *     last_id: String (Required)
+     *     has_more: boolean (Required)
      * }
      * }
* - * @param threadId The ID of the thread associated with the specified run. - * @param runId The ID of the run to modify. - * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return data representing a single evaluation run of an assistant thread along with {@link Response}. + * @return the response data for a requested list of items along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateRunWithResponse(String threadId, String runId, BinaryData request, - RequestOptions requestOptions) { + public Response listVectorStoresWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.updateRunSync(this.getEndpoint(), threadId, runId, accept, request, requestOptions, - Context.NONE); + return service.listVectorStoresSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** - * Submits outputs from tools as requested by tool calls in a run. Runs that need submitted tool outputs will have a - * status of 'requires_action' with a required_action.type of 'submit_tool_outputs'. + * Creates a vector store. *

Request Body Schema

* *
{@code
      * {
-     *     tool_outputs (Required): [
-     *          (Required){
-     *             tool_call_id: String (Optional)
-     *             output: String (Optional)
-     *         }
+     *     file_ids (Optional): [
+     *         String (Optional)
      *     ]
-     *     stream: Boolean (Optional)
+     *     name: String (Optional)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
      * }
      * }
* @@ -3259,77 +4706,63 @@ public Response updateRunWithResponse(String threadId, String runId, * { * id: String (Required) * object: String (Required) - * thread_id: String (Required) - * assistant_id: String (Required) - * status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required) - * required_action (Optional): { - * type: String (Required) - * } - * last_error (Required): { - * code: String (Required) - * message: String (Required) - * } - * model: String (Required) - * instructions: String (Required) - * tools (Required): [ - * (Required){ - * type: String (Required) - * } - * ] - * file_ids (Required): [ - * String (Required) - * ] * created_at: long (Required) - * expires_at: Long (Required) - * started_at: Long (Required) - * completed_at: Long (Required) - * cancelled_at: Long (Required) - * failed_at: Long (Required) - * incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required) - * usage (Required): { - * completion_tokens: long (Required) - * prompt_tokens: long (Required) - * total_tokens: long (Required) + * name: String (Required) + * usage_bytes: int (Required) + * file_counts (Required): { + * in_progress: int (Required) + * completed: int (Required) + * failed: int (Required) + * cancelled: int (Required) + * total: int (Required) + * } + * status: String(expired/in_progress/completed) (Required) + * expires_after (Optional): { + * anchor: String(last_active_at) (Required) + * days: int (Required) * } + * expires_at: Long (Optional) + * last_active_at: Long (Required) * metadata (Required): { * String: String (Required) * } * } * } * - * @param threadId The ID of the thread that was run. - * @param runId The ID of the run that requires tool outputs. - * @param request The request parameter. + * @param vectorStoreOptions Request object for creating a vector store. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return data representing a single evaluation run of an assistant thread along with {@link Response} on - * successful completion of {@link Mono}. + * @return a vector store is a collection of processed files can be used by the `file_search` tool along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> submitToolOutputsToRunWithResponseAsync(String threadId, String runId, - BinaryData request, RequestOptions requestOptions) { + public Mono> createVectorStoreWithResponseAsync(BinaryData vectorStoreOptions, + RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.submitToolOutputsToRun(this.getEndpoint(), threadId, runId, - accept, request, requestOptions, context)); + return FluxUtil.withContext(context -> service.createVectorStore(this.getEndpoint(), accept, vectorStoreOptions, + requestOptions, context)); } /** - * Submits outputs from tools as requested by tool calls in a run. Runs that need submitted tool outputs will have a - * status of 'requires_action' with a required_action.type of 'submit_tool_outputs'. + * Creates a vector store. *

Request Body Schema

* *
{@code
      * {
-     *     tool_outputs (Required): [
-     *          (Required){
-     *             tool_call_id: String (Optional)
-     *             output: String (Optional)
-     *         }
+     *     file_ids (Optional): [
+     *         String (Optional)
      *     ]
-     *     stream: Boolean (Optional)
+     *     name: String (Optional)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
      * }
      * }
* @@ -3339,219 +4772,151 @@ public Mono> submitToolOutputsToRunWithResponseAsync(String * { * id: String (Required) * object: String (Required) - * thread_id: String (Required) - * assistant_id: String (Required) - * status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required) - * required_action (Optional): { - * type: String (Required) - * } - * last_error (Required): { - * code: String (Required) - * message: String (Required) - * } - * model: String (Required) - * instructions: String (Required) - * tools (Required): [ - * (Required){ - * type: String (Required) - * } - * ] - * file_ids (Required): [ - * String (Required) - * ] * created_at: long (Required) - * expires_at: Long (Required) - * started_at: Long (Required) - * completed_at: Long (Required) - * cancelled_at: Long (Required) - * failed_at: Long (Required) - * incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required) - * usage (Required): { - * completion_tokens: long (Required) - * prompt_tokens: long (Required) - * total_tokens: long (Required) + * name: String (Required) + * usage_bytes: int (Required) + * file_counts (Required): { + * in_progress: int (Required) + * completed: int (Required) + * failed: int (Required) + * cancelled: int (Required) + * total: int (Required) * } + * status: String(expired/in_progress/completed) (Required) + * expires_after (Optional): { + * anchor: String(last_active_at) (Required) + * days: int (Required) + * } + * expires_at: Long (Optional) + * last_active_at: Long (Required) * metadata (Required): { * String: String (Required) * } * } * } * - * @param threadId The ID of the thread that was run. - * @param runId The ID of the run that requires tool outputs. - * @param request The request parameter. + * @param vectorStoreOptions Request object for creating a vector store. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return data representing a single evaluation run of an assistant thread along with {@link Response}. + * @return a vector store is a collection of processed files can be used by the `file_search` tool along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response submitToolOutputsToRunWithResponse(String threadId, String runId, BinaryData request, + public Response createVectorStoreWithResponse(BinaryData vectorStoreOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return service.submitToolOutputsToRunSync(this.getEndpoint(), threadId, runId, accept, request, requestOptions, + return service.createVectorStoreSync(this.getEndpoint(), accept, vectorStoreOptions, requestOptions, Context.NONE); } /** - * Cancels a run of an in progress thread. + * Returns the vector store object matching the specified ID. *

Response Body Schema

* *
{@code
      * {
      *     id: String (Required)
      *     object: String (Required)
-     *     thread_id: String (Required)
-     *     assistant_id: String (Required)
-     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
-     *     required_action (Optional): {
-     *         type: String (Required)
-     *     }
-     *     last_error (Required): {
-     *         code: String (Required)
-     *         message: String (Required)
-     *     }
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
-     *          (Required){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
      *     created_at: long (Required)
-     *     expires_at: Long (Required)
-     *     started_at: Long (Required)
-     *     completed_at: Long (Required)
-     *     cancelled_at: Long (Required)
-     *     failed_at: Long (Required)
-     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
-     *     usage (Required): {
-     *         completion_tokens: long (Required)
-     *         prompt_tokens: long (Required)
-     *         total_tokens: long (Required)
+     *     name: String (Required)
+     *     usage_bytes: int (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
      *     }
+     *     status: String(expired/in_progress/completed) (Required)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     expires_at: Long (Optional)
+     *     last_active_at: Long (Required)
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param threadId The ID of the thread being run. - * @param runId The ID of the run to cancel. + * @param vectorStoreId The ID of the vector store to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return data representing a single evaluation run of an assistant thread along with {@link Response} on - * successful completion of {@link Mono}. + * @return a vector store is a collection of processed files can be used by the `file_search` tool along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelRunWithResponseAsync(String threadId, String runId, + public Mono> getVectorStoreWithResponseAsync(String vectorStoreId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( - context -> service.cancelRun(this.getEndpoint(), threadId, runId, accept, requestOptions, context)); + context -> service.getVectorStore(this.getEndpoint(), vectorStoreId, accept, requestOptions, context)); } /** - * Cancels a run of an in progress thread. + * Returns the vector store object matching the specified ID. *

Response Body Schema

* *
{@code
      * {
      *     id: String (Required)
      *     object: String (Required)
-     *     thread_id: String (Required)
-     *     assistant_id: String (Required)
-     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
-     *     required_action (Optional): {
-     *         type: String (Required)
-     *     }
-     *     last_error (Required): {
-     *         code: String (Required)
-     *         message: String (Required)
-     *     }
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
-     *          (Required){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
      *     created_at: long (Required)
-     *     expires_at: Long (Required)
-     *     started_at: Long (Required)
-     *     completed_at: Long (Required)
-     *     cancelled_at: Long (Required)
-     *     failed_at: Long (Required)
-     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
-     *     usage (Required): {
-     *         completion_tokens: long (Required)
-     *         prompt_tokens: long (Required)
-     *         total_tokens: long (Required)
+     *     name: String (Required)
+     *     usage_bytes: int (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
      *     }
+     *     status: String(expired/in_progress/completed) (Required)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     expires_at: Long (Optional)
+     *     last_active_at: Long (Required)
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param threadId The ID of the thread being run. - * @param runId The ID of the run to cancel. + * @param vectorStoreId The ID of the vector store to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return data representing a single evaluation run of an assistant thread along with {@link Response}. + * @return a vector store is a collection of processed files can be used by the `file_search` tool along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelRunWithResponse(String threadId, String runId, RequestOptions requestOptions) { + public Response getVectorStoreWithResponse(String vectorStoreId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.cancelRunSync(this.getEndpoint(), threadId, runId, accept, requestOptions, Context.NONE); + return service.getVectorStoreSync(this.getEndpoint(), vectorStoreId, accept, requestOptions, Context.NONE); } /** - * Creates a new assistant thread and immediately starts a run using that new thread. + * The ID of the vector store to modify. *

Request Body Schema

* *
{@code
      * {
-     *     assistant_id: String (Required)
-     *     thread (Optional): {
-     *         messages (Optional): [
-     *              (Optional){
-     *                 role: String(user/assistant) (Required)
-     *                 content: String (Required)
-     *                 file_ids (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 metadata (Optional): {
-     *                     String: String (Required)
-     *                 }
-     *             }
-     *         ]
-     *         metadata (Optional): {
-     *             String: String (Required)
-     *         }
+     *     name: String (Optional)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
      *     }
-     *     model: String (Optional)
-     *     instructions: String (Optional)
-     *     tools (Optional): [
-     *          (Optional){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     stream: Boolean (Optional)
      *     metadata (Optional): {
      *         String: String (Required)
      *     }
@@ -3564,273 +4929,174 @@ public Response cancelRunWithResponse(String threadId, String runId,
      * {
      *     id: String (Required)
      *     object: String (Required)
-     *     thread_id: String (Required)
-     *     assistant_id: String (Required)
-     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
-     *     required_action (Optional): {
-     *         type: String (Required)
-     *     }
-     *     last_error (Required): {
-     *         code: String (Required)
-     *         message: String (Required)
-     *     }
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
-     *          (Required){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
      *     created_at: long (Required)
-     *     expires_at: Long (Required)
-     *     started_at: Long (Required)
-     *     completed_at: Long (Required)
-     *     cancelled_at: Long (Required)
-     *     failed_at: Long (Required)
-     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
-     *     usage (Required): {
-     *         completion_tokens: long (Required)
-     *         prompt_tokens: long (Required)
-     *         total_tokens: long (Required)
+     *     name: String (Required)
+     *     usage_bytes: int (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
+     *     status: String(expired/in_progress/completed) (Required)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
      *     }
+     *     expires_at: Long (Optional)
+     *     last_active_at: Long (Required)
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param createAndRunThreadOptions The details used when creating and immediately running a new assistant thread. + * @param vectorStoreId The ID of the vector store to modify. + * @param vectorStoreUpdateOptions Request object for updating a vector store. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return data representing a single evaluation run of an assistant thread along with {@link Response} on - * successful completion of {@link Mono}. + * @return a vector store is a collection of processed files can be used by the `file_search` tool along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createThreadAndRunWithResponseAsync(BinaryData createAndRunThreadOptions, - RequestOptions requestOptions) { + public Mono> modifyVectorStoreWithResponseAsync(String vectorStoreId, + BinaryData vectorStoreUpdateOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createThreadAndRun(this.getEndpoint(), accept, - createAndRunThreadOptions, requestOptions, context)); + return FluxUtil.withContext(context -> service.modifyVectorStore(this.getEndpoint(), vectorStoreId, accept, + vectorStoreUpdateOptions, requestOptions, context)); } /** - * Creates a new assistant thread and immediately starts a run using that new thread. + * The ID of the vector store to modify. *

Request Body Schema

* *
{@code
      * {
-     *     assistant_id: String (Required)
-     *     thread (Optional): {
-     *         messages (Optional): [
-     *              (Optional){
-     *                 role: String(user/assistant) (Required)
-     *                 content: String (Required)
-     *                 file_ids (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 metadata (Optional): {
-     *                     String: String (Required)
-     *                 }
-     *             }
-     *         ]
-     *         metadata (Optional): {
-     *             String: String (Required)
-     *         }
+     *     name: String (Optional)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
      *     }
-     *     model: String (Optional)
-     *     instructions: String (Optional)
-     *     tools (Optional): [
-     *          (Optional){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     stream: Boolean (Optional)
      *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     object: String (Required)
-     *     thread_id: String (Required)
-     *     assistant_id: String (Required)
-     *     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
-     *     required_action (Optional): {
-     *         type: String (Required)
-     *     }
-     *     last_error (Required): {
-     *         code: String (Required)
-     *         message: String (Required)
-     *     }
-     *     model: String (Required)
-     *     instructions: String (Required)
-     *     tools (Required): [
-     *          (Required){
-     *             type: String (Required)
-     *         }
-     *     ]
-     *     file_ids (Required): [
-     *         String (Required)
-     *     ]
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
      *     created_at: long (Required)
-     *     expires_at: Long (Required)
-     *     started_at: Long (Required)
-     *     completed_at: Long (Required)
-     *     cancelled_at: Long (Required)
-     *     failed_at: Long (Required)
-     *     incomplete_details: String(max_completion_tokens/max_prompt_tokens) (Required)
-     *     usage (Required): {
-     *         completion_tokens: long (Required)
-     *         prompt_tokens: long (Required)
-     *         total_tokens: long (Required)
+     *     name: String (Required)
+     *     usage_bytes: int (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
      *     }
+     *     status: String(expired/in_progress/completed) (Required)
+     *     expires_after (Optional): {
+     *         anchor: String(last_active_at) (Required)
+     *         days: int (Required)
+     *     }
+     *     expires_at: Long (Optional)
+     *     last_active_at: Long (Required)
      *     metadata (Required): {
      *         String: String (Required)
      *     }
      * }
      * }
* - * @param createAndRunThreadOptions The details used when creating and immediately running a new assistant thread. + * @param vectorStoreId The ID of the vector store to modify. + * @param vectorStoreUpdateOptions Request object for updating a vector store. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return data representing a single evaluation run of an assistant thread along with {@link Response}. + * @return a vector store is a collection of processed files can be used by the `file_search` tool along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createThreadAndRunWithResponse(BinaryData createAndRunThreadOptions, + public Response modifyVectorStoreWithResponse(String vectorStoreId, BinaryData vectorStoreUpdateOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return service.createThreadAndRunSync(this.getEndpoint(), accept, createAndRunThreadOptions, requestOptions, - Context.NONE); + return service.modifyVectorStoreSync(this.getEndpoint(), vectorStoreId, accept, vectorStoreUpdateOptions, + requestOptions, Context.NONE); } /** - * Gets a single run step from a thread run. + * Deletes the vector store object matching the specified ID. *

Response Body Schema

* *
{@code
      * {
      *     id: String (Required)
+     *     deleted: boolean (Required)
      *     object: String (Required)
-     *     type: String(message_creation/tool_calls) (Required)
-     *     assistant_id: String (Required)
-     *     thread_id: String (Required)
-     *     run_id: String (Required)
-     *     status: String(in_progress/cancelled/failed/completed/expired) (Required)
-     *     step_details (Required): {
-     *         type: String(message_creation/tool_calls) (Required)
-     *     }
-     *     last_error (Required): {
-     *         code: String(server_error/rate_limit_exceeded) (Required)
-     *         message: String (Required)
-     *     }
-     *     created_at: long (Required)
-     *     expired_at: Long (Required)
-     *     completed_at: Long (Required)
-     *     cancelled_at: Long (Required)
-     *     failed_at: Long (Required)
-     *     usage (Optional): {
-     *         completion_tokens: long (Required)
-     *         prompt_tokens: long (Required)
-     *         total_tokens: long (Required)
-     *     }
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
      * }
      * }
* - * @param threadId The ID of the thread that was run. - * @param runId The ID of the specific run to retrieve the step from. - * @param stepId The ID of the step to retrieve information about. + * @param vectorStoreId The ID of the vector store to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a single run step from a thread run along with {@link Response} on successful completion of {@link Mono}. + * @return response object for deleting a vector store along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRunStepWithResponseAsync(String threadId, String runId, String stepId, + public Mono> deleteVectorStoreWithResponseAsync(String vectorStoreId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getRunStep(this.getEndpoint(), threadId, runId, stepId, accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.deleteVectorStore(this.getEndpoint(), vectorStoreId, accept, requestOptions, context)); } /** - * Gets a single run step from a thread run. + * Deletes the vector store object matching the specified ID. *

Response Body Schema

* *
{@code
      * {
      *     id: String (Required)
+     *     deleted: boolean (Required)
      *     object: String (Required)
-     *     type: String(message_creation/tool_calls) (Required)
-     *     assistant_id: String (Required)
-     *     thread_id: String (Required)
-     *     run_id: String (Required)
-     *     status: String(in_progress/cancelled/failed/completed/expired) (Required)
-     *     step_details (Required): {
-     *         type: String(message_creation/tool_calls) (Required)
-     *     }
-     *     last_error (Required): {
-     *         code: String(server_error/rate_limit_exceeded) (Required)
-     *         message: String (Required)
-     *     }
-     *     created_at: long (Required)
-     *     expired_at: Long (Required)
-     *     completed_at: Long (Required)
-     *     cancelled_at: Long (Required)
-     *     failed_at: Long (Required)
-     *     usage (Optional): {
-     *         completion_tokens: long (Required)
-     *         prompt_tokens: long (Required)
-     *         total_tokens: long (Required)
-     *     }
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
      * }
      * }
* - * @param threadId The ID of the thread that was run. - * @param runId The ID of the specific run to retrieve the step from. - * @param stepId The ID of the step to retrieve information about. + * @param vectorStoreId The ID of the vector store to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a single run step from a thread run along with {@link Response}. + * @return response object for deleting a vector store along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRunStepWithResponse(String threadId, String runId, String stepId, - RequestOptions requestOptions) { + public Response deleteVectorStoreWithResponse(String vectorStoreId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getRunStepSync(this.getEndpoint(), threadId, runId, stepId, accept, requestOptions, - Context.NONE); + return service.deleteVectorStoreSync(this.getEndpoint(), vectorStoreId, accept, requestOptions, Context.NONE); } /** - * Gets a list of run steps from a thread run. + * Returns a list of vector store files. *

Query Parameters

* * * + * * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter by file status. Allowed values: "in_progress", + * "completed", "failed", "cancelled".
limitIntegerNoA limit on the number of objects to be returned. Limit can range * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for @@ -3853,31 +5119,14 @@ public Response getRunStepWithResponse(String threadId, String runId * (Required){ * id: String (Required) * object: String (Required) - * type: String(message_creation/tool_calls) (Required) - * assistant_id: String (Required) - * thread_id: String (Required) - * run_id: String (Required) - * status: String(in_progress/cancelled/failed/completed/expired) (Required) - * step_details (Required): { - * type: String(message_creation/tool_calls) (Required) - * } + * usage_bytes: int (Required) + * created_at: long (Required) + * vector_store_id: String (Required) + * status: String(in_progress/completed/failed/cancelled) (Required) * last_error (Required): { - * code: String(server_error/rate_limit_exceeded) (Required) + * code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required) * message: String (Required) * } - * created_at: long (Required) - * expired_at: Long (Required) - * completed_at: Long (Required) - * cancelled_at: Long (Required) - * failed_at: Long (Required) - * usage (Optional): { - * completion_tokens: long (Required) - * prompt_tokens: long (Required) - * total_tokens: long (Required) - * } - * metadata (Required): { - * String: String (Required) - * } * } * ] * first_id: String (Required) @@ -3886,30 +5135,31 @@ public Response getRunStepWithResponse(String threadId, String runId * } * } * - * @param threadId The ID of the thread that was run. - * @param runId The ID of the run to list steps from. + * @param vectorStoreId The ID of the vector store that the files belong to. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of run steps from a thread run along with {@link Response} on successful completion of + * @return the response data for a requested list of items along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listRunStepsWithResponseAsync(String threadId, String runId, + public Mono> listVectorStoreFilesWithResponseAsync(String vectorStoreId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listRunSteps(this.getEndpoint(), threadId, runId, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.listVectorStoreFiles(this.getEndpoint(), vectorStoreId, accept, + requestOptions, context)); } /** - * Gets a list of run steps from a thread run. + * Returns a list of vector store files. *

Query Parameters

* * * + * * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter by file status. Allowed values: "in_progress", + * "completed", "failed", "cancelled".
limitIntegerNoA limit on the number of objects to be returned. Limit can range * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for @@ -3932,31 +5182,14 @@ public Mono> listRunStepsWithResponseAsync(String threadId, * (Required){ * id: String (Required) * object: String (Required) - * type: String(message_creation/tool_calls) (Required) - * assistant_id: String (Required) - * thread_id: String (Required) - * run_id: String (Required) - * status: String(in_progress/cancelled/failed/completed/expired) (Required) - * step_details (Required): { - * type: String(message_creation/tool_calls) (Required) - * } + * usage_bytes: int (Required) + * created_at: long (Required) + * vector_store_id: String (Required) + * status: String(in_progress/completed/failed/cancelled) (Required) * last_error (Required): { - * code: String(server_error/rate_limit_exceeded) (Required) + * code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required) * message: String (Required) * } - * created_at: long (Required) - * expired_at: Long (Required) - * completed_at: Long (Required) - * cancelled_at: Long (Required) - * failed_at: Long (Required) - * usage (Optional): { - * completion_tokens: long (Required) - * prompt_tokens: long (Required) - * total_tokens: long (Required) - * } - * metadata (Required): { - * String: String (Required) - * } * } * ] * first_id: String (Required) @@ -3965,323 +5198,623 @@ public Mono> listRunStepsWithResponseAsync(String threadId, * } * } * - * @param threadId The ID of the thread that was run. - * @param runId The ID of the run to list steps from. + * @param vectorStoreId The ID of the vector store that the files belong to. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listVectorStoreFilesWithResponse(String vectorStoreId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.listVectorStoreFilesSync(this.getEndpoint(), vectorStoreId, accept, requestOptions, + Context.NONE); + } + + /** + * Create a vector store file by attaching a file to a vector store. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     file_id: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     usage_bytes: int (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/failed/cancelled) (Required)
+     *     last_error (Required): {
+     *         code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store for which to create a File. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return description of a file attached to a vector store along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createVectorStoreFileWithResponseAsync(String vectorStoreId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createVectorStoreFile(this.getEndpoint(), vectorStoreId, accept, + request, requestOptions, context)); + } + + /** + * Create a vector store file by attaching a file to a vector store. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     file_id: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     usage_bytes: int (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/failed/cancelled) (Required)
+     *     last_error (Required): {
+     *         code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store for which to create a File. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return description of a file attached to a vector store along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createVectorStoreFileWithResponse(String vectorStoreId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.createVectorStoreFileSync(this.getEndpoint(), vectorStoreId, accept, request, requestOptions, + Context.NONE); + } + + /** + * Retrieves a vector store file. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     usage_bytes: int (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/failed/cancelled) (Required)
+     *     last_error (Required): {
+     *         code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store that the file belongs to. + * @param fileId The ID of the file being retrieved. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return description of a file attached to a vector store along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getVectorStoreFileWithResponseAsync(String vectorStoreId, String fileId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getVectorStoreFile(this.getEndpoint(), vectorStoreId, fileId, + accept, requestOptions, context)); + } + + /** + * Retrieves a vector store file. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     object: String (Required)
+     *     usage_bytes: int (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/failed/cancelled) (Required)
+     *     last_error (Required): {
+     *         code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param vectorStoreId The ID of the vector store that the file belongs to. + * @param fileId The ID of the file being retrieved. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of run steps from a thread run along with {@link Response}. + * @return description of a file attached to a vector store along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listRunStepsWithResponse(String threadId, String runId, RequestOptions requestOptions) { + public Response getVectorStoreFileWithResponse(String vectorStoreId, String fileId, + RequestOptions requestOptions) { final String accept = "application/json"; - return service.listRunStepsSync(this.getEndpoint(), threadId, runId, accept, requestOptions, Context.NONE); + return service.getVectorStoreFileSync(this.getEndpoint(), vectorStoreId, fileId, accept, requestOptions, + Context.NONE); } /** - * Gets a list of previously uploaded files. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
purposeStringNoA value that, when provided, limits list results to files - * matching the corresponding purpose. Allowed values: "fine-tune", "fine-tune-results", "assistants", - * "assistants_output".
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Delete a vector store file. This will remove the file from the vector store but the file itself will not be + * deleted. + * To delete the file, use the delete file endpoint. *

Response Body Schema

* *
{@code
      * {
+     *     id: String (Required)
+     *     deleted: boolean (Required)
      *     object: String (Required)
-     *     data (Required): [
-     *          (Required){
-     *             object: String (Required)
-     *             id: String (Required)
-     *             bytes: int (Required)
-     *             filename: String (Required)
-     *             created_at: long (Required)
-     *             purpose: String(fine-tune/fine-tune-results/assistants/assistants_output) (Required)
-     *         }
-     *     ]
      * }
      * }
* + * @param vectorStoreId The ID of the vector store that the file belongs to. + * @param fileId The ID of the file to delete its relationship to the vector store. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of previously uploaded files along with {@link Response} on successful completion of {@link Mono}. + * @return response object for deleting a vector store file relationship along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listFilesWithResponseAsync(RequestOptions requestOptions) { + public Mono> deleteVectorStoreFileWithResponseAsync(String vectorStoreId, String fileId, + RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listFiles(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.deleteVectorStoreFile(this.getEndpoint(), vectorStoreId, fileId, + accept, requestOptions, context)); } /** - * Gets a list of previously uploaded files. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
purposeStringNoA value that, when provided, limits list results to files - * matching the corresponding purpose. Allowed values: "fine-tune", "fine-tune-results", "assistants", - * "assistants_output".
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Delete a vector store file. This will remove the file from the vector store but the file itself will not be + * deleted. + * To delete the file, use the delete file endpoint. *

Response Body Schema

* *
{@code
      * {
+     *     id: String (Required)
+     *     deleted: boolean (Required)
      *     object: String (Required)
-     *     data (Required): [
-     *          (Required){
-     *             object: String (Required)
-     *             id: String (Required)
-     *             bytes: int (Required)
-     *             filename: String (Required)
-     *             created_at: long (Required)
-     *             purpose: String(fine-tune/fine-tune-results/assistants/assistants_output) (Required)
-     *         }
-     *     ]
      * }
      * }
* + * @param vectorStoreId The ID of the vector store that the file belongs to. + * @param fileId The ID of the file to delete its relationship to the vector store. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of previously uploaded files along with {@link Response}. + * @return response object for deleting a vector store file relationship along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listFilesWithResponse(RequestOptions requestOptions) { + public Response deleteVectorStoreFileWithResponse(String vectorStoreId, String fileId, + RequestOptions requestOptions) { final String accept = "application/json"; - return service.listFilesSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.deleteVectorStoreFileSync(this.getEndpoint(), vectorStoreId, fileId, accept, requestOptions, + Context.NONE); } /** - * Uploads a file for use by other operations. + * Create a vector store file batch. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     file_ids (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * *

Response Body Schema

* *
{@code
      * {
-     *     object: String (Required)
      *     id: String (Required)
-     *     bytes: int (Required)
-     *     filename: String (Required)
+     *     object: String (Required)
      *     created_at: long (Required)
-     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output) (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/cancelled/failed) (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
      * }
      * }
* + * @param vectorStoreId The ID of the vector store for which to create a File Batch. * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an assistant that can call the model and use tools along with {@link Response} on successful - * completion of {@link Mono}. + * @return a batch of files attached to a vector store along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadFileWithResponseAsync(BinaryData request, RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; + public Mono> createVectorStoreFileBatchWithResponseAsync(String vectorStoreId, + BinaryData request, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.uploadFile(this.getEndpoint(), contentType, accept, request, requestOptions, context)); + return FluxUtil.withContext(context -> service.createVectorStoreFileBatch(this.getEndpoint(), vectorStoreId, + accept, request, requestOptions, context)); } /** - * Uploads a file for use by other operations. + * Create a vector store file batch. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     file_ids (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * *

Response Body Schema

* *
{@code
      * {
-     *     object: String (Required)
      *     id: String (Required)
-     *     bytes: int (Required)
-     *     filename: String (Required)
+     *     object: String (Required)
      *     created_at: long (Required)
-     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output) (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/cancelled/failed) (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
      * }
      * }
* + * @param vectorStoreId The ID of the vector store for which to create a File Batch. * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an assistant that can call the model and use tools along with {@link Response}. + * @return a batch of files attached to a vector store along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadFileWithResponse(BinaryData request, RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; + public Response createVectorStoreFileBatchWithResponse(String vectorStoreId, BinaryData request, + RequestOptions requestOptions) { final String accept = "application/json"; - return service.uploadFileSync(this.getEndpoint(), contentType, accept, request, requestOptions, Context.NONE); + return service.createVectorStoreFileBatchSync(this.getEndpoint(), vectorStoreId, accept, request, + requestOptions, Context.NONE); } /** - * Delete a previously uploaded file. + * Retrieve a vector store file batch. *

Response Body Schema

* *
{@code
      * {
      *     id: String (Required)
-     *     deleted: boolean (Required)
      *     object: String (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/cancelled/failed) (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
      * }
      * }
* - * @param fileId The ID of the file to delete. + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch being retrieved. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a status response from a file deletion operation along with {@link Response} on successful completion of + * @return a batch of files attached to a vector store along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteFileWithResponseAsync(String fileId, RequestOptions requestOptions) { + public Mono> getVectorStoreFileBatchWithResponseAsync(String vectorStoreId, String batchId, + RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteFile(this.getEndpoint(), fileId, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getVectorStoreFileBatch(this.getEndpoint(), vectorStoreId, + batchId, accept, requestOptions, context)); } /** - * Delete a previously uploaded file. + * Retrieve a vector store file batch. *

Response Body Schema

* *
{@code
      * {
      *     id: String (Required)
-     *     deleted: boolean (Required)
      *     object: String (Required)
+     *     created_at: long (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/cancelled/failed) (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
      * }
      * }
* - * @param fileId The ID of the file to delete. + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch being retrieved. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a status response from a file deletion operation along with {@link Response}. + * @return a batch of files attached to a vector store along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteFileWithResponse(String fileId, RequestOptions requestOptions) { + public Response getVectorStoreFileBatchWithResponse(String vectorStoreId, String batchId, + RequestOptions requestOptions) { final String accept = "application/json"; - return service.deleteFileSync(this.getEndpoint(), fileId, accept, requestOptions, Context.NONE); + return service.getVectorStoreFileBatchSync(this.getEndpoint(), vectorStoreId, batchId, accept, requestOptions, + Context.NONE); } /** - * Returns information about a specific file. Does not retrieve file content. + * Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as + * possible. *

Response Body Schema

* *
{@code
      * {
-     *     object: String (Required)
      *     id: String (Required)
-     *     bytes: int (Required)
-     *     filename: String (Required)
+     *     object: String (Required)
      *     created_at: long (Required)
-     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output) (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/cancelled/failed) (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
      * }
      * }
* - * @param fileId The ID of the file to retrieve. + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch to cancel. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an assistant that can call the model and use tools along with {@link Response} on successful - * completion of {@link Mono}. + * @return a batch of files attached to a vector store along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getFileWithResponseAsync(String fileId, RequestOptions requestOptions) { + public Mono> cancelVectorStoreFileBatchWithResponseAsync(String vectorStoreId, String batchId, + RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getFile(this.getEndpoint(), fileId, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.cancelVectorStoreFileBatch(this.getEndpoint(), vectorStoreId, + batchId, accept, requestOptions, context)); } /** - * Returns information about a specific file. Does not retrieve file content. + * Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as + * possible. *

Response Body Schema

* *
{@code
      * {
-     *     object: String (Required)
      *     id: String (Required)
-     *     bytes: int (Required)
-     *     filename: String (Required)
+     *     object: String (Required)
      *     created_at: long (Required)
-     *     purpose: String(fine-tune/fine-tune-results/assistants/assistants_output) (Required)
+     *     vector_store_id: String (Required)
+     *     status: String(in_progress/completed/cancelled/failed) (Required)
+     *     file_counts (Required): {
+     *         in_progress: int (Required)
+     *         completed: int (Required)
+     *         failed: int (Required)
+     *         cancelled: int (Required)
+     *         total: int (Required)
+     *     }
      * }
      * }
* - * @param fileId The ID of the file to retrieve. + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch to cancel. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an assistant that can call the model and use tools along with {@link Response}. + * @return a batch of files attached to a vector store along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getFileWithResponse(String fileId, RequestOptions requestOptions) { + public Response cancelVectorStoreFileBatchWithResponse(String vectorStoreId, String batchId, + RequestOptions requestOptions) { final String accept = "application/json"; - return service.getFileSync(this.getEndpoint(), fileId, accept, requestOptions, Context.NONE); + return service.cancelVectorStoreFileBatchSync(this.getEndpoint(), vectorStoreId, batchId, accept, + requestOptions, Context.NONE); } /** - * Returns information about a specific file. Does not retrieve file content. + * Returns a list of vector store files in a batch. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter by file status. Allowed values: "in_progress", + * "completed", "failed", "cancelled".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for + * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the + * list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
{@code
-     * byte[]
+     * {
+     *     object: String (Required)
+     *     data (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             usage_bytes: int (Required)
+     *             created_at: long (Required)
+     *             vector_store_id: String (Required)
+     *             status: String(in_progress/completed/failed/cancelled) (Required)
+     *             last_error (Required): {
+     *                 code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
+     *                 message: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Required)
+     *     last_id: String (Required)
+     *     has_more: boolean (Required)
+     * }
      * }
* - * @param fileId The ID of the file to retrieve. + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch that the files belong to. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represent a byte array along with {@link Response} on successful completion of {@link Mono}. + * @return the response data for a requested list of items along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getFileContentWithResponseAsync(String fileId, RequestOptions requestOptions) { + public Mono> listVectorStoreFileBatchFilesWithResponseAsync(String vectorStoreId, + String batchId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getFileContent(this.getEndpoint(), fileId, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.listVectorStoreFileBatchFiles(this.getEndpoint(), vectorStoreId, + batchId, accept, requestOptions, context)); } /** - * Returns information about a specific file. Does not retrieve file content. + * Returns a list of vector store files in a batch. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter by file status. Allowed values: "in_progress", + * "completed", "failed", "cancelled".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the default is 20.
orderStringNoSort order by the created_at timestamp of the objects. asc for + * ascending order and desc for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. after is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. before is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the + * list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
{@code
-     * byte[]
+     * {
+     *     object: String (Required)
+     *     data (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             object: String (Required)
+     *             usage_bytes: int (Required)
+     *             created_at: long (Required)
+     *             vector_store_id: String (Required)
+     *             status: String(in_progress/completed/failed/cancelled) (Required)
+     *             last_error (Required): {
+     *                 code: String(internal_error/file_not_found/parsing_error/unhandled_mime_type) (Required)
+     *                 message: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Required)
+     *     last_id: String (Required)
+     *     has_more: boolean (Required)
+     * }
      * }
* - * @param fileId The ID of the file to retrieve. + * @param vectorStoreId The ID of the vector store that the file batch belongs to. + * @param batchId The ID of the file batch that the files belong to. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represent a byte array along with {@link Response}. + * @return the response data for a requested list of items along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getFileContentWithResponse(String fileId, RequestOptions requestOptions) { + public Response listVectorStoreFileBatchFilesWithResponse(String vectorStoreId, String batchId, + RequestOptions requestOptions) { final String accept = "application/json"; - return service.getFileContentSync(this.getEndpoint(), fileId, accept, requestOptions, Context.NONE); + return service.listVectorStoreFileBatchFilesSync(this.getEndpoint(), vectorStoreId, batchId, accept, + requestOptions, Context.NONE); } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileBatchRequest.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileBatchRequest.java new file mode 100644 index 0000000000000..17f398839a909 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileBatchRequest.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The CreateVectorStoreFileBatchRequest model. + */ +@Immutable +public final class CreateVectorStoreFileBatchRequest implements JsonSerializable { + /* + * A list of File IDs that the vector store should use. Useful for tools like `file_search` that can access files. + */ + @Generated + private final List fileIds; + + /** + * Creates an instance of CreateVectorStoreFileBatchRequest class. + * + * @param fileIds the fileIds value to set. + */ + @Generated + public CreateVectorStoreFileBatchRequest(List fileIds) { + this.fileIds = fileIds; + } + + /** + * Get the fileIds property: A list of File IDs that the vector store should use. Useful for tools like + * `file_search` that can access files. + * + * @return the fileIds value. + */ + @Generated + public List getFileIds() { + return this.fileIds; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateVectorStoreFileBatchRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateVectorStoreFileBatchRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CreateVectorStoreFileBatchRequest. + */ + @Generated + public static CreateVectorStoreFileBatchRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List fileIds = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("file_ids".equals(fieldName)) { + fileIds = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + return new CreateVectorStoreFileBatchRequest(fileIds); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileRequest.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileRequest.java new file mode 100644 index 0000000000000..5c65a1680cf4b --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileRequest.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CreateVectorStoreFileRequest model. + */ +@Immutable +public final class CreateVectorStoreFileRequest implements JsonSerializable { + /* + * A File ID that the vector store should use. Useful for tools like `file_search` that can access files. + */ + @Generated + private final String fileId; + + /** + * Creates an instance of CreateVectorStoreFileRequest class. + * + * @param fileId the fileId value to set. + */ + @Generated + public CreateVectorStoreFileRequest(String fileId) { + this.fileId = fileId; + } + + /** + * Get the fileId property: A File ID that the vector store should use. Useful for tools like `file_search` that can + * access files. + * + * @return the fileId value. + */ + @Generated + public String getFileId() { + return this.fileId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("file_id", this.fileId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateVectorStoreFileRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateVectorStoreFileRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CreateVectorStoreFileRequest. + */ + @Generated + public static CreateVectorStoreFileRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String fileId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("file_id".equals(fieldName)) { + fileId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new CreateVectorStoreFileRequest(fileId); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/OpenAIPageableListOfVectorStore.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/OpenAIPageableListOfVectorStore.java new file mode 100644 index 0000000000000..7867547ed09f0 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/OpenAIPageableListOfVectorStore.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.implementation.models; + +import com.azure.ai.openai.assistants.models.VectorStore; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The response data for a requested list of items. + */ +@Immutable +public final class OpenAIPageableListOfVectorStore implements JsonSerializable { + /* + * The object type, which is always list. + */ + @Generated + private final String object = "list"; + + /* + * The requested list of items. + */ + @Generated + private final List data; + + /* + * The first ID represented in this list. + */ + @Generated + private final String firstId; + + /* + * The last ID represented in this list. + */ + @Generated + private final String lastId; + + /* + * A value indicating whether there are additional values available not captured in this list. + */ + @Generated + private final boolean hasMore; + + /** + * Creates an instance of OpenAIPageableListOfVectorStore class. + * + * @param data the data value to set. + * @param firstId the firstId value to set. + * @param lastId the lastId value to set. + * @param hasMore the hasMore value to set. + */ + @Generated + private OpenAIPageableListOfVectorStore(List data, String firstId, String lastId, boolean hasMore) { + this.data = data; + this.firstId = firstId; + this.lastId = lastId; + this.hasMore = hasMore; + } + + /** + * Get the object property: The object type, which is always list. + * + * @return the object value. + */ + @Generated + public String getObject() { + return this.object; + } + + /** + * Get the data property: The requested list of items. + * + * @return the data value. + */ + @Generated + public List getData() { + return this.data; + } + + /** + * Get the firstId property: The first ID represented in this list. + * + * @return the firstId value. + */ + @Generated + public String getFirstId() { + return this.firstId; + } + + /** + * Get the lastId property: The last ID represented in this list. + * + * @return the lastId value. + */ + @Generated + public String getLastId() { + return this.lastId; + } + + /** + * Get the hasMore property: A value indicating whether there are additional values available not captured in this + * list. + * + * @return the hasMore value. + */ + @Generated + public boolean isHasMore() { + return this.hasMore; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("object", this.object); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("first_id", this.firstId); + jsonWriter.writeStringField("last_id", this.lastId); + jsonWriter.writeBooleanField("has_more", this.hasMore); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenAIPageableListOfVectorStore from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenAIPageableListOfVectorStore if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OpenAIPageableListOfVectorStore. + */ + @Generated + public static OpenAIPageableListOfVectorStore fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List data = null; + String firstId = null; + String lastId = null; + boolean hasMore = false; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("data".equals(fieldName)) { + data = reader.readArray(reader1 -> VectorStore.fromJson(reader1)); + } else if ("first_id".equals(fieldName)) { + firstId = reader.getString(); + } else if ("last_id".equals(fieldName)) { + lastId = reader.getString(); + } else if ("has_more".equals(fieldName)) { + hasMore = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + return new OpenAIPageableListOfVectorStore(data, firstId, lastId, hasMore); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/OpenAIPageableListOfVectorStoreFile.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/OpenAIPageableListOfVectorStoreFile.java new file mode 100644 index 0000000000000..300cb6a3e01b7 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/models/OpenAIPageableListOfVectorStoreFile.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.implementation.models; + +import com.azure.ai.openai.assistants.models.VectorStoreFile; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The response data for a requested list of items. + */ +@Immutable +public final class OpenAIPageableListOfVectorStoreFile + implements JsonSerializable { + /* + * The object type, which is always list. + */ + @Generated + private final String object = "list"; + + /* + * The requested list of items. + */ + @Generated + private final List data; + + /* + * The first ID represented in this list. + */ + @Generated + private final String firstId; + + /* + * The last ID represented in this list. + */ + @Generated + private final String lastId; + + /* + * A value indicating whether there are additional values available not captured in this list. + */ + @Generated + private final boolean hasMore; + + /** + * Creates an instance of OpenAIPageableListOfVectorStoreFile class. + * + * @param data the data value to set. + * @param firstId the firstId value to set. + * @param lastId the lastId value to set. + * @param hasMore the hasMore value to set. + */ + @Generated + private OpenAIPageableListOfVectorStoreFile(List data, String firstId, String lastId, + boolean hasMore) { + this.data = data; + this.firstId = firstId; + this.lastId = lastId; + this.hasMore = hasMore; + } + + /** + * Get the object property: The object type, which is always list. + * + * @return the object value. + */ + @Generated + public String getObject() { + return this.object; + } + + /** + * Get the data property: The requested list of items. + * + * @return the data value. + */ + @Generated + public List getData() { + return this.data; + } + + /** + * Get the firstId property: The first ID represented in this list. + * + * @return the firstId value. + */ + @Generated + public String getFirstId() { + return this.firstId; + } + + /** + * Get the lastId property: The last ID represented in this list. + * + * @return the lastId value. + */ + @Generated + public String getLastId() { + return this.lastId; + } + + /** + * Get the hasMore property: A value indicating whether there are additional values available not captured in this + * list. + * + * @return the hasMore value. + */ + @Generated + public boolean isHasMore() { + return this.hasMore; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("object", this.object); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("first_id", this.firstId); + jsonWriter.writeStringField("last_id", this.lastId); + jsonWriter.writeBooleanField("has_more", this.hasMore); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenAIPageableListOfVectorStoreFile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenAIPageableListOfVectorStoreFile if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OpenAIPageableListOfVectorStoreFile. + */ + @Generated + public static OpenAIPageableListOfVectorStoreFile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List data = null; + String firstId = null; + String lastId = null; + boolean hasMore = false; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("data".equals(fieldName)) { + data = reader.readArray(reader1 -> VectorStoreFile.fromJson(reader1)); + } else if ("first_id".equals(fieldName)) { + firstId = reader.getString(); + } else if ("last_id".equals(fieldName)) { + lastId = reader.getString(); + } else if ("has_more".equals(fieldName)) { + hasMore = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + return new OpenAIPageableListOfVectorStoreFile(data, firstId, lastId, hasMore); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ApiResponseFormat.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ApiResponseFormat.java new file mode 100644 index 0000000000000..c089c256ca2fc --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ApiResponseFormat.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Possible API response formats. + */ +public final class ApiResponseFormat extends ExpandableStringEnum { + /** + * `text` format should be used for requests involving any sort of ToolCall. + */ + @Generated + public static final ApiResponseFormat TEXT = fromString("text"); + + /** + * Using `json_object` format will limit the usage of ToolCall to only functions. + */ + @Generated + public static final ApiResponseFormat JSON_OBJECT = fromString("json_object"); + + /** + * Creates a new instance of ApiResponseFormat value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ApiResponseFormat() { + } + + /** + * Creates or finds a ApiResponseFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApiResponseFormat. + */ + @Generated + public static ApiResponseFormat fromString(String name) { + return fromString(name, ApiResponseFormat.class); + } + + /** + * Gets known ApiResponseFormat values. + * + * @return known ApiResponseFormat values. + */ + @Generated + public static Collection values() { + return values(ApiResponseFormat.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/Assistant.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/Assistant.java index 94a308c599bd9..0f7812c4e5395 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/Assistant.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/Assistant.java @@ -5,6 +5,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; +import com.azure.core.util.BinaryData; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -70,12 +71,6 @@ public final class Assistant implements JsonSerializable { @Generated private final List tools; - /* - * A list of attached file IDs, ordered by creation date in ascending order. - */ - @Generated - private final List fileIds; - /* * A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information * about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 @@ -164,16 +159,6 @@ public List getTools() { return this.tools; } - /** - * Get the fileIds property: A list of attached file IDs, ordered by creation date in ascending order. - * - * @return the fileIds value. - */ - @Generated - public List getFileIds() { - return this.fileIds; - } - /** * Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing * additional information about that object in a structured format. Keys may be up to 64 characters in length and @@ -186,37 +171,6 @@ public Map getMetadata() { return this.metadata; } - /** - * Creates an instance of Assistant class. - * - * @param id the id value to set. - * @param createdAt the createdAt value to set. - * @param name the name value to set. - * @param description the description value to set. - * @param model the model value to set. - * @param instructions the instructions value to set. - * @param tools the tools value to set. - * @param fileIds the fileIds value to set. - * @param metadata the metadata value to set. - */ - @Generated - private Assistant(String id, OffsetDateTime createdAt, String name, String description, String model, - String instructions, List tools, List fileIds, Map metadata) { - this.id = id; - if (createdAt == null) { - this.createdAt = 0L; - } else { - this.createdAt = createdAt.toEpochSecond(); - } - this.name = name; - this.description = description; - this.model = model; - this.instructions = instructions; - this.tools = tools; - this.fileIds = fileIds; - this.metadata = metadata; - } - /** * {@inheritDoc} */ @@ -232,8 +186,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("model", this.model); jsonWriter.writeStringField("instructions", this.instructions); jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("tool_resources", this.toolResources); + jsonWriter.writeNumberField("temperature", this.temperature); + jsonWriter.writeNumberField("top_p", this.topP); jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + if (this.responseFormat != null) { + jsonWriter.writeUntypedField("response_format", this.responseFormat.toObject(Object.class)); + } return jsonWriter.writeEndObject(); } @@ -256,8 +215,11 @@ public static Assistant fromJson(JsonReader jsonReader) throws IOException { String model = null; String instructions = null; List tools = null; - List fileIds = null; + ToolResources toolResources = null; + Double temperature = null; + Double topP = null; Map metadata = null; + BinaryData responseFormat = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -275,15 +237,140 @@ public static Assistant fromJson(JsonReader jsonReader) throws IOException { instructions = reader.getString(); } else if ("tools".equals(fieldName)) { tools = reader.readArray(reader1 -> ToolDefinition.fromJson(reader1)); - } else if ("file_ids".equals(fieldName)) { - fileIds = reader.readArray(reader1 -> reader1.getString()); + } else if ("tool_resources".equals(fieldName)) { + toolResources = ToolResources.fromJson(reader); + } else if ("temperature".equals(fieldName)) { + temperature = reader.getNullable(JsonReader::getDouble); + } else if ("top_p".equals(fieldName)) { + topP = reader.getNullable(JsonReader::getDouble); } else if ("metadata".equals(fieldName)) { metadata = reader.readMap(reader1 -> reader1.getString()); + } else if ("response_format".equals(fieldName)) { + responseFormat + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); } else { reader.skipChildren(); } } - return new Assistant(id, createdAt, name, description, model, instructions, tools, fileIds, metadata); + Assistant deserializedAssistant = new Assistant(id, createdAt, name, description, model, instructions, + tools, toolResources, temperature, topP, metadata); + deserializedAssistant.responseFormat = responseFormat; + return deserializedAssistant; }); } + + /* + * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For + * example, the `code_interpreter` + * tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + */ + @Generated + private final ToolResources toolResources; + + /* + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, + * while lower values like 0.2 will make it more focused and deterministic. + */ + @Generated + private final Double temperature; + + /* + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of + * the tokens with top_p probability mass. + * So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + */ + @Generated + private final Double topP; + + /* + * The response format of the tool calls used by this assistant. + */ + @Generated + private BinaryData responseFormat; + + /** + * Creates an instance of Assistant class. + * + * @param id the id value to set. + * @param createdAt the createdAt value to set. + * @param name the name value to set. + * @param description the description value to set. + * @param model the model value to set. + * @param instructions the instructions value to set. + * @param tools the tools value to set. + * @param toolResources the toolResources value to set. + * @param temperature the temperature value to set. + * @param topP the topP value to set. + * @param metadata the metadata value to set. + */ + @Generated + private Assistant(String id, OffsetDateTime createdAt, String name, String description, String model, + String instructions, List tools, ToolResources toolResources, Double temperature, Double topP, + Map metadata) { + this.id = id; + if (createdAt == null) { + this.createdAt = 0L; + } else { + this.createdAt = createdAt.toEpochSecond(); + } + this.name = name; + this.description = description; + this.model = model; + this.instructions = instructions; + this.tools = tools; + this.toolResources = toolResources; + this.temperature = temperature; + this.topP = topP; + this.metadata = metadata; + } + + /** + * Get the toolResources property: A set of resources that are used by the assistant's tools. The resources are + * specific to the type of tool. For example, the `code_interpreter` + * tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + * + * @return the toolResources value. + */ + @Generated + public ToolResources getToolResources() { + return this.toolResources; + } + + /** + * Get the temperature property: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make + * the output more random, + * while lower values like 0.2 will make it more focused and deterministic. + * + * @return the temperature value. + */ + @Generated + public Double getTemperature() { + return this.temperature; + } + + /** + * Get the topP property: An alternative to sampling with temperature, called nucleus sampling, where the model + * considers the results of the tokens with top_p probability mass. + * So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + * @return the topP value. + */ + @Generated + public Double getTopP() { + return this.topP; + } + + /** + * Get the responseFormat property: The response format of the tool calls used by this assistant. + * + * @return the responseFormat value. + */ + @Generated + public BinaryData getResponseFormat() { + return this.responseFormat; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantCreationOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantCreationOptions.java index 502d2a2c0326d..2aab64212f67c 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantCreationOptions.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantCreationOptions.java @@ -5,6 +5,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -49,12 +50,6 @@ public final class AssistantCreationOptions implements JsonSerializable tools; - /* - * A list of previously uploaded file IDs to attach to the assistant. - */ - @Generated - private List fileIds; - /* * A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information * about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 @@ -171,28 +166,6 @@ public AssistantCreationOptions setTools(List tools) { return this; } - /** - * Get the fileIds property: A list of previously uploaded file IDs to attach to the assistant. - * - * @return the fileIds value. - */ - @Generated - public List getFileIds() { - return this.fileIds; - } - - /** - * Set the fileIds property: A list of previously uploaded file IDs to attach to the assistant. - * - * @param fileIds the fileIds value to set. - * @return the AssistantCreationOptions object itself. - */ - @Generated - public AssistantCreationOptions setFileIds(List fileIds) { - this.fileIds = fileIds; - return this; - } - /** * Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing * additional information about that object in a structured format. Keys may be up to 64 characters in length and @@ -231,7 +204,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("description", this.description); jsonWriter.writeStringField("instructions", this.instructions); jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("tool_resources", this.toolResources); + jsonWriter.writeNumberField("temperature", this.temperature); + jsonWriter.writeNumberField("top_p", this.topP); + if (this.responseFormat != null) { + jsonWriter.writeUntypedField("response_format", this.responseFormat.toObject(Object.class)); + } jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -253,7 +231,10 @@ public static AssistantCreationOptions fromJson(JsonReader jsonReader) throws IO String description = null; String instructions = null; List tools = null; - List fileIds = null; + CreateToolResourcesOptions toolResources = null; + Double temperature = null; + Double topP = null; + BinaryData responseFormat = null; Map metadata = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -268,8 +249,15 @@ public static AssistantCreationOptions fromJson(JsonReader jsonReader) throws IO instructions = reader.getString(); } else if ("tools".equals(fieldName)) { tools = reader.readArray(reader1 -> ToolDefinition.fromJson(reader1)); - } else if ("file_ids".equals(fieldName)) { - fileIds = reader.readArray(reader1 -> reader1.getString()); + } else if ("tool_resources".equals(fieldName)) { + toolResources = CreateToolResourcesOptions.fromJson(reader); + } else if ("temperature".equals(fieldName)) { + temperature = reader.getNullable(JsonReader::getDouble); + } else if ("top_p".equals(fieldName)) { + topP = reader.getNullable(JsonReader::getDouble); + } else if ("response_format".equals(fieldName)) { + responseFormat + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); } else if ("metadata".equals(fieldName)) { metadata = reader.readMap(reader1 -> reader1.getString()); } else { @@ -281,9 +269,147 @@ public static AssistantCreationOptions fromJson(JsonReader jsonReader) throws IO deserializedAssistantCreationOptions.description = description; deserializedAssistantCreationOptions.instructions = instructions; deserializedAssistantCreationOptions.tools = tools; - deserializedAssistantCreationOptions.fileIds = fileIds; + deserializedAssistantCreationOptions.toolResources = toolResources; + deserializedAssistantCreationOptions.temperature = temperature; + deserializedAssistantCreationOptions.topP = topP; + deserializedAssistantCreationOptions.responseFormat = responseFormat; deserializedAssistantCreationOptions.metadata = metadata; return deserializedAssistantCreationOptions; }); } + + /* + * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For + * example, the `code_interpreter` + * tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + */ + @Generated + private CreateToolResourcesOptions toolResources; + + /* + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, + * while lower values like 0.2 will make it more focused and deterministic. + */ + @Generated + private Double temperature; + + /* + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of + * the tokens with top_p probability mass. + * So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + */ + @Generated + private Double topP; + + /* + * The response format of the tool calls used by this assistant. + */ + @Generated + private BinaryData responseFormat; + + /** + * Get the toolResources property: A set of resources that are used by the assistant's tools. The resources are + * specific to the type of tool. For example, the `code_interpreter` + * tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + * + * @return the toolResources value. + */ + @Generated + public CreateToolResourcesOptions getToolResources() { + return this.toolResources; + } + + /** + * Set the toolResources property: A set of resources that are used by the assistant's tools. The resources are + * specific to the type of tool. For example, the `code_interpreter` + * tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + * + * @param toolResources the toolResources value to set. + * @return the AssistantCreationOptions object itself. + */ + @Generated + public AssistantCreationOptions setToolResources(CreateToolResourcesOptions toolResources) { + this.toolResources = toolResources; + return this; + } + + /** + * Get the temperature property: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make + * the output more random, + * while lower values like 0.2 will make it more focused and deterministic. + * + * @return the temperature value. + */ + @Generated + public Double getTemperature() { + return this.temperature; + } + + /** + * Set the temperature property: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make + * the output more random, + * while lower values like 0.2 will make it more focused and deterministic. + * + * @param temperature the temperature value to set. + * @return the AssistantCreationOptions object itself. + */ + @Generated + public AssistantCreationOptions setTemperature(Double temperature) { + this.temperature = temperature; + return this; + } + + /** + * Get the topP property: An alternative to sampling with temperature, called nucleus sampling, where the model + * considers the results of the tokens with top_p probability mass. + * So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + * @return the topP value. + */ + @Generated + public Double getTopP() { + return this.topP; + } + + /** + * Set the topP property: An alternative to sampling with temperature, called nucleus sampling, where the model + * considers the results of the tokens with top_p probability mass. + * So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + * @param topP the topP value to set. + * @return the AssistantCreationOptions object itself. + */ + @Generated + public AssistantCreationOptions setTopP(Double topP) { + this.topP = topP; + return this; + } + + /** + * Get the responseFormat property: The response format of the tool calls used by this assistant. + * + * @return the responseFormat value. + */ + @Generated + public BinaryData getResponseFormat() { + return this.responseFormat; + } + + /** + * Set the responseFormat property: The response format of the tool calls used by this assistant. + * + * @param responseFormat the responseFormat value to set. + * @return the AssistantCreationOptions object itself. + */ + @Generated + public AssistantCreationOptions setResponseFormat(BinaryData responseFormat) { + this.responseFormat = responseFormat; + return this; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantThread.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantThread.java index cb245bcd0662c..e016e1ac24303 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantThread.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantThread.java @@ -89,24 +89,6 @@ public Map getMetadata() { return this.metadata; } - /** - * Creates an instance of AssistantThread class. - * - * @param id the id value to set. - * @param createdAt the createdAt value to set. - * @param metadata the metadata value to set. - */ - @Generated - private AssistantThread(String id, OffsetDateTime createdAt, Map metadata) { - this.id = id; - if (createdAt == null) { - this.createdAt = 0L; - } else { - this.createdAt = createdAt.toEpochSecond(); - } - this.metadata = metadata; - } - /** * {@inheritDoc} */ @@ -117,6 +99,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("id", this.id); jsonWriter.writeStringField("object", this.object); jsonWriter.writeLongField("created_at", this.createdAt); + jsonWriter.writeJsonField("tool_resources", this.toolResources); jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -135,6 +118,7 @@ public static AssistantThread fromJson(JsonReader jsonReader) throws IOException return jsonReader.readObject(reader -> { String id = null; OffsetDateTime createdAt = null; + ToolResources toolResources = null; Map metadata = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -143,13 +127,60 @@ public static AssistantThread fromJson(JsonReader jsonReader) throws IOException id = reader.getString(); } else if ("created_at".equals(fieldName)) { createdAt = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else if ("tool_resources".equals(fieldName)) { + toolResources = ToolResources.fromJson(reader); } else if ("metadata".equals(fieldName)) { metadata = reader.readMap(reader1 -> reader1.getString()); } else { reader.skipChildren(); } } - return new AssistantThread(id, createdAt, metadata); + return new AssistantThread(id, createdAt, toolResources, metadata); }); } + + /* + * A set of resources that are made available to the assistant's tools in this thread. The resources are specific to + * the type + * of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool + * requires a list + * of vector store IDs. + */ + @Generated + private final ToolResources toolResources; + + /** + * Creates an instance of AssistantThread class. + * + * @param id the id value to set. + * @param createdAt the createdAt value to set. + * @param toolResources the toolResources value to set. + * @param metadata the metadata value to set. + */ + @Generated + private AssistantThread(String id, OffsetDateTime createdAt, ToolResources toolResources, + Map metadata) { + this.id = id; + if (createdAt == null) { + this.createdAt = 0L; + } else { + this.createdAt = createdAt.toEpochSecond(); + } + this.toolResources = toolResources; + this.metadata = metadata; + } + + /** + * Get the toolResources property: A set of resources that are made available to the assistant's tools in this + * thread. The resources are specific to the type + * of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool + * requires a list + * of vector store IDs. + * + * @return the toolResources value. + */ + @Generated + public ToolResources getToolResources() { + return this.toolResources; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantThreadCreationOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantThreadCreationOptions.java index bbfdb8b395d5d..aadd01b20cfbf 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantThreadCreationOptions.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantThreadCreationOptions.java @@ -23,7 +23,7 @@ public final class AssistantThreadCreationOptions implements JsonSerializable messages; + private List messages; /* * A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information @@ -46,7 +46,7 @@ public AssistantThreadCreationOptions() { * @return the messages value. */ @Generated - public List getMessages() { + public List getMessages() { return this.messages; } @@ -57,7 +57,7 @@ public List getMessages() { * @return the AssistantThreadCreationOptions object itself. */ @Generated - public AssistantThreadCreationOptions setMessages(List messages) { + public AssistantThreadCreationOptions setMessages(List messages) { this.messages = messages; return this; } @@ -96,6 +96,7 @@ public AssistantThreadCreationOptions setMetadata(Map metadata) public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("messages", this.messages, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("tool_resources", this.toolResources); jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -117,9 +118,12 @@ public static AssistantThreadCreationOptions fromJson(JsonReader jsonReader) thr String fieldName = reader.getFieldName(); reader.nextToken(); if ("messages".equals(fieldName)) { - List messages - = reader.readArray(reader1 -> ThreadInitializationMessage.fromJson(reader1)); + List messages + = reader.readArray(reader1 -> ThreadMessageOptions.fromJson(reader1)); deserializedAssistantThreadCreationOptions.messages = messages; + } else if ("tool_resources".equals(fieldName)) { + deserializedAssistantThreadCreationOptions.toolResources + = CreateToolResourcesOptions.fromJson(reader); } else if ("metadata".equals(fieldName)) { Map metadata = reader.readMap(reader1 -> reader1.getString()); deserializedAssistantThreadCreationOptions.metadata = metadata; @@ -130,4 +134,44 @@ public static AssistantThreadCreationOptions fromJson(JsonReader jsonReader) thr return deserializedAssistantThreadCreationOptions; }); } + + /* + * A set of resources that are made available to the assistant's tools in this thread. The resources are specific to + * the + * type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool + * requires + * a list of vector store IDs. + */ + @Generated + private CreateToolResourcesOptions toolResources; + + /** + * Get the toolResources property: A set of resources that are made available to the assistant's tools in this + * thread. The resources are specific to the + * type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool + * requires + * a list of vector store IDs. + * + * @return the toolResources value. + */ + @Generated + public CreateToolResourcesOptions getToolResources() { + return this.toolResources; + } + + /** + * Set the toolResources property: A set of resources that are made available to the assistant's tools in this + * thread. The resources are specific to the + * type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool + * requires + * a list of vector store IDs. + * + * @param toolResources the toolResources value to set. + * @return the AssistantThreadCreationOptions object itself. + */ + @Generated + public AssistantThreadCreationOptions setToolResources(CreateToolResourcesOptions toolResources) { + this.toolResources = toolResources; + return this; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormat.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormat.java new file mode 100644 index 0000000000000..81786589ebbcf --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormat.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An object describing the expected output of the model. If `json_object` only `function` type `tools` are allowed to + * be passed to the Run. + * If `text` the model can return text or any value needed. + */ +@Fluent +public final class AssistantsApiResponseFormat implements JsonSerializable { + /* + * Must be one of `text` or `json_object`. + */ + @Generated + private ApiResponseFormat type; + + /** + * Creates an instance of AssistantsApiResponseFormat class. + */ + @Generated + public AssistantsApiResponseFormat() { + } + + /** + * Get the type property: Must be one of `text` or `json_object`. + * + * @return the type value. + */ + @Generated + public ApiResponseFormat getType() { + return this.type; + } + + /** + * Set the type property: Must be one of `text` or `json_object`. + * + * @param type the type value to set. + * @return the AssistantsApiResponseFormat object itself. + */ + @Generated + public AssistantsApiResponseFormat setType(ApiResponseFormat type) { + this.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssistantsApiResponseFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssistantsApiResponseFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AssistantsApiResponseFormat. + */ + @Generated + public static AssistantsApiResponseFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssistantsApiResponseFormat deserializedAssistantsApiResponseFormat = new AssistantsApiResponseFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAssistantsApiResponseFormat.type = ApiResponseFormat.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAssistantsApiResponseFormat; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatMode.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatMode.java new file mode 100644 index 0000000000000..5e6cb213a0d6f --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatMode.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents the mode in which the model will handle the return format of a tool call. + */ +public final class AssistantsApiResponseFormatMode extends ExpandableStringEnum { + /** + * Default value. Let the model handle the return format. + */ + @Generated + public static final AssistantsApiResponseFormatMode AUTO = fromString("auto"); + + /** + * Setting the value to `none`, will result in a 400 Bad request. + */ + @Generated + public static final AssistantsApiResponseFormatMode NONE = fromString("none"); + + /** + * Creates a new instance of AssistantsApiResponseFormatMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AssistantsApiResponseFormatMode() { + } + + /** + * Creates or finds a AssistantsApiResponseFormatMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssistantsApiResponseFormatMode. + */ + @Generated + public static AssistantsApiResponseFormatMode fromString(String name) { + return fromString(name, AssistantsApiResponseFormatMode.class); + } + + /** + * Gets known AssistantsApiResponseFormatMode values. + * + * @return known AssistantsApiResponseFormatMode values. + */ + @Generated + public static Collection values() { + return values(AssistantsApiResponseFormatMode.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiToolChoiceOptionMode.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiToolChoiceOptionMode.java new file mode 100644 index 0000000000000..11f53408bc58a --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiToolChoiceOptionMode.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies how the tool choice will be used. + */ +public final class AssistantsApiToolChoiceOptionMode extends ExpandableStringEnum { + /** + * The model will not call a function and instead generates a message. + */ + @Generated + public static final AssistantsApiToolChoiceOptionMode NONE = fromString("none"); + + /** + * The model can pick between generating a message or calling a function. + */ + @Generated + public static final AssistantsApiToolChoiceOptionMode AUTO = fromString("auto"); + + /** + * Creates a new instance of AssistantsApiToolChoiceOptionMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AssistantsApiToolChoiceOptionMode() { + } + + /** + * Creates or finds a AssistantsApiToolChoiceOptionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssistantsApiToolChoiceOptionMode. + */ + @Generated + public static AssistantsApiToolChoiceOptionMode fromString(String name) { + return fromString(name, AssistantsApiToolChoiceOptionMode.class); + } + + /** + * Gets known AssistantsApiToolChoiceOptionMode values. + * + * @return known AssistantsApiToolChoiceOptionMode values. + */ + @Generated + public static Collection values() { + return values(AssistantsApiToolChoiceOptionMode.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsNamedToolChoice.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsNamedToolChoice.java new file mode 100644 index 0000000000000..b3e866d99bc73 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsNamedToolChoice.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies a tool the model should use. Use to force the model to call a specific tool. + */ +@Fluent +public final class AssistantsNamedToolChoice implements JsonSerializable { + /* + * the type of tool. If type is `function`, the function name must be set. + */ + @Generated + private final AssistantsNamedToolChoiceType type; + + /* + * The name of the function to call + */ + @Generated + private FunctionName function; + + /** + * Creates an instance of AssistantsNamedToolChoice class. + * + * @param type the type value to set. + */ + @Generated + public AssistantsNamedToolChoice(AssistantsNamedToolChoiceType type) { + this.type = type; + } + + /** + * Get the type property: the type of tool. If type is `function`, the function name must be set. + * + * @return the type value. + */ + @Generated + public AssistantsNamedToolChoiceType getType() { + return this.type; + } + + /** + * Get the function property: The name of the function to call. + * + * @return the function value. + */ + @Generated + public FunctionName getFunction() { + return this.function; + } + + /** + * Set the function property: The name of the function to call. + * + * @param function the function value to set. + * @return the AssistantsNamedToolChoice object itself. + */ + @Generated + public AssistantsNamedToolChoice setFunction(FunctionName function) { + this.function = function; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("function", this.function); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssistantsNamedToolChoice from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssistantsNamedToolChoice if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AssistantsNamedToolChoice. + */ + @Generated + public static AssistantsNamedToolChoice fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssistantsNamedToolChoiceType type = null; + FunctionName function = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + type = AssistantsNamedToolChoiceType.fromString(reader.getString()); + } else if ("function".equals(fieldName)) { + function = FunctionName.fromJson(reader); + } else { + reader.skipChildren(); + } + } + AssistantsNamedToolChoice deserializedAssistantsNamedToolChoice = new AssistantsNamedToolChoice(type); + deserializedAssistantsNamedToolChoice.function = function; + + return deserializedAssistantsNamedToolChoice; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsNamedToolChoiceType.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsNamedToolChoiceType.java new file mode 100644 index 0000000000000..3edcae35b0914 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsNamedToolChoiceType.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Available tool types for assistants named tools. + */ +public final class AssistantsNamedToolChoiceType extends ExpandableStringEnum { + /** + * Tool type `function`. + */ + @Generated + public static final AssistantsNamedToolChoiceType FUNCTION = fromString("function"); + + /** + * Tool type `code_interpreter`. + */ + @Generated + public static final AssistantsNamedToolChoiceType CODE_INTERPRETER = fromString("code_interpreter"); + + /** + * Tool type `file_search`. + */ + @Generated + public static final AssistantsNamedToolChoiceType FILE_SEARCH = fromString("file_search"); + + /** + * Creates a new instance of AssistantsNamedToolChoiceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AssistantsNamedToolChoiceType() { + } + + /** + * Creates or finds a AssistantsNamedToolChoiceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssistantsNamedToolChoiceType. + */ + @Generated + public static AssistantsNamedToolChoiceType fromString(String name) { + return fromString(name, AssistantsNamedToolChoiceType.class); + } + + /** + * Gets known AssistantsNamedToolChoiceType values. + * + * @return known AssistantsNamedToolChoiceType values. + */ + @Generated + public static Collection values() { + return values(AssistantsNamedToolChoiceType.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CodeInterpreterToolResource.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CodeInterpreterToolResource.java new file mode 100644 index 0000000000000..3a461942906da --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CodeInterpreterToolResource.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A set of resources that are used by the `code_interpreter` tool. + */ +@Immutable +public final class CodeInterpreterToolResource implements JsonSerializable { + /* + * A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files + * associated with the tool. + */ + @Generated + private final List fileIds; + + /** + * Creates an instance of CodeInterpreterToolResource class. + * + * @param fileIds the fileIds value to set. + */ + @Generated + private CodeInterpreterToolResource(List fileIds) { + this.fileIds = fileIds; + } + + /** + * Get the fileIds property: A list of file IDs made available to the `code_interpreter` tool. There can be a + * maximum of 20 files + * associated with the tool. + * + * @return the fileIds value. + */ + @Generated + public List getFileIds() { + return this.fileIds; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeInterpreterToolResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeInterpreterToolResource if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodeInterpreterToolResource. + */ + @Generated + public static CodeInterpreterToolResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List fileIds = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("file_ids".equals(fieldName)) { + fileIds = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + return new CodeInterpreterToolResource(fileIds); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateAndRunThreadOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateAndRunThreadOptions.java index ac2216365d28b..330e61e05a142 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateAndRunThreadOptions.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateAndRunThreadOptions.java @@ -5,6 +5,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -205,7 +206,19 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("model", this.model); jsonWriter.writeStringField("instructions", this.instructions); jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("tool_resources", this.toolResources); jsonWriter.writeBooleanField("stream", this.stream); + jsonWriter.writeNumberField("temperature", this.temperature); + jsonWriter.writeNumberField("top_p", this.topP); + jsonWriter.writeNumberField("max_prompt_tokens", this.maxPromptTokens); + jsonWriter.writeNumberField("max_completion_tokens", this.maxCompletionTokens); + jsonWriter.writeJsonField("truncation_strategy", this.truncationStrategy); + if (this.toolChoice != null) { + jsonWriter.writeUntypedField("tool_choice", this.toolChoice.toObject(Object.class)); + } + if (this.responseFormat != null) { + jsonWriter.writeUntypedField("response_format", this.responseFormat.toObject(Object.class)); + } jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -227,7 +240,15 @@ public static CreateAndRunThreadOptions fromJson(JsonReader jsonReader) throws I String model = null; String instructions = null; List tools = null; + UpdateToolResourcesOptions toolResources = null; Boolean stream = null; + Double temperature = null; + Double topP = null; + Integer maxPromptTokens = null; + Integer maxCompletionTokens = null; + TruncationObject truncationStrategy = null; + BinaryData toolChoice = null; + BinaryData responseFormat = null; Map metadata = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -242,8 +263,26 @@ public static CreateAndRunThreadOptions fromJson(JsonReader jsonReader) throws I instructions = reader.getString(); } else if ("tools".equals(fieldName)) { tools = reader.readArray(reader1 -> ToolDefinition.fromJson(reader1)); + } else if ("tool_resources".equals(fieldName)) { + toolResources = UpdateToolResourcesOptions.fromJson(reader); } else if ("stream".equals(fieldName)) { stream = reader.getNullable(JsonReader::getBoolean); + } else if ("temperature".equals(fieldName)) { + temperature = reader.getNullable(JsonReader::getDouble); + } else if ("top_p".equals(fieldName)) { + topP = reader.getNullable(JsonReader::getDouble); + } else if ("max_prompt_tokens".equals(fieldName)) { + maxPromptTokens = reader.getNullable(JsonReader::getInt); + } else if ("max_completion_tokens".equals(fieldName)) { + maxCompletionTokens = reader.getNullable(JsonReader::getInt); + } else if ("truncation_strategy".equals(fieldName)) { + truncationStrategy = TruncationObject.fromJson(reader); + } else if ("tool_choice".equals(fieldName)) { + toolChoice + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else if ("response_format".equals(fieldName)) { + responseFormat + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); } else if ("metadata".equals(fieldName)) { metadata = reader.readMap(reader1 -> reader1.getString()); } else { @@ -256,7 +295,15 @@ public static CreateAndRunThreadOptions fromJson(JsonReader jsonReader) throws I deserializedCreateAndRunThreadOptions.model = model; deserializedCreateAndRunThreadOptions.instructions = instructions; deserializedCreateAndRunThreadOptions.tools = tools; + deserializedCreateAndRunThreadOptions.toolResources = toolResources; deserializedCreateAndRunThreadOptions.stream = stream; + deserializedCreateAndRunThreadOptions.temperature = temperature; + deserializedCreateAndRunThreadOptions.topP = topP; + deserializedCreateAndRunThreadOptions.maxPromptTokens = maxPromptTokens; + deserializedCreateAndRunThreadOptions.maxCompletionTokens = maxCompletionTokens; + deserializedCreateAndRunThreadOptions.truncationStrategy = truncationStrategy; + deserializedCreateAndRunThreadOptions.toolChoice = toolChoice; + deserializedCreateAndRunThreadOptions.responseFormat = responseFormat; deserializedCreateAndRunThreadOptions.metadata = metadata; return deserializedCreateAndRunThreadOptions; }); @@ -290,4 +337,274 @@ CreateAndRunThreadOptions setStream(Boolean stream) { this.stream = stream; return this; } + + /* + * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run + * basis. + */ + @Generated + private UpdateToolResourcesOptions toolResources; + + /* + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output + * more random, while lower values like 0.2 will make it more focused and deterministic. + */ + @Generated + private Double temperature; + + /* + * An alternative to sampling with temperature, called nucleus sampling, where the model + * considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens + * comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + */ + @Generated + private Double topP; + + /* + * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort + * to use only + * the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt + * tokens specified, + * the run will end with status `incomplete`. See `incomplete_details` for more info. + */ + @Generated + private Integer maxPromptTokens; + + /* + * The maximum number of completion tokens that may be used over the course of the run. The run will make a best + * effort to use only + * the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of + * completion tokens + * specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + */ + @Generated + private Integer maxCompletionTokens; + + /* + * The strategy to use for dropping messages as the context windows moves forward. + */ + @Generated + private TruncationObject truncationStrategy; + + /* + * Controls whether or not and which tool is called by the model. + */ + @Generated + private BinaryData toolChoice; + + /* + * Specifies the format that the model must output. + */ + @Generated + private BinaryData responseFormat; + + /** + * Get the toolResources property: Override the tools the assistant can use for this run. This is useful for + * modifying the behavior on a per-run basis. + * + * @return the toolResources value. + */ + @Generated + public UpdateToolResourcesOptions getToolResources() { + return this.toolResources; + } + + /** + * Set the toolResources property: Override the tools the assistant can use for this run. This is useful for + * modifying the behavior on a per-run basis. + * + * @param toolResources the toolResources value to set. + * @return the CreateAndRunThreadOptions object itself. + */ + @Generated + public CreateAndRunThreadOptions setToolResources(UpdateToolResourcesOptions toolResources) { + this.toolResources = toolResources; + return this; + } + + /** + * Get the temperature property: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make + * the output + * more random, while lower values like 0.2 will make it more focused and deterministic. + * + * @return the temperature value. + */ + @Generated + public Double getTemperature() { + return this.temperature; + } + + /** + * Set the temperature property: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make + * the output + * more random, while lower values like 0.2 will make it more focused and deterministic. + * + * @param temperature the temperature value to set. + * @return the CreateAndRunThreadOptions object itself. + */ + @Generated + public CreateAndRunThreadOptions setTemperature(Double temperature) { + this.temperature = temperature; + return this; + } + + /** + * Get the topP property: An alternative to sampling with temperature, called nucleus sampling, where the model + * considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens + * comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + * @return the topP value. + */ + @Generated + public Double getTopP() { + return this.topP; + } + + /** + * Set the topP property: An alternative to sampling with temperature, called nucleus sampling, where the model + * considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens + * comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + * @param topP the topP value to set. + * @return the CreateAndRunThreadOptions object itself. + */ + @Generated + public CreateAndRunThreadOptions setTopP(Double topP) { + this.topP = topP; + return this; + } + + /** + * Get the maxPromptTokens property: The maximum number of prompt tokens that may be used over the course of the + * run. The run will make a best effort to use only + * the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt + * tokens specified, + * the run will end with status `incomplete`. See `incomplete_details` for more info. + * + * @return the maxPromptTokens value. + */ + @Generated + public Integer getMaxPromptTokens() { + return this.maxPromptTokens; + } + + /** + * Set the maxPromptTokens property: The maximum number of prompt tokens that may be used over the course of the + * run. The run will make a best effort to use only + * the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt + * tokens specified, + * the run will end with status `incomplete`. See `incomplete_details` for more info. + * + * @param maxPromptTokens the maxPromptTokens value to set. + * @return the CreateAndRunThreadOptions object itself. + */ + @Generated + public CreateAndRunThreadOptions setMaxPromptTokens(Integer maxPromptTokens) { + this.maxPromptTokens = maxPromptTokens; + return this; + } + + /** + * Get the maxCompletionTokens property: The maximum number of completion tokens that may be used over the course of + * the run. The run will make a best effort to use only + * the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of + * completion tokens + * specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + * + * @return the maxCompletionTokens value. + */ + @Generated + public Integer getMaxCompletionTokens() { + return this.maxCompletionTokens; + } + + /** + * Set the maxCompletionTokens property: The maximum number of completion tokens that may be used over the course of + * the run. The run will make a best effort to use only + * the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of + * completion tokens + * specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + * + * @param maxCompletionTokens the maxCompletionTokens value to set. + * @return the CreateAndRunThreadOptions object itself. + */ + @Generated + public CreateAndRunThreadOptions setMaxCompletionTokens(Integer maxCompletionTokens) { + this.maxCompletionTokens = maxCompletionTokens; + return this; + } + + /** + * Get the truncationStrategy property: The strategy to use for dropping messages as the context windows moves + * forward. + * + * @return the truncationStrategy value. + */ + @Generated + public TruncationObject getTruncationStrategy() { + return this.truncationStrategy; + } + + /** + * Set the truncationStrategy property: The strategy to use for dropping messages as the context windows moves + * forward. + * + * @param truncationStrategy the truncationStrategy value to set. + * @return the CreateAndRunThreadOptions object itself. + */ + @Generated + public CreateAndRunThreadOptions setTruncationStrategy(TruncationObject truncationStrategy) { + this.truncationStrategy = truncationStrategy; + return this; + } + + /** + * Get the toolChoice property: Controls whether or not and which tool is called by the model. + * + * @return the toolChoice value. + */ + @Generated + public BinaryData getToolChoice() { + return this.toolChoice; + } + + /** + * Set the toolChoice property: Controls whether or not and which tool is called by the model. + * + * @param toolChoice the toolChoice value to set. + * @return the CreateAndRunThreadOptions object itself. + */ + @Generated + public CreateAndRunThreadOptions setToolChoice(BinaryData toolChoice) { + this.toolChoice = toolChoice; + return this; + } + + /** + * Get the responseFormat property: Specifies the format that the model must output. + * + * @return the responseFormat value. + */ + @Generated + public BinaryData getResponseFormat() { + return this.responseFormat; + } + + /** + * Set the responseFormat property: Specifies the format that the model must output. + * + * @param responseFormat the responseFormat value to set. + * @return the CreateAndRunThreadOptions object itself. + */ + @Generated + public CreateAndRunThreadOptions setResponseFormat(BinaryData responseFormat) { + this.responseFormat = responseFormat; + return this; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateCodeInterpreterToolResourceOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateCodeInterpreterToolResourceOptions.java new file mode 100644 index 0000000000000..9b535f5b52914 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateCodeInterpreterToolResourceOptions.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A set of resources that will be used by the `code_interpreter` tool. Request object. + */ +@Fluent +public final class CreateCodeInterpreterToolResourceOptions + implements JsonSerializable { + /* + * A list of file IDs made available to the `code_interpreter` tool. + */ + @Generated + private List fileIds; + + /** + * Creates an instance of CreateCodeInterpreterToolResourceOptions class. + */ + @Generated + public CreateCodeInterpreterToolResourceOptions() { + } + + /** + * Get the fileIds property: A list of file IDs made available to the `code_interpreter` tool. + * + * @return the fileIds value. + */ + @Generated + public List getFileIds() { + return this.fileIds; + } + + /** + * Set the fileIds property: A list of file IDs made available to the `code_interpreter` tool. + * + * @param fileIds the fileIds value to set. + * @return the CreateCodeInterpreterToolResourceOptions object itself. + */ + @Generated + public CreateCodeInterpreterToolResourceOptions setFileIds(List fileIds) { + this.fileIds = fileIds; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateCodeInterpreterToolResourceOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateCodeInterpreterToolResourceOptions if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CreateCodeInterpreterToolResourceOptions. + */ + @Generated + public static CreateCodeInterpreterToolResourceOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateCodeInterpreterToolResourceOptions deserializedCreateCodeInterpreterToolResourceOptions + = new CreateCodeInterpreterToolResourceOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("file_ids".equals(fieldName)) { + List fileIds = reader.readArray(reader1 -> reader1.getString()); + deserializedCreateCodeInterpreterToolResourceOptions.fileIds = fileIds; + } else { + reader.skipChildren(); + } + } + + return deserializedCreateCodeInterpreterToolResourceOptions; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateFileSearchToolResourceVectorStoreOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateFileSearchToolResourceVectorStoreOptions.java new file mode 100644 index 0000000000000..393cc9803cacc --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateFileSearchToolResourceVectorStoreOptions.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * File IDs associated to the vector store to be passed to the helper. + */ +@Fluent +public final class CreateFileSearchToolResourceVectorStoreOptions + implements JsonSerializable { + /* + * A list of file IDs to add to the vector store. There can be a maximum of 10000 files in a vector store. + */ + @Generated + private final List fileIds; + + /* + * A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information + * about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 + * characters in length. + */ + @Generated + private Map metadata; + + /** + * Creates an instance of CreateFileSearchToolResourceVectorStoreOptions class. + * + * @param fileIds the fileIds value to set. + */ + @Generated + public CreateFileSearchToolResourceVectorStoreOptions(List fileIds) { + this.fileIds = fileIds; + } + + /** + * Get the fileIds property: A list of file IDs to add to the vector store. There can be a maximum of 10000 files in + * a vector store. + * + * @return the fileIds value. + */ + @Generated + public List getFileIds() { + return this.fileIds; + } + + /** + * Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing + * additional information about that object in a structured format. Keys may be up to 64 characters in length and + * values may be up to 512 characters in length. + * + * @return the metadata value. + */ + @Generated + public Map getMetadata() { + return this.metadata; + } + + /** + * Set the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing + * additional information about that object in a structured format. Keys may be up to 64 characters in length and + * values may be up to 512 characters in length. + * + * @param metadata the metadata value to set. + * @return the CreateFileSearchToolResourceVectorStoreOptions object itself. + */ + @Generated + public CreateFileSearchToolResourceVectorStoreOptions setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateFileSearchToolResourceVectorStoreOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateFileSearchToolResourceVectorStoreOptions if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CreateFileSearchToolResourceVectorStoreOptions. + */ + @Generated + public static CreateFileSearchToolResourceVectorStoreOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List fileIds = null; + Map metadata = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("file_ids".equals(fieldName)) { + fileIds = reader.readArray(reader1 -> reader1.getString()); + } else if ("metadata".equals(fieldName)) { + metadata = reader.readMap(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + CreateFileSearchToolResourceVectorStoreOptions deserializedCreateFileSearchToolResourceVectorStoreOptions + = new CreateFileSearchToolResourceVectorStoreOptions(fileIds); + deserializedCreateFileSearchToolResourceVectorStoreOptions.metadata = metadata; + + return deserializedCreateFileSearchToolResourceVectorStoreOptions; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateRunOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateRunOptions.java index 1b3a731da8709..5120078392cc8 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateRunOptions.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateRunOptions.java @@ -5,6 +5,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -210,8 +211,21 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("model", this.model); jsonWriter.writeStringField("instructions", this.instructions); jsonWriter.writeStringField("additional_instructions", this.additionalInstructions); + jsonWriter.writeArrayField("additional_messages", this.additionalMessages, + (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); jsonWriter.writeBooleanField("stream", this.stream); + jsonWriter.writeNumberField("temperature", this.temperature); + jsonWriter.writeNumberField("top_p", this.topP); + jsonWriter.writeNumberField("max_prompt_tokens", this.maxPromptTokens); + jsonWriter.writeNumberField("max_completion_tokens", this.maxCompletionTokens); + jsonWriter.writeJsonField("truncation_strategy", this.truncationStrategy); + if (this.toolChoice != null) { + jsonWriter.writeUntypedField("tool_choice", this.toolChoice.toObject(Object.class)); + } + if (this.responseFormat != null) { + jsonWriter.writeUntypedField("response_format", this.responseFormat.toObject(Object.class)); + } jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -232,8 +246,16 @@ public static CreateRunOptions fromJson(JsonReader jsonReader) throws IOExceptio String model = null; String instructions = null; String additionalInstructions = null; + List additionalMessages = null; List tools = null; Boolean stream = null; + Double temperature = null; + Double topP = null; + Integer maxPromptTokens = null; + Integer maxCompletionTokens = null; + TruncationObject truncationStrategy = null; + BinaryData toolChoice = null; + BinaryData responseFormat = null; Map metadata = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -246,10 +268,28 @@ public static CreateRunOptions fromJson(JsonReader jsonReader) throws IOExceptio instructions = reader.getString(); } else if ("additional_instructions".equals(fieldName)) { additionalInstructions = reader.getString(); + } else if ("additional_messages".equals(fieldName)) { + additionalMessages = reader.readArray(reader1 -> ThreadMessage.fromJson(reader1)); } else if ("tools".equals(fieldName)) { tools = reader.readArray(reader1 -> ToolDefinition.fromJson(reader1)); } else if ("stream".equals(fieldName)) { stream = reader.getNullable(JsonReader::getBoolean); + } else if ("temperature".equals(fieldName)) { + temperature = reader.getNullable(JsonReader::getDouble); + } else if ("top_p".equals(fieldName)) { + topP = reader.getNullable(JsonReader::getDouble); + } else if ("max_prompt_tokens".equals(fieldName)) { + maxPromptTokens = reader.getNullable(JsonReader::getInt); + } else if ("max_completion_tokens".equals(fieldName)) { + maxCompletionTokens = reader.getNullable(JsonReader::getInt); + } else if ("truncation_strategy".equals(fieldName)) { + truncationStrategy = TruncationObject.fromJson(reader); + } else if ("tool_choice".equals(fieldName)) { + toolChoice + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else if ("response_format".equals(fieldName)) { + responseFormat + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); } else if ("metadata".equals(fieldName)) { metadata = reader.readMap(reader1 -> reader1.getString()); } else { @@ -260,8 +300,16 @@ public static CreateRunOptions fromJson(JsonReader jsonReader) throws IOExceptio deserializedCreateRunOptions.model = model; deserializedCreateRunOptions.instructions = instructions; deserializedCreateRunOptions.additionalInstructions = additionalInstructions; + deserializedCreateRunOptions.additionalMessages = additionalMessages; deserializedCreateRunOptions.tools = tools; deserializedCreateRunOptions.stream = stream; + deserializedCreateRunOptions.temperature = temperature; + deserializedCreateRunOptions.topP = topP; + deserializedCreateRunOptions.maxPromptTokens = maxPromptTokens; + deserializedCreateRunOptions.maxCompletionTokens = maxCompletionTokens; + deserializedCreateRunOptions.truncationStrategy = truncationStrategy; + deserializedCreateRunOptions.toolChoice = toolChoice; + deserializedCreateRunOptions.responseFormat = responseFormat; deserializedCreateRunOptions.metadata = metadata; return deserializedCreateRunOptions; }); @@ -295,4 +343,271 @@ CreateRunOptions setStream(Boolean stream) { this.stream = stream; return this; } + + /* + * Adds additional messages to the thread before creating the run. + */ + @Generated + private List additionalMessages; + + /* + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output + * more random, while lower values like 0.2 will make it more focused and deterministic. + */ + @Generated + private Double temperature; + + /* + * An alternative to sampling with temperature, called nucleus sampling, where the model + * considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens + * comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + */ + @Generated + private Double topP; + + /* + * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort + * to use only + * the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt + * tokens specified, + * the run will end with status `incomplete`. See `incomplete_details` for more info. + */ + @Generated + private Integer maxPromptTokens; + + /* + * The maximum number of completion tokens that may be used over the course of the run. The run will make a best + * effort + * to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the + * number of + * completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + */ + @Generated + private Integer maxCompletionTokens; + + /* + * The strategy to use for dropping messages as the context windows moves forward. + */ + @Generated + private TruncationObject truncationStrategy; + + /* + * Controls whether or not and which tool is called by the model. + */ + @Generated + private BinaryData toolChoice; + + /* + * Specifies the format that the model must output. + */ + @Generated + private BinaryData responseFormat; + + /** + * Get the additionalMessages property: Adds additional messages to the thread before creating the run. + * + * @return the additionalMessages value. + */ + @Generated + public List getAdditionalMessages() { + return this.additionalMessages; + } + + /** + * Set the additionalMessages property: Adds additional messages to the thread before creating the run. + * + * @param additionalMessages the additionalMessages value to set. + * @return the CreateRunOptions object itself. + */ + @Generated + public CreateRunOptions setAdditionalMessages(List additionalMessages) { + this.additionalMessages = additionalMessages; + return this; + } + + /** + * Get the temperature property: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make + * the output + * more random, while lower values like 0.2 will make it more focused and deterministic. + * + * @return the temperature value. + */ + @Generated + public Double getTemperature() { + return this.temperature; + } + + /** + * Set the temperature property: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make + * the output + * more random, while lower values like 0.2 will make it more focused and deterministic. + * + * @param temperature the temperature value to set. + * @return the CreateRunOptions object itself. + */ + @Generated + public CreateRunOptions setTemperature(Double temperature) { + this.temperature = temperature; + return this; + } + + /** + * Get the topP property: An alternative to sampling with temperature, called nucleus sampling, where the model + * considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens + * comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + * @return the topP value. + */ + @Generated + public Double getTopP() { + return this.topP; + } + + /** + * Set the topP property: An alternative to sampling with temperature, called nucleus sampling, where the model + * considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens + * comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + * @param topP the topP value to set. + * @return the CreateRunOptions object itself. + */ + @Generated + public CreateRunOptions setTopP(Double topP) { + this.topP = topP; + return this; + } + + /** + * Get the maxPromptTokens property: The maximum number of prompt tokens that may be used over the course of the + * run. The run will make a best effort to use only + * the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt + * tokens specified, + * the run will end with status `incomplete`. See `incomplete_details` for more info. + * + * @return the maxPromptTokens value. + */ + @Generated + public Integer getMaxPromptTokens() { + return this.maxPromptTokens; + } + + /** + * Set the maxPromptTokens property: The maximum number of prompt tokens that may be used over the course of the + * run. The run will make a best effort to use only + * the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt + * tokens specified, + * the run will end with status `incomplete`. See `incomplete_details` for more info. + * + * @param maxPromptTokens the maxPromptTokens value to set. + * @return the CreateRunOptions object itself. + */ + @Generated + public CreateRunOptions setMaxPromptTokens(Integer maxPromptTokens) { + this.maxPromptTokens = maxPromptTokens; + return this; + } + + /** + * Get the maxCompletionTokens property: The maximum number of completion tokens that may be used over the course of + * the run. The run will make a best effort + * to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the + * number of + * completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + * + * @return the maxCompletionTokens value. + */ + @Generated + public Integer getMaxCompletionTokens() { + return this.maxCompletionTokens; + } + + /** + * Set the maxCompletionTokens property: The maximum number of completion tokens that may be used over the course of + * the run. The run will make a best effort + * to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the + * number of + * completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + * + * @param maxCompletionTokens the maxCompletionTokens value to set. + * @return the CreateRunOptions object itself. + */ + @Generated + public CreateRunOptions setMaxCompletionTokens(Integer maxCompletionTokens) { + this.maxCompletionTokens = maxCompletionTokens; + return this; + } + + /** + * Get the truncationStrategy property: The strategy to use for dropping messages as the context windows moves + * forward. + * + * @return the truncationStrategy value. + */ + @Generated + public TruncationObject getTruncationStrategy() { + return this.truncationStrategy; + } + + /** + * Set the truncationStrategy property: The strategy to use for dropping messages as the context windows moves + * forward. + * + * @param truncationStrategy the truncationStrategy value to set. + * @return the CreateRunOptions object itself. + */ + @Generated + public CreateRunOptions setTruncationStrategy(TruncationObject truncationStrategy) { + this.truncationStrategy = truncationStrategy; + return this; + } + + /** + * Get the toolChoice property: Controls whether or not and which tool is called by the model. + * + * @return the toolChoice value. + */ + @Generated + public BinaryData getToolChoice() { + return this.toolChoice; + } + + /** + * Set the toolChoice property: Controls whether or not and which tool is called by the model. + * + * @param toolChoice the toolChoice value to set. + * @return the CreateRunOptions object itself. + */ + @Generated + public CreateRunOptions setToolChoice(BinaryData toolChoice) { + this.toolChoice = toolChoice; + return this; + } + + /** + * Get the responseFormat property: Specifies the format that the model must output. + * + * @return the responseFormat value. + */ + @Generated + public BinaryData getResponseFormat() { + return this.responseFormat; + } + + /** + * Set the responseFormat property: Specifies the format that the model must output. + * + * @param responseFormat the responseFormat value to set. + * @return the CreateRunOptions object itself. + */ + @Generated + public CreateRunOptions setResponseFormat(BinaryData responseFormat) { + this.responseFormat = responseFormat; + return this; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateToolResourcesOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateToolResourcesOptions.java new file mode 100644 index 0000000000000..b5218e4eb18b9 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateToolResourcesOptions.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request object. A set of resources that are used by the assistant's tools. The resources are specific to the + * type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` + * tool requires a list of vector store IDs. + */ +@Fluent +public final class CreateToolResourcesOptions implements JsonSerializable { + /* + * A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files + * associated with the tool. + */ + @Generated + private CreateCodeInterpreterToolResourceOptions codeInterpreter; + + /* + * A list of vector stores or their IDs made available to the `file_search` tool. + */ + @Generated + private BinaryData fileSearch; + + /** + * Creates an instance of CreateToolResourcesOptions class. + */ + @Generated + public CreateToolResourcesOptions() { + } + + /** + * Get the codeInterpreter property: A list of file IDs made available to the `code_interpreter` tool. There can be + * a maximum of 20 files + * associated with the tool. + * + * @return the codeInterpreter value. + */ + @Generated + public CreateCodeInterpreterToolResourceOptions getCodeInterpreter() { + return this.codeInterpreter; + } + + /** + * Set the codeInterpreter property: A list of file IDs made available to the `code_interpreter` tool. There can be + * a maximum of 20 files + * associated with the tool. + * + * @param codeInterpreter the codeInterpreter value to set. + * @return the CreateToolResourcesOptions object itself. + */ + @Generated + public CreateToolResourcesOptions setCodeInterpreter(CreateCodeInterpreterToolResourceOptions codeInterpreter) { + this.codeInterpreter = codeInterpreter; + return this; + } + + /** + * Get the fileSearch property: A list of vector stores or their IDs made available to the `file_search` tool. + * + * @return the fileSearch value. + */ + @Generated + public BinaryData getFileSearch() { + return this.fileSearch; + } + + /** + * Set the fileSearch property: A list of vector stores or their IDs made available to the `file_search` tool. + * + * @param fileSearch the fileSearch value to set. + * @return the CreateToolResourcesOptions object itself. + */ + @Generated + public CreateToolResourcesOptions setFileSearch(BinaryData fileSearch) { + this.fileSearch = fileSearch; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("code_interpreter", this.codeInterpreter); + if (this.fileSearch != null) { + jsonWriter.writeUntypedField("file_search", this.fileSearch.toObject(Object.class)); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateToolResourcesOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateToolResourcesOptions if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CreateToolResourcesOptions. + */ + @Generated + public static CreateToolResourcesOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateToolResourcesOptions deserializedCreateToolResourcesOptions = new CreateToolResourcesOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code_interpreter".equals(fieldName)) { + deserializedCreateToolResourcesOptions.codeInterpreter + = CreateCodeInterpreterToolResourceOptions.fromJson(reader); + } else if ("file_search".equals(fieldName)) { + deserializedCreateToolResourcesOptions.fileSearch + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else { + reader.skipChildren(); + } + } + + return deserializedCreateToolResourcesOptions; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FilePurpose.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FilePurpose.java index cf5e66446e388..8189b77afe1f3 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FilePurpose.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FilePurpose.java @@ -66,4 +66,22 @@ public static FilePurpose fromString(String name) { public static Collection values() { return values(FilePurpose.class); } + + /** + * Indicates a file is used as input to . + */ + @Generated + public static final FilePurpose BATCH = fromString("batch"); + + /** + * Indicates a file is used as output by a vector store batch operation. + */ + @Generated + public static final FilePurpose BATCH_OUTPUT = fromString("batch_output"); + + /** + * Indicates a file is used as input to a vision operation. + */ + @Generated + public static final FilePurpose VISION = fromString("vision"); } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolDefinition.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolDefinition.java new file mode 100644 index 0000000000000..8fc7741fb6c01 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolDefinition.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The input definition information for a file search tool as used to configure an assistant. + */ +@Immutable +public final class FileSearchToolDefinition extends ToolDefinition { + /* + * The object type. + */ + @Generated + private String type = "file_search"; + + /** + * Creates an instance of FileSearchToolDefinition class. + */ + @Generated + public FileSearchToolDefinition() { + } + + /** + * Get the type property: The object type. + * + * @return the type value. + */ + @Generated + @Override + public String getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileSearchToolDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileSearchToolDefinition if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FileSearchToolDefinition. + */ + @Generated + public static FileSearchToolDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileSearchToolDefinition deserializedFileSearchToolDefinition = new FileSearchToolDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedFileSearchToolDefinition.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFileSearchToolDefinition; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolResource.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolResource.java new file mode 100644 index 0000000000000..4a4a8c1a26160 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolResource.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A set of resources that are used by the `file_search` tool. + */ +@Immutable +public final class FileSearchToolResource implements JsonSerializable { + /* + * The ID of the vector store attached to this assistant. There can be a maximum of 1 vector + * store attached to the assistant. + */ + @Generated + private List vectorStoreIds; + + /** + * Creates an instance of FileSearchToolResource class. + */ + @Generated + private FileSearchToolResource() { + } + + /** + * Get the vectorStoreIds property: The ID of the vector store attached to this assistant. There can be a maximum of + * 1 vector + * store attached to the assistant. + * + * @return the vectorStoreIds value. + */ + @Generated + public List getVectorStoreIds() { + return this.vectorStoreIds; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("vector_store_ids", this.vectorStoreIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileSearchToolResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileSearchToolResource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FileSearchToolResource. + */ + @Generated + public static FileSearchToolResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileSearchToolResource deserializedFileSearchToolResource = new FileSearchToolResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vector_store_ids".equals(fieldName)) { + List vectorStoreIds = reader.readArray(reader1 -> reader1.getString()); + deserializedFileSearchToolResource.vectorStoreIds = vectorStoreIds; + } else { + reader.skipChildren(); + } + } + + return deserializedFileSearchToolResource; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileState.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileState.java new file mode 100644 index 0000000000000..e303d89272073 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileState.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The state of the file. + */ +public final class FileState extends ExpandableStringEnum { + /** + * The file has been uploaded but it's not yet processed. This state is not returned by Azure OpenAI and exposed + * only for + * compatibility. It can be categorized as an inactive state. + */ + @Generated + public static final FileState UPLOADED = fromString("uploaded"); + + /** + * The operation was created and is not queued to be processed in the future. It can be categorized as an inactive + * state. + */ + @Generated + public static final FileState PENDING = fromString("pending"); + + /** + * The operation has started to be processed. It can be categorized as an active state. + */ + @Generated + public static final FileState RUNNING = fromString("running"); + + /** + * The operation has successfully processed and is ready for consumption. It can be categorized as a terminal state. + */ + @Generated + public static final FileState PROCESSED = fromString("processed"); + + /** + * The operation has completed processing with a failure and cannot be further consumed. It can be categorized as a + * terminal state. + */ + @Generated + public static final FileState ERROR = fromString("error"); + + /** + * The entity is in the process to be deleted. This state is not returned by Azure OpenAI and exposed only for + * compatibility. + * It can be categorized as an active state. + */ + @Generated + public static final FileState DELETING = fromString("deleting"); + + /** + * The entity has been deleted but may still be referenced by other entities predating the deletion. It can be + * categorized as a + * terminal state. + */ + @Generated + public static final FileState DELETED = fromString("deleted"); + + /** + * Creates a new instance of FileState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FileState() { + } + + /** + * Creates or finds a FileState from its string representation. + * + * @param name a name to look for. + * @return the corresponding FileState. + */ + @Generated + public static FileState fromString(String name) { + return fromString(name, FileState.class); + } + + /** + * Gets known FileState values. + * + * @return known FileState values. + */ + @Generated + public static Collection values() { + return values(FileState.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FunctionName.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FunctionName.java new file mode 100644 index 0000000000000..8e5a0f1b08bbc --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FunctionName.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The function name that will be used, if using the `funtion` tool. + */ +@Immutable +public final class FunctionName implements JsonSerializable { + /* + * The name of the function to call + */ + @Generated + private final String name; + + /** + * Creates an instance of FunctionName class. + * + * @param name the name value to set. + */ + @Generated + public FunctionName(String name) { + this.name = name; + } + + /** + * Get the name property: The name of the function to call. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FunctionName from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FunctionName if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FunctionName. + */ + @Generated + public static FunctionName fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + name = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new FunctionName(name); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageAttachment.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageAttachment.java new file mode 100644 index 0000000000000..86e80a4b70acc --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageAttachment.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * This describes to which tools a file has been attached. + */ +@Immutable +public final class MessageAttachment implements JsonSerializable { + /* + * The ID of the file to attach to the message. + */ + @Generated + private final String fileId; + + /* + * The tools to add to this file. + */ + @Generated + private final List tools; + + /** + * Creates an instance of MessageAttachment class. + * + * @param fileId the fileId value to set. + * @param tools the tools value to set. + */ + @Generated + public MessageAttachment(String fileId, List tools) { + this.fileId = fileId; + this.tools = tools; + } + + /** + * Get the fileId property: The ID of the file to attach to the message. + * + * @return the fileId value. + */ + @Generated + public String getFileId() { + return this.fileId; + } + + /** + * Get the tools property: The tools to add to this file. + * + * @return the tools value. + */ + @Generated + public List getTools() { + return this.tools; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("file_id", this.fileId); + jsonWriter.writeArrayField("tools", this.tools, + (writer, element) -> writer.writeUntyped(element == null ? null : element.toObject(Object.class))); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MessageAttachment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MessageAttachment if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MessageAttachment. + */ + @Generated + public static MessageAttachment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String fileId = null; + List tools = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("file_id".equals(fieldName)) { + fileId = reader.getString(); + } else if ("tools".equals(fieldName)) { + tools = reader.readArray(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + } else { + reader.skipChildren(); + } + } + return new MessageAttachment(fileId, tools); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageContent.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageContent.java index 89fc16570814c..1fc24f6785738 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageContent.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageContent.java @@ -21,7 +21,7 @@ public class MessageContent implements JsonSerializable { * Creates an instance of MessageContent class. */ @Generated - protected MessageContent() { + public MessageContent() { } /** diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageImageFileContent.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageImageFileContent.java index c12952b3d322b..e2a3c3265adc2 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageImageFileContent.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageImageFileContent.java @@ -28,7 +28,7 @@ public final class MessageImageFileContent extends MessageContent { * @param imageFile the imageFile value to set. */ @Generated - private MessageImageFileContent(MessageImageFileDetails imageFile) { + public MessageImageFileContent(MessageImageFileDetails imageFile) { this.imageFile = imageFile; } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageImageFileDetails.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageImageFileDetails.java index 394fbd0d77846..9c553e70087ad 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageImageFileDetails.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageImageFileDetails.java @@ -39,7 +39,7 @@ public String getFileId() { * @param fileId the fileId value to set. */ @Generated - private MessageImageFileDetails(String fileId) { + public MessageImageFileDetails(String fileId) { this.fileId = fileId; } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageIncompleteDetails.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageIncompleteDetails.java new file mode 100644 index 0000000000000..5dde028d6c684 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageIncompleteDetails.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information providing additional detail about a message entering an incomplete status. + */ +@Immutable +public final class MessageIncompleteDetails implements JsonSerializable { + /* + * The provided reason describing why the message was marked as incomplete. + */ + @Generated + private final MessageIncompleteDetailsReason reason; + + /** + * Creates an instance of MessageIncompleteDetails class. + * + * @param reason the reason value to set. + */ + @Generated + public MessageIncompleteDetails(MessageIncompleteDetailsReason reason) { + this.reason = reason; + } + + /** + * Get the reason property: The provided reason describing why the message was marked as incomplete. + * + * @return the reason value. + */ + @Generated + public MessageIncompleteDetailsReason getReason() { + return this.reason; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("reason", this.reason == null ? null : this.reason.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MessageIncompleteDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MessageIncompleteDetails if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MessageIncompleteDetails. + */ + @Generated + public static MessageIncompleteDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MessageIncompleteDetailsReason reason = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("reason".equals(fieldName)) { + reason = MessageIncompleteDetailsReason.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new MessageIncompleteDetails(reason); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageTextAnnotation.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageTextAnnotation.java index f0062300531e4..50d2ed95fd18a 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageTextAnnotation.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageTextAnnotation.java @@ -35,7 +35,7 @@ public class MessageTextAnnotation implements JsonSerializable annotations) { + public MessageTextDetails(String value, List annotations) { this.value = value; this.annotations = annotations; } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageTextFileCitationAnnotation.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageTextFileCitationAnnotation.java index d3065b763c2d2..501f94cc577b1 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageTextFileCitationAnnotation.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageTextFileCitationAnnotation.java @@ -3,8 +3,8 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.assistants.models; +import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -12,14 +12,14 @@ /** * A citation within the message that points to a specific quote from a specific File associated with the assistant or - * the message. Generated when the assistant uses the 'retrieval' tool to search files. + * the message. Generated when the assistant uses the 'file_search' tool to search files. */ -@Immutable +@Fluent public final class MessageTextFileCitationAnnotation extends MessageTextAnnotation { /* * A citation within the message that points to a specific quote from a specific file. - * Generated when the assistant uses the "retrieval" tool to search files. + * Generated when the assistant uses the "file_search" tool to search files. */ @Generated private final MessageTextFileCitationDetails fileCitation; @@ -27,7 +27,7 @@ public final class MessageTextFileCitationAnnotation extends MessageTextAnnotati /** * Get the fileCitation property: A citation within the message that points to a specific quote from a specific * file. - * Generated when the assistant uses the "retrieval" tool to search files. + * Generated when the assistant uses the "file_search" tool to search files. * * @return the fileCitation value. */ @@ -130,7 +130,7 @@ public String getType() { * @param fileCitation the fileCitation value to set. */ @Generated - private MessageTextFileCitationAnnotation(String text, MessageTextFileCitationDetails fileCitation) { + public MessageTextFileCitationAnnotation(String text, MessageTextFileCitationDetails fileCitation) { super(text); this.fileCitation = fileCitation; } @@ -154,4 +154,28 @@ public Integer getStartIndex() { public Integer getEndIndex() { return this.endIndex; } + + /** + * Set the startIndex property: The first text index associated with this text annotation. + * + * @param startIndex the startIndex value to set. + * @return the MessageTextFileCitationAnnotation object itself. + */ + @Generated + public MessageTextFileCitationAnnotation setStartIndex(Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Set the endIndex property: The last text index associated with this text annotation. + * + * @param endIndex the endIndex value to set. + * @return the MessageTextFileCitationAnnotation object itself. + */ + @Generated + public MessageTextFileCitationAnnotation setEndIndex(Integer endIndex) { + this.endIndex = endIndex; + return this; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageTextFileCitationDetails.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageTextFileCitationDetails.java index e6af00d52608d..c894ff33e5f7a 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageTextFileCitationDetails.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/MessageTextFileCitationDetails.java @@ -36,7 +36,7 @@ public final class MessageTextFileCitationDetails implements JsonSerializable { diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepDeltaFileSearchToolCall.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepDeltaFileSearchToolCall.java new file mode 100644 index 0000000000000..ccff7676ff506 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepDeltaFileSearchToolCall.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Represents a file search tool call within a streaming run step's tool call details. + */ +@Immutable +public final class RunStepDeltaFileSearchToolCall extends RunStepDeltaToolCall { + /* + * The type of the tool call detail item in a streaming run step's details. + */ + @Generated + private String type = "file_search"; + + /* + * Reserved for future use. + */ + @Generated + private Map fileSearch; + + /** + * Creates an instance of RunStepDeltaFileSearchToolCall class. + * + * @param index the index value to set. + * @param id the id value to set. + */ + @Generated + private RunStepDeltaFileSearchToolCall(int index, String id) { + super(index, id); + } + + /** + * Get the type property: The type of the tool call detail item in a streaming run step's details. + * + * @return the type value. + */ + @Generated + @Override + public String getType() { + return this.type; + } + + /** + * Get the fileSearch property: Reserved for future use. + * + * @return the fileSearch value. + */ + @Generated + public Map getFileSearch() { + return this.fileSearch; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("index", getIndex()); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeMapField("file_search", this.fileSearch, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RunStepDeltaFileSearchToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RunStepDeltaFileSearchToolCall if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RunStepDeltaFileSearchToolCall. + */ + @Generated + public static RunStepDeltaFileSearchToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int index = 0; + String id = null; + String type = "file_search"; + Map fileSearch = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("index".equals(fieldName)) { + index = reader.getInt(); + } else if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("type".equals(fieldName)) { + type = reader.getString(); + } else if ("file_search".equals(fieldName)) { + fileSearch = reader.readMap(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + RunStepDeltaFileSearchToolCall deserializedRunStepDeltaFileSearchToolCall + = new RunStepDeltaFileSearchToolCall(index, id); + deserializedRunStepDeltaFileSearchToolCall.type = type; + deserializedRunStepDeltaFileSearchToolCall.fileSearch = fileSearch; + + return deserializedRunStepDeltaFileSearchToolCall; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepDeltaToolCall.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepDeltaToolCall.java index 4f565a18eeea3..bedf1ea3d073f 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepDeltaToolCall.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepDeltaToolCall.java @@ -119,8 +119,8 @@ public static RunStepDeltaToolCall fromJson(JsonReader jsonReader) throws IOExce // Use the discriminator value to determine which subtype should be deserialized. if ("function".equals(discriminatorValue)) { return RunStepDeltaFunctionToolCall.fromJson(readerToUse.reset()); - } else if ("retrieval".equals(discriminatorValue)) { - return RunStepDeltaRetrievalToolCall.fromJson(readerToUse.reset()); + } else if ("file_search".equals(discriminatorValue)) { + return RunStepDeltaFileSearchToolCall.fromJson(readerToUse.reset()); } else if ("code_interpreter".equals(discriminatorValue)) { return RunStepDeltaCodeInterpreterToolCall.fromJson(readerToUse.reset()); } else { diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepFileSearchToolCall.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepFileSearchToolCall.java new file mode 100644 index 0000000000000..28fe201d644f3 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepFileSearchToolCall.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * A record of a call to a file search tool, issued by the model in evaluation of a defined tool, that represents + * executed file search. + */ +@Immutable +public final class RunStepFileSearchToolCall extends RunStepToolCall { + /* + * The object type. + */ + @Generated + private String type = "file_search"; + + /* + * Reserved for future use. + */ + @Generated + private final Map fileSearch; + + /** + * Creates an instance of RunStepFileSearchToolCall class. + * + * @param id the id value to set. + * @param fileSearch the fileSearch value to set. + */ + @Generated + private RunStepFileSearchToolCall(String id, Map fileSearch) { + super(id); + this.fileSearch = fileSearch; + } + + /** + * Get the type property: The object type. + * + * @return the type value. + */ + @Generated + @Override + public String getType() { + return this.type; + } + + /** + * Get the fileSearch property: Reserved for future use. + * + * @return the fileSearch value. + */ + @Generated + public Map getFileSearch() { + return this.fileSearch; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeMapField("file_search", this.fileSearch, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RunStepFileSearchToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RunStepFileSearchToolCall if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RunStepFileSearchToolCall. + */ + @Generated + public static RunStepFileSearchToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + Map fileSearch = null; + String type = "file_search"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("file_search".equals(fieldName)) { + fileSearch = reader.readMap(reader1 -> reader1.getString()); + } else if ("type".equals(fieldName)) { + type = reader.getString(); + } else { + reader.skipChildren(); + } + } + RunStepFileSearchToolCall deserializedRunStepFileSearchToolCall + = new RunStepFileSearchToolCall(id, fileSearch); + deserializedRunStepFileSearchToolCall.type = type; + + return deserializedRunStepFileSearchToolCall; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepToolCall.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepToolCall.java index cc604499f6ad4..4b4e68e4ce096 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepToolCall.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepToolCall.java @@ -84,8 +84,8 @@ public static RunStepToolCall fromJson(JsonReader jsonReader) throws IOException // Use the discriminator value to determine which subtype should be deserialized. if ("code_interpreter".equals(discriminatorValue)) { return RunStepCodeInterpreterToolCall.fromJson(readerToUse.reset()); - } else if ("retrieval".equals(discriminatorValue)) { - return RunStepRetrievalToolCall.fromJson(readerToUse.reset()); + } else if ("file_search".equals(discriminatorValue)) { + return RunStepFileSearchToolCall.fromJson(readerToUse.reset()); } else if ("function".equals(discriminatorValue)) { return RunStepFunctionToolCall.fromJson(readerToUse.reset()); } else { diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadMessage.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadMessage.java index 4099de3d652b7..3a333f27a5c19 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadMessage.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadMessage.java @@ -62,20 +62,13 @@ public final class ThreadMessage implements JsonSerializable { * If applicable, the ID of the assistant that authored this message. */ @Generated - private String assistantId; + private final String assistantId; /* * If applicable, the ID of the run associated with the authoring of this message. */ @Generated - private String runId; - - /* - * A list of file IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can - * access files. - */ - @Generated - private final List fileIds; + private final String runId; /* * A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information @@ -165,18 +158,6 @@ public String getRunId() { return this.runId; } - /** - * Get the fileIds property: A list of file IDs that the assistant should use. Useful for tools like retrieval and - * code_interpreter that can - * access files. - * - * @return the fileIds value. - */ - @Generated - public List getFileIds() { - return this.fileIds; - } - /** * Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing * additional information about that object in a structured format. Keys may be up to 64 characters in length and @@ -201,16 +182,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeLongField("created_at", this.createdAt); jsonWriter.writeStringField("thread_id", this.threadId); jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("incomplete_details", - this.incompleteDetails == null ? null : this.incompleteDetails.toString()); + jsonWriter.writeJsonField("incomplete_details", this.incompleteDetails); jsonWriter.writeNumberField("completed_at", this.completedAt); jsonWriter.writeNumberField("incomplete_at", this.incompleteAt); jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); jsonWriter.writeArrayField("content", this.content, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); - jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("assistant_id", this.assistantId); jsonWriter.writeStringField("run_id", this.runId); + jsonWriter.writeArrayField("attachments", this.attachments, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -230,15 +210,15 @@ public static ThreadMessage fromJson(JsonReader jsonReader) throws IOException { OffsetDateTime createdAt = null; String threadId = null; MessageStatus status = null; - MessageIncompleteDetailsReason incompleteDetails = null; + MessageIncompleteDetails incompleteDetails = null; OffsetDateTime completedAt = null; OffsetDateTime incompleteAt = null; MessageRole role = null; List content = null; - List fileIds = null; - Map metadata = null; String assistantId = null; String runId = null; + List attachments = null; + Map metadata = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -251,7 +231,7 @@ public static ThreadMessage fromJson(JsonReader jsonReader) throws IOException { } else if ("status".equals(fieldName)) { status = MessageStatus.fromString(reader.getString()); } else if ("incomplete_details".equals(fieldName)) { - incompleteDetails = MessageIncompleteDetailsReason.fromString(reader.getString()); + incompleteDetails = MessageIncompleteDetails.fromJson(reader); } else if ("completed_at".equals(fieldName)) { Long completedAtHolder = reader.getNullable(JsonReader::getLong); if (completedAtHolder != null) { @@ -268,23 +248,20 @@ public static ThreadMessage fromJson(JsonReader jsonReader) throws IOException { role = MessageRole.fromString(reader.getString()); } else if ("content".equals(fieldName)) { content = reader.readArray(reader1 -> MessageContent.fromJson(reader1)); - } else if ("file_ids".equals(fieldName)) { - fileIds = reader.readArray(reader1 -> reader1.getString()); - } else if ("metadata".equals(fieldName)) { - metadata = reader.readMap(reader1 -> reader1.getString()); } else if ("assistant_id".equals(fieldName)) { assistantId = reader.getString(); } else if ("run_id".equals(fieldName)) { runId = reader.getString(); + } else if ("attachments".equals(fieldName)) { + attachments = reader.readArray(reader1 -> MessageAttachment.fromJson(reader1)); + } else if ("metadata".equals(fieldName)) { + metadata = reader.readMap(reader1 -> reader1.getString()); } else { reader.skipChildren(); } } - ThreadMessage deserializedThreadMessage = new ThreadMessage(id, createdAt, threadId, status, - incompleteDetails, completedAt, incompleteAt, role, content, fileIds, metadata); - deserializedThreadMessage.assistantId = assistantId; - deserializedThreadMessage.runId = runId; - return deserializedThreadMessage; + return new ThreadMessage(id, createdAt, threadId, status, incompleteDetails, completedAt, incompleteAt, + role, content, assistantId, runId, attachments, metadata); }); } @@ -298,7 +275,7 @@ public static ThreadMessage fromJson(JsonReader jsonReader) throws IOException { * On an incomplete message, details about why the message is incomplete. */ @Generated - private final MessageIncompleteDetailsReason incompleteDetails; + private final MessageIncompleteDetails incompleteDetails; /* * The Unix timestamp (in seconds) for when the message was completed. @@ -312,50 +289,6 @@ public static ThreadMessage fromJson(JsonReader jsonReader) throws IOException { @Generated private final Long incompleteAt; - /** - * Creates an instance of ThreadMessage class. - * - * @param id the id value to set. - * @param createdAt the createdAt value to set. - * @param threadId the threadId value to set. - * @param status the status value to set. - * @param incompleteDetails the incompleteDetails value to set. - * @param completedAt the completedAt value to set. - * @param incompleteAt the incompleteAt value to set. - * @param role the role value to set. - * @param content the content value to set. - * @param fileIds the fileIds value to set. - * @param metadata the metadata value to set. - */ - @Generated - private ThreadMessage(String id, OffsetDateTime createdAt, String threadId, MessageStatus status, - MessageIncompleteDetailsReason incompleteDetails, OffsetDateTime completedAt, OffsetDateTime incompleteAt, - MessageRole role, List content, List fileIds, Map metadata) { - this.id = id; - if (createdAt == null) { - this.createdAt = 0L; - } else { - this.createdAt = createdAt.toEpochSecond(); - } - this.threadId = threadId; - this.status = status; - this.incompleteDetails = incompleteDetails; - if (completedAt == null) { - this.completedAt = null; - } else { - this.completedAt = completedAt.toEpochSecond(); - } - if (incompleteAt == null) { - this.incompleteAt = null; - } else { - this.incompleteAt = incompleteAt.toEpochSecond(); - } - this.role = role; - this.content = content; - this.fileIds = fileIds; - this.metadata = metadata; - } - /** * Get the status property: The status of the message. * @@ -372,7 +305,7 @@ public MessageStatus getStatus() { * @return the incompleteDetails value. */ @Generated - public MessageIncompleteDetailsReason getIncompleteDetails() { + public MessageIncompleteDetails getIncompleteDetails() { return this.incompleteDetails; } @@ -401,4 +334,69 @@ public OffsetDateTime getIncompleteAt() { } return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.incompleteAt), ZoneOffset.UTC); } + + /* + * A list of files attached to the message, and the tools they were added to. + */ + @Generated + private final List attachments; + + /** + * Creates an instance of ThreadMessage class. + * + * @param id the id value to set. + * @param createdAt the createdAt value to set. + * @param threadId the threadId value to set. + * @param status the status value to set. + * @param incompleteDetails the incompleteDetails value to set. + * @param completedAt the completedAt value to set. + * @param incompleteAt the incompleteAt value to set. + * @param role the role value to set. + * @param content the content value to set. + * @param assistantId the assistantId value to set. + * @param runId the runId value to set. + * @param attachments the attachments value to set. + * @param metadata the metadata value to set. + */ + @Generated + public ThreadMessage(String id, OffsetDateTime createdAt, String threadId, MessageStatus status, + MessageIncompleteDetails incompleteDetails, OffsetDateTime completedAt, OffsetDateTime incompleteAt, + MessageRole role, List content, String assistantId, String runId, + List attachments, Map metadata) { + this.id = id; + if (createdAt == null) { + this.createdAt = 0L; + } else { + this.createdAt = createdAt.toEpochSecond(); + } + this.threadId = threadId; + this.status = status; + this.incompleteDetails = incompleteDetails; + if (completedAt == null) { + this.completedAt = null; + } else { + this.completedAt = completedAt.toEpochSecond(); + } + if (incompleteAt == null) { + this.incompleteAt = null; + } else { + this.incompleteAt = incompleteAt.toEpochSecond(); + } + this.role = role; + this.content = content; + this.assistantId = assistantId; + this.runId = runId; + this.attachments = attachments; + this.metadata = metadata; + } + + /** + * Get the attachments property: A list of files attached to the message, and the tools they were added to. + * + * @return the attachments value. + */ + @Generated + public List getAttachments() { + return this.attachments; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadMessageOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadMessageOptions.java new file mode 100644 index 0000000000000..cb1f531879389 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadMessageOptions.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * A single message within an assistant thread, as provided during that thread's creation for its initial state. + */ +@Fluent +public final class ThreadMessageOptions implements JsonSerializable { + /* + * The role of the entity that is creating the message. Allowed values include: + * - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent + * user-generated messages. + * - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the + * assistant into + * the conversation. + */ + @Generated + private final MessageRole role; + + /* + * The textual content of the initial message. Currently, robust input including images and annotated text may only + * be provided via + * a separate call to the create message API. + */ + @Generated + private final String content; + + /* + * A list of files attached to the message, and the tools they should be added to. + */ + @Generated + private List attachments; + + /* + * A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information + * about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 + * characters in length. + */ + @Generated + private Map metadata; + + /** + * Creates an instance of ThreadMessageOptions class. + * + * @param role the role value to set. + * @param content the content value to set. + */ + @Generated + public ThreadMessageOptions(MessageRole role, String content) { + this.role = role; + this.content = content; + } + + /** + * Get the role property: The role of the entity that is creating the message. Allowed values include: + * - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent + * user-generated messages. + * - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the + * assistant into + * the conversation. + * + * @return the role value. + */ + @Generated + public MessageRole getRole() { + return this.role; + } + + /** + * Get the content property: The textual content of the initial message. Currently, robust input including images + * and annotated text may only be provided via + * a separate call to the create message API. + * + * @return the content value. + */ + @Generated + public String getContent() { + return this.content; + } + + /** + * Get the attachments property: A list of files attached to the message, and the tools they should be added to. + * + * @return the attachments value. + */ + @Generated + public List getAttachments() { + return this.attachments; + } + + /** + * Set the attachments property: A list of files attached to the message, and the tools they should be added to. + * + * @param attachments the attachments value to set. + * @return the ThreadMessageOptions object itself. + */ + @Generated + public ThreadMessageOptions setAttachments(List attachments) { + this.attachments = attachments; + return this; + } + + /** + * Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing + * additional information about that object in a structured format. Keys may be up to 64 characters in length and + * values may be up to 512 characters in length. + * + * @return the metadata value. + */ + @Generated + public Map getMetadata() { + return this.metadata; + } + + /** + * Set the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing + * additional information about that object in a structured format. Keys may be up to 64 characters in length and + * values may be up to 512 characters in length. + * + * @param metadata the metadata value to set. + * @return the ThreadMessageOptions object itself. + */ + @Generated + public ThreadMessageOptions setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeArrayField("attachments", this.attachments, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThreadMessageOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThreadMessageOptions if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThreadMessageOptions. + */ + @Generated + public static ThreadMessageOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MessageRole role = null; + String content = null; + List attachments = null; + Map metadata = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("role".equals(fieldName)) { + role = MessageRole.fromString(reader.getString()); + } else if ("content".equals(fieldName)) { + content = reader.getString(); + } else if ("attachments".equals(fieldName)) { + attachments = reader.readArray(reader1 -> MessageAttachment.fromJson(reader1)); + } else if ("metadata".equals(fieldName)) { + metadata = reader.readMap(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + ThreadMessageOptions deserializedThreadMessageOptions = new ThreadMessageOptions(role, content); + deserializedThreadMessageOptions.attachments = attachments; + deserializedThreadMessageOptions.metadata = metadata; + + return deserializedThreadMessageOptions; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadRun.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadRun.java index 7edcac22f93f8..e7dbd071212fa 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadRun.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadRun.java @@ -5,6 +5,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; +import com.azure.core.util.BinaryData; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -82,12 +83,6 @@ public final class ThreadRun implements JsonSerializable { @Generated private final List tools; - /* - * A list of attached file IDs, ordered by creation date in ascending order. - */ - @Generated - private final List fileIds; - /* * The Unix timestamp, in seconds, representing when this object was created. */ @@ -232,16 +227,6 @@ public List getTools() { return this.tools; } - /** - * Get the fileIds property: A list of attached file IDs, ordered by creation date in ascending order. - * - * @return the fileIds value. - */ - @Generated - public List getFileIds() { - return this.fileIds; - } - /** * Get the createdAt property: The Unix timestamp, in seconds, representing when this object was created. * @@ -345,7 +330,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("model", this.model); jsonWriter.writeStringField("instructions", this.instructions); jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); jsonWriter.writeLongField("created_at", this.createdAt); jsonWriter.writeNumberField("expires_at", this.expiresAt); jsonWriter.writeNumberField("started_at", this.startedAt); @@ -355,8 +339,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("incomplete_details", this.incompleteDetails == null ? null : this.incompleteDetails.toString()); jsonWriter.writeJsonField("usage", this.usage); + jsonWriter.writeNumberField("max_prompt_tokens", this.maxPromptTokens); + jsonWriter.writeNumberField("max_completion_tokens", this.maxCompletionTokens); + jsonWriter.writeJsonField("truncation_strategy", this.truncationStrategy); + jsonWriter.writeUntypedField("tool_choice", this.toolChoice.toObject(Object.class)); + jsonWriter.writeUntypedField("response_format", this.responseFormat.toObject(Object.class)); jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("required_action", this.requiredAction); + jsonWriter.writeNumberField("temperature", this.temperature); + jsonWriter.writeNumberField("top_p", this.topP); return jsonWriter.writeEndObject(); } @@ -380,7 +371,6 @@ public static ThreadRun fromJson(JsonReader jsonReader) throws IOException { String model = null; String instructions = null; List tools = null; - List fileIds = null; OffsetDateTime createdAt = null; OffsetDateTime expiresAt = null; OffsetDateTime startedAt = null; @@ -389,8 +379,15 @@ public static ThreadRun fromJson(JsonReader jsonReader) throws IOException { OffsetDateTime failedAt = null; IncompleteRunDetails incompleteDetails = null; RunCompletionUsage usage = null; + Integer maxPromptTokens = null; + Integer maxCompletionTokens = null; + TruncationObject truncationStrategy = null; + BinaryData toolChoice = null; + BinaryData responseFormat = null; Map metadata = null; RequiredAction requiredAction = null; + Double temperature = null; + Double topP = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -410,8 +407,6 @@ public static ThreadRun fromJson(JsonReader jsonReader) throws IOException { instructions = reader.getString(); } else if ("tools".equals(fieldName)) { tools = reader.readArray(reader1 -> ToolDefinition.fromJson(reader1)); - } else if ("file_ids".equals(fieldName)) { - fileIds = reader.readArray(reader1 -> reader1.getString()); } else if ("created_at".equals(fieldName)) { createdAt = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); } else if ("expires_at".equals(fieldName)) { @@ -445,18 +440,37 @@ public static ThreadRun fromJson(JsonReader jsonReader) throws IOException { incompleteDetails = IncompleteRunDetails.fromString(reader.getString()); } else if ("usage".equals(fieldName)) { usage = RunCompletionUsage.fromJson(reader); + } else if ("max_prompt_tokens".equals(fieldName)) { + maxPromptTokens = reader.getNullable(JsonReader::getInt); + } else if ("max_completion_tokens".equals(fieldName)) { + maxCompletionTokens = reader.getNullable(JsonReader::getInt); + } else if ("truncation_strategy".equals(fieldName)) { + truncationStrategy = TruncationObject.fromJson(reader); + } else if ("tool_choice".equals(fieldName)) { + toolChoice + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else if ("response_format".equals(fieldName)) { + responseFormat + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); } else if ("metadata".equals(fieldName)) { metadata = reader.readMap(reader1 -> reader1.getString()); } else if ("required_action".equals(fieldName)) { requiredAction = RequiredAction.fromJson(reader); + } else if ("temperature".equals(fieldName)) { + temperature = reader.getNullable(JsonReader::getDouble); + } else if ("top_p".equals(fieldName)) { + topP = reader.getNullable(JsonReader::getDouble); } else { reader.skipChildren(); } } - ThreadRun deserializedThreadRun = new ThreadRun(id, threadId, assistantId, status, lastError, model, - instructions, tools, fileIds, createdAt, expiresAt, startedAt, completedAt, cancelledAt, failedAt, - incompleteDetails, usage, metadata); + ThreadRun deserializedThreadRun + = new ThreadRun(id, threadId, assistantId, status, lastError, model, instructions, tools, createdAt, + expiresAt, startedAt, completedAt, cancelledAt, failedAt, incompleteDetails, usage, maxPromptTokens, + maxCompletionTokens, truncationStrategy, toolChoice, responseFormat, metadata); deserializedThreadRun.requiredAction = requiredAction; + deserializedThreadRun.temperature = temperature; + deserializedThreadRun.topP = topP; return deserializedThreadRun; }); } @@ -485,6 +499,59 @@ public RunCompletionUsage getUsage() { @Generated private final IncompleteRunDetails incompleteDetails; + /** + * Get the incompleteDetails property: Details on why the run is incomplete. Will be `null` if the run is not + * incomplete. + * + * @return the incompleteDetails value. + */ + @Generated + public IncompleteRunDetails getIncompleteDetails() { + return this.incompleteDetails; + } + + /* + * The sampling temperature used for this run. If not set, defaults to 1. + */ + @Generated + private Double temperature; + + /* + * The nucleus sampling value used for this run. If not set, defaults to 1. + */ + @Generated + private Double topP; + + /* + * The maximum number of prompt tokens specified to have been used over the course of the run. + */ + @Generated + private final Integer maxPromptTokens; + + /* + * The maximum number of completion tokens specified to have been used over the course of the run. + */ + @Generated + private final Integer maxCompletionTokens; + + /* + * The strategy to use for dropping messages as the context windows moves forward. + */ + @Generated + private final TruncationObject truncationStrategy; + + /* + * Controls whether or not and which tool is called by the model. + */ + @Generated + private final BinaryData toolChoice; + + /* + * The response format of the tool calls used in this run. + */ + @Generated + private final BinaryData responseFormat; + /** * Creates an instance of ThreadRun class. * @@ -496,7 +563,6 @@ public RunCompletionUsage getUsage() { * @param model the model value to set. * @param instructions the instructions value to set. * @param tools the tools value to set. - * @param fileIds the fileIds value to set. * @param createdAt the createdAt value to set. * @param expiresAt the expiresAt value to set. * @param startedAt the startedAt value to set. @@ -505,14 +571,20 @@ public RunCompletionUsage getUsage() { * @param failedAt the failedAt value to set. * @param incompleteDetails the incompleteDetails value to set. * @param usage the usage value to set. + * @param maxPromptTokens the maxPromptTokens value to set. + * @param maxCompletionTokens the maxCompletionTokens value to set. + * @param truncationStrategy the truncationStrategy value to set. + * @param toolChoice the toolChoice value to set. + * @param responseFormat the responseFormat value to set. * @param metadata the metadata value to set. */ @Generated private ThreadRun(String id, String threadId, String assistantId, RunStatus status, RunError lastError, - String model, String instructions, List tools, List fileIds, OffsetDateTime createdAt, + String model, String instructions, List tools, OffsetDateTime createdAt, OffsetDateTime expiresAt, OffsetDateTime startedAt, OffsetDateTime completedAt, OffsetDateTime cancelledAt, OffsetDateTime failedAt, IncompleteRunDetails incompleteDetails, RunCompletionUsage usage, - Map metadata) { + Integer maxPromptTokens, Integer maxCompletionTokens, TruncationObject truncationStrategy, + BinaryData toolChoice, BinaryData responseFormat, Map metadata) { this.id = id; this.threadId = threadId; this.assistantId = assistantId; @@ -521,7 +593,6 @@ private ThreadRun(String id, String threadId, String assistantId, RunStatus stat this.model = model; this.instructions = instructions; this.tools = tools; - this.fileIds = fileIds; if (createdAt == null) { this.createdAt = 0L; } else { @@ -554,17 +625,84 @@ private ThreadRun(String id, String threadId, String assistantId, RunStatus stat } this.incompleteDetails = incompleteDetails; this.usage = usage; + this.maxPromptTokens = maxPromptTokens; + this.maxCompletionTokens = maxCompletionTokens; + this.truncationStrategy = truncationStrategy; + this.toolChoice = toolChoice; + this.responseFormat = responseFormat; this.metadata = metadata; } /** - * Get the incompleteDetails property: Details on why the run is incomplete. Will be `null` if the run is not - * incomplete. + * Get the temperature property: The sampling temperature used for this run. If not set, defaults to 1. * - * @return the incompleteDetails value. + * @return the temperature value. */ @Generated - public IncompleteRunDetails getIncompleteDetails() { - return this.incompleteDetails; + public Double getTemperature() { + return this.temperature; + } + + /** + * Get the topP property: The nucleus sampling value used for this run. If not set, defaults to 1. + * + * @return the topP value. + */ + @Generated + public Double getTopP() { + return this.topP; + } + + /** + * Get the maxPromptTokens property: The maximum number of prompt tokens specified to have been used over the course + * of the run. + * + * @return the maxPromptTokens value. + */ + @Generated + public Integer getMaxPromptTokens() { + return this.maxPromptTokens; + } + + /** + * Get the maxCompletionTokens property: The maximum number of completion tokens specified to have been used over + * the course of the run. + * + * @return the maxCompletionTokens value. + */ + @Generated + public Integer getMaxCompletionTokens() { + return this.maxCompletionTokens; + } + + /** + * Get the truncationStrategy property: The strategy to use for dropping messages as the context windows moves + * forward. + * + * @return the truncationStrategy value. + */ + @Generated + public TruncationObject getTruncationStrategy() { + return this.truncationStrategy; + } + + /** + * Get the toolChoice property: Controls whether or not and which tool is called by the model. + * + * @return the toolChoice value. + */ + @Generated + public BinaryData getToolChoice() { + return this.toolChoice; + } + + /** + * Get the responseFormat property: The response format of the tool calls used in this run. + * + * @return the responseFormat value. + */ + @Generated + public BinaryData getResponseFormat() { + return this.responseFormat; } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ToolDefinition.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ToolDefinition.java index 46ab21978acc0..5f91ab36dc1f6 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ToolDefinition.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ToolDefinition.java @@ -63,8 +63,8 @@ public static ToolDefinition fromJson(JsonReader jsonReader) throws IOException // Use the discriminator value to determine which subtype should be deserialized. if ("code_interpreter".equals(discriminatorValue)) { return CodeInterpreterToolDefinition.fromJson(readerToUse.reset()); - } else if ("retrieval".equals(discriminatorValue)) { - return RetrievalToolDefinition.fromJson(readerToUse.reset()); + } else if ("file_search".equals(discriminatorValue)) { + return FileSearchToolDefinition.fromJson(readerToUse.reset()); } else if ("function".equals(discriminatorValue)) { return FunctionToolDefinition.fromJson(readerToUse.reset()); } else { diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ToolResources.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ToolResources.java new file mode 100644 index 0000000000000..2f22715b1015f --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ToolResources.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A set of resources that are used by the assistant's tools. The resources are specific to the type of + * tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` + * tool requires a list of vector store IDs. + */ +@Immutable +public final class ToolResources implements JsonSerializable { + /* + * Resources to be used by the `code_interpreter tool` consisting of file IDs. + */ + @Generated + private CodeInterpreterToolResource codeInterpreter; + + /* + * Resources to be used by the `file_search` tool consisting of vector store IDs. + */ + @Generated + private FileSearchToolResource fileSearch; + + /** + * Creates an instance of ToolResources class. + */ + @Generated + private ToolResources() { + } + + /** + * Get the codeInterpreter property: Resources to be used by the `code_interpreter tool` consisting of file IDs. + * + * @return the codeInterpreter value. + */ + @Generated + public CodeInterpreterToolResource getCodeInterpreter() { + return this.codeInterpreter; + } + + /** + * Get the fileSearch property: Resources to be used by the `file_search` tool consisting of vector store IDs. + * + * @return the fileSearch value. + */ + @Generated + public FileSearchToolResource getFileSearch() { + return this.fileSearch; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("code_interpreter", this.codeInterpreter); + jsonWriter.writeJsonField("file_search", this.fileSearch); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ToolResources from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ToolResources if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ToolResources. + */ + @Generated + public static ToolResources fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ToolResources deserializedToolResources = new ToolResources(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code_interpreter".equals(fieldName)) { + deserializedToolResources.codeInterpreter = CodeInterpreterToolResource.fromJson(reader); + } else if ("file_search".equals(fieldName)) { + deserializedToolResources.fileSearch = FileSearchToolResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedToolResources; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/TruncationObject.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/TruncationObject.java new file mode 100644 index 0000000000000..3762e744b2153 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/TruncationObject.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Controls for how a thread will be truncated prior to the run. Use this to control the initial + * context window of the run. + */ +@Fluent +public final class TruncationObject implements JsonSerializable { + /* + * The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will + * be truncated to the `lastMessages` count most recent messages in the thread. When set to `auto`, messages in the + * middle of the thread + * will be dropped to fit the context length of the model, `max_prompt_tokens`. + */ + @Generated + private final TruncationStrategy type; + + /* + * The number of most recent messages from the thread when constructing the context for the run. + */ + @Generated + private Integer lastMessages; + + /** + * Creates an instance of TruncationObject class. + * + * @param type the type value to set. + */ + @Generated + public TruncationObject(TruncationStrategy type) { + this.type = type; + } + + /** + * Get the type property: The truncation strategy to use for the thread. The default is `auto`. If set to + * `last_messages`, the thread will + * be truncated to the `lastMessages` count most recent messages in the thread. When set to `auto`, messages in the + * middle of the thread + * will be dropped to fit the context length of the model, `max_prompt_tokens`. + * + * @return the type value. + */ + @Generated + public TruncationStrategy getType() { + return this.type; + } + + /** + * Get the lastMessages property: The number of most recent messages from the thread when constructing the context + * for the run. + * + * @return the lastMessages value. + */ + @Generated + public Integer getLastMessages() { + return this.lastMessages; + } + + /** + * Set the lastMessages property: The number of most recent messages from the thread when constructing the context + * for the run. + * + * @param lastMessages the lastMessages value to set. + * @return the TruncationObject object itself. + */ + @Generated + public TruncationObject setLastMessages(Integer lastMessages) { + this.lastMessages = lastMessages; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeNumberField("last_messages", this.lastMessages); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TruncationObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TruncationObject if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TruncationObject. + */ + @Generated + public static TruncationObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TruncationStrategy type = null; + Integer lastMessages = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + type = TruncationStrategy.fromString(reader.getString()); + } else if ("last_messages".equals(fieldName)) { + lastMessages = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + TruncationObject deserializedTruncationObject = new TruncationObject(type); + deserializedTruncationObject.lastMessages = lastMessages; + + return deserializedTruncationObject; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/TruncationStrategy.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/TruncationStrategy.java new file mode 100644 index 0000000000000..d60847db2d310 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/TruncationStrategy.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Possible truncation strategies for the thread. + */ +public final class TruncationStrategy extends ExpandableStringEnum { + /** + * Default value. Messages in the middle of the thread will be dropped to fit the context length of the model. + */ + @Generated + public static final TruncationStrategy AUTO = fromString("auto"); + + /** + * The thread will truncate to the `lastMessages` count of recent messages. + */ + @Generated + public static final TruncationStrategy LAST_MESSAGES = fromString("last_messages"); + + /** + * Creates a new instance of TruncationStrategy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TruncationStrategy() { + } + + /** + * Creates or finds a TruncationStrategy from its string representation. + * + * @param name a name to look for. + * @return the corresponding TruncationStrategy. + */ + @Generated + public static TruncationStrategy fromString(String name) { + return fromString(name, TruncationStrategy.class); + } + + /** + * Gets known TruncationStrategy values. + * + * @return known TruncationStrategy values. + */ + @Generated + public static Collection values() { + return values(TruncationStrategy.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateAssistantOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateAssistantOptions.java index de2117cd13f83..6cfed2240f880 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateAssistantOptions.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateAssistantOptions.java @@ -5,6 +5,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -49,12 +50,6 @@ public final class UpdateAssistantOptions implements JsonSerializable tools; - /* - * The modified list of previously uploaded fileIDs to attach to the assistant. - */ - @Generated - private List fileIds; - /* * A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information * about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 @@ -180,28 +175,6 @@ public UpdateAssistantOptions setTools(List tools) { return this; } - /** - * Get the fileIds property: The modified list of previously uploaded fileIDs to attach to the assistant. - * - * @return the fileIds value. - */ - @Generated - public List getFileIds() { - return this.fileIds; - } - - /** - * Set the fileIds property: The modified list of previously uploaded fileIDs to attach to the assistant. - * - * @param fileIds the fileIds value to set. - * @return the UpdateAssistantOptions object itself. - */ - @Generated - public UpdateAssistantOptions setFileIds(List fileIds) { - this.fileIds = fileIds; - return this; - } - /** * Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing * additional information about that object in a structured format. Keys may be up to 64 characters in length and @@ -240,7 +213,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("description", this.description); jsonWriter.writeStringField("instructions", this.instructions); jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("tool_resources", this.toolResources); + jsonWriter.writeNumberField("temperature", this.temperature); + jsonWriter.writeNumberField("top_p", this.topP); + if (this.responseFormat != null) { + jsonWriter.writeUntypedField("response_format", this.responseFormat.toObject(Object.class)); + } jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -271,9 +249,15 @@ public static UpdateAssistantOptions fromJson(JsonReader jsonReader) throws IOEx } else if ("tools".equals(fieldName)) { List tools = reader.readArray(reader1 -> ToolDefinition.fromJson(reader1)); deserializedUpdateAssistantOptions.tools = tools; - } else if ("file_ids".equals(fieldName)) { - List fileIds = reader.readArray(reader1 -> reader1.getString()); - deserializedUpdateAssistantOptions.fileIds = fileIds; + } else if ("tool_resources".equals(fieldName)) { + deserializedUpdateAssistantOptions.toolResources = UpdateToolResourcesOptions.fromJson(reader); + } else if ("temperature".equals(fieldName)) { + deserializedUpdateAssistantOptions.temperature = reader.getNullable(JsonReader::getDouble); + } else if ("top_p".equals(fieldName)) { + deserializedUpdateAssistantOptions.topP = reader.getNullable(JsonReader::getDouble); + } else if ("response_format".equals(fieldName)) { + deserializedUpdateAssistantOptions.responseFormat + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); } else if ("metadata".equals(fieldName)) { Map metadata = reader.readMap(reader1 -> reader1.getString()); deserializedUpdateAssistantOptions.metadata = metadata; @@ -284,4 +268,142 @@ public static UpdateAssistantOptions fromJson(JsonReader jsonReader) throws IOEx return deserializedUpdateAssistantOptions; }); } + + /* + * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For + * example, + * the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector + * store IDs. + */ + @Generated + private UpdateToolResourcesOptions toolResources; + + /* + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, + * while lower values like 0.2 will make it more focused and deterministic. + */ + @Generated + private Double temperature; + + /* + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of + * the tokens with top_p probability mass. + * So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + */ + @Generated + private Double topP; + + /* + * The response format of the tool calls used by this assistant. + */ + @Generated + private BinaryData responseFormat; + + /** + * Get the toolResources property: A set of resources that are used by the assistant's tools. The resources are + * specific to the type of tool. For example, + * the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector + * store IDs. + * + * @return the toolResources value. + */ + @Generated + public UpdateToolResourcesOptions getToolResources() { + return this.toolResources; + } + + /** + * Set the toolResources property: A set of resources that are used by the assistant's tools. The resources are + * specific to the type of tool. For example, + * the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector + * store IDs. + * + * @param toolResources the toolResources value to set. + * @return the UpdateAssistantOptions object itself. + */ + @Generated + public UpdateAssistantOptions setToolResources(UpdateToolResourcesOptions toolResources) { + this.toolResources = toolResources; + return this; + } + + /** + * Get the temperature property: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make + * the output more random, + * while lower values like 0.2 will make it more focused and deterministic. + * + * @return the temperature value. + */ + @Generated + public Double getTemperature() { + return this.temperature; + } + + /** + * Set the temperature property: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make + * the output more random, + * while lower values like 0.2 will make it more focused and deterministic. + * + * @param temperature the temperature value to set. + * @return the UpdateAssistantOptions object itself. + */ + @Generated + public UpdateAssistantOptions setTemperature(Double temperature) { + this.temperature = temperature; + return this; + } + + /** + * Get the topP property: An alternative to sampling with temperature, called nucleus sampling, where the model + * considers the results of the tokens with top_p probability mass. + * So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + * @return the topP value. + */ + @Generated + public Double getTopP() { + return this.topP; + } + + /** + * Set the topP property: An alternative to sampling with temperature, called nucleus sampling, where the model + * considers the results of the tokens with top_p probability mass. + * So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + * @param topP the topP value to set. + * @return the UpdateAssistantOptions object itself. + */ + @Generated + public UpdateAssistantOptions setTopP(Double topP) { + this.topP = topP; + return this; + } + + /** + * Get the responseFormat property: The response format of the tool calls used by this assistant. + * + * @return the responseFormat value. + */ + @Generated + public BinaryData getResponseFormat() { + return this.responseFormat; + } + + /** + * Set the responseFormat property: The response format of the tool calls used by this assistant. + * + * @param responseFormat the responseFormat value to set. + * @return the UpdateAssistantOptions object itself. + */ + @Generated + public UpdateAssistantOptions setResponseFormat(BinaryData responseFormat) { + this.responseFormat = responseFormat; + return this; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateAssistantThreadOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateAssistantThreadOptions.java new file mode 100644 index 0000000000000..0daf603e8f3b8 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateAssistantThreadOptions.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The details used to update an existing assistant thread. + */ +@Fluent +public final class UpdateAssistantThreadOptions implements JsonSerializable { + /* + * A set of resources that are made available to the assistant's tools in this thread. The resources are specific to + * the + * type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool + * requires + * a list of vector store IDs + */ + @Generated + private UpdateToolResourcesOptions toolResources; + + /* + * A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information + * about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 + * characters in length. + */ + @Generated + private Map metadata; + + /** + * Creates an instance of UpdateAssistantThreadOptions class. + */ + @Generated + public UpdateAssistantThreadOptions() { + } + + /** + * Get the toolResources property: A set of resources that are made available to the assistant's tools in this + * thread. The resources are specific to the + * type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool + * requires + * a list of vector store IDs. + * + * @return the toolResources value. + */ + @Generated + public UpdateToolResourcesOptions getToolResources() { + return this.toolResources; + } + + /** + * Set the toolResources property: A set of resources that are made available to the assistant's tools in this + * thread. The resources are specific to the + * type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool + * requires + * a list of vector store IDs. + * + * @param toolResources the toolResources value to set. + * @return the UpdateAssistantThreadOptions object itself. + */ + @Generated + public UpdateAssistantThreadOptions setToolResources(UpdateToolResourcesOptions toolResources) { + this.toolResources = toolResources; + return this; + } + + /** + * Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing + * additional information about that object in a structured format. Keys may be up to 64 characters in length and + * values may be up to 512 characters in length. + * + * @return the metadata value. + */ + @Generated + public Map getMetadata() { + return this.metadata; + } + + /** + * Set the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing + * additional information about that object in a structured format. Keys may be up to 64 characters in length and + * values may be up to 512 characters in length. + * + * @param metadata the metadata value to set. + * @return the UpdateAssistantThreadOptions object itself. + */ + @Generated + public UpdateAssistantThreadOptions setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("tool_resources", this.toolResources); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateAssistantThreadOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateAssistantThreadOptions if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateAssistantThreadOptions. + */ + @Generated + public static UpdateAssistantThreadOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateAssistantThreadOptions deserializedUpdateAssistantThreadOptions = new UpdateAssistantThreadOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tool_resources".equals(fieldName)) { + deserializedUpdateAssistantThreadOptions.toolResources + = UpdateToolResourcesOptions.fromJson(reader); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedUpdateAssistantThreadOptions.metadata = metadata; + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateAssistantThreadOptions; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateCodeInterpreterToolResourceOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateCodeInterpreterToolResourceOptions.java new file mode 100644 index 0000000000000..2abda6edfb370 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateCodeInterpreterToolResourceOptions.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Request object to update `code_interpreted` tool resources. + */ +@Fluent +public final class UpdateCodeInterpreterToolResourceOptions + implements JsonSerializable { + /* + * A list of file IDs to override the current list of the assistant. + */ + @Generated + private List fileIds; + + /** + * Creates an instance of UpdateCodeInterpreterToolResourceOptions class. + */ + @Generated + public UpdateCodeInterpreterToolResourceOptions() { + } + + /** + * Get the fileIds property: A list of file IDs to override the current list of the assistant. + * + * @return the fileIds value. + */ + @Generated + public List getFileIds() { + return this.fileIds; + } + + /** + * Set the fileIds property: A list of file IDs to override the current list of the assistant. + * + * @param fileIds the fileIds value to set. + * @return the UpdateCodeInterpreterToolResourceOptions object itself. + */ + @Generated + public UpdateCodeInterpreterToolResourceOptions setFileIds(List fileIds) { + this.fileIds = fileIds; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("fileIds", this.fileIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateCodeInterpreterToolResourceOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateCodeInterpreterToolResourceOptions if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateCodeInterpreterToolResourceOptions. + */ + @Generated + public static UpdateCodeInterpreterToolResourceOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateCodeInterpreterToolResourceOptions deserializedUpdateCodeInterpreterToolResourceOptions + = new UpdateCodeInterpreterToolResourceOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileIds".equals(fieldName)) { + List fileIds = reader.readArray(reader1 -> reader1.getString()); + deserializedUpdateCodeInterpreterToolResourceOptions.fileIds = fileIds; + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateCodeInterpreterToolResourceOptions; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateFileSearchToolResourceOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateFileSearchToolResourceOptions.java new file mode 100644 index 0000000000000..f1a0af6664bbe --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateFileSearchToolResourceOptions.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Request object to update `file_search` tool resources. + */ +@Fluent +public final class UpdateFileSearchToolResourceOptions + implements JsonSerializable { + /* + * A list of vector store IDs to override the current list of the assistant. + */ + @Generated + private List vectorStoreIds; + + /** + * Creates an instance of UpdateFileSearchToolResourceOptions class. + */ + @Generated + public UpdateFileSearchToolResourceOptions() { + } + + /** + * Get the vectorStoreIds property: A list of vector store IDs to override the current list of the assistant. + * + * @return the vectorStoreIds value. + */ + @Generated + public List getVectorStoreIds() { + return this.vectorStoreIds; + } + + /** + * Set the vectorStoreIds property: A list of vector store IDs to override the current list of the assistant. + * + * @param vectorStoreIds the vectorStoreIds value to set. + * @return the UpdateFileSearchToolResourceOptions object itself. + */ + @Generated + public UpdateFileSearchToolResourceOptions setVectorStoreIds(List vectorStoreIds) { + this.vectorStoreIds = vectorStoreIds; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("vector_store_ids", this.vectorStoreIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateFileSearchToolResourceOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateFileSearchToolResourceOptions if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateFileSearchToolResourceOptions. + */ + @Generated + public static UpdateFileSearchToolResourceOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateFileSearchToolResourceOptions deserializedUpdateFileSearchToolResourceOptions + = new UpdateFileSearchToolResourceOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vector_store_ids".equals(fieldName)) { + List vectorStoreIds = reader.readArray(reader1 -> reader1.getString()); + deserializedUpdateFileSearchToolResourceOptions.vectorStoreIds = vectorStoreIds; + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateFileSearchToolResourceOptions; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateToolResourcesOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateToolResourcesOptions.java new file mode 100644 index 0000000000000..19f479f7a4fe0 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateToolResourcesOptions.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request object. A set of resources that are used by the assistant's tools. The resources are specific to the type of + * tool. + * For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of + * vector store IDs. + */ +@Fluent +public final class UpdateToolResourcesOptions implements JsonSerializable { + /* + * Overrides the list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files + * associated with the tool. + */ + @Generated + private UpdateCodeInterpreterToolResourceOptions codeInterpreter; + + /* + * Overrides the vector store attached to this assistant. There can be a maximum of 1 vector store attached to the + * assistant. + */ + @Generated + private UpdateFileSearchToolResourceOptions fileSearch; + + /** + * Creates an instance of UpdateToolResourcesOptions class. + */ + @Generated + public UpdateToolResourcesOptions() { + } + + /** + * Get the codeInterpreter property: Overrides the list of file IDs made available to the `code_interpreter` tool. + * There can be a maximum of 20 files + * associated with the tool. + * + * @return the codeInterpreter value. + */ + @Generated + public UpdateCodeInterpreterToolResourceOptions getCodeInterpreter() { + return this.codeInterpreter; + } + + /** + * Set the codeInterpreter property: Overrides the list of file IDs made available to the `code_interpreter` tool. + * There can be a maximum of 20 files + * associated with the tool. + * + * @param codeInterpreter the codeInterpreter value to set. + * @return the UpdateToolResourcesOptions object itself. + */ + @Generated + public UpdateToolResourcesOptions setCodeInterpreter(UpdateCodeInterpreterToolResourceOptions codeInterpreter) { + this.codeInterpreter = codeInterpreter; + return this; + } + + /** + * Get the fileSearch property: Overrides the vector store attached to this assistant. There can be a maximum of 1 + * vector store attached to the assistant. + * + * @return the fileSearch value. + */ + @Generated + public UpdateFileSearchToolResourceOptions getFileSearch() { + return this.fileSearch; + } + + /** + * Set the fileSearch property: Overrides the vector store attached to this assistant. There can be a maximum of 1 + * vector store attached to the assistant. + * + * @param fileSearch the fileSearch value to set. + * @return the UpdateToolResourcesOptions object itself. + */ + @Generated + public UpdateToolResourcesOptions setFileSearch(UpdateFileSearchToolResourceOptions fileSearch) { + this.fileSearch = fileSearch; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("code_interpreter", this.codeInterpreter); + jsonWriter.writeJsonField("file_search", this.fileSearch); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateToolResourcesOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateToolResourcesOptions if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateToolResourcesOptions. + */ + @Generated + public static UpdateToolResourcesOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateToolResourcesOptions deserializedUpdateToolResourcesOptions = new UpdateToolResourcesOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code_interpreter".equals(fieldName)) { + deserializedUpdateToolResourcesOptions.codeInterpreter + = UpdateCodeInterpreterToolResourceOptions.fromJson(reader); + } else if ("file_search".equals(fieldName)) { + deserializedUpdateToolResourcesOptions.fileSearch + = UpdateFileSearchToolResourceOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateToolResourcesOptions; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStore.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStore.java new file mode 100644 index 0000000000000..24c952e8af10c --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStore.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.Map; + +/** + * A vector store is a collection of processed files can be used by the `file_search` tool. + */ +@Immutable +public final class VectorStore implements JsonSerializable { + /* + * The identifier, which can be referenced in API endpoints. + */ + @Generated + private final String id; + + /* + * The object type, which is always `vector_store` + */ + @Generated + private final String object = "vector_store"; + + /* + * The Unix timestamp (in seconds) for when the vector store was created. + */ + @Generated + private final long createdAt; + + /* + * The name of the vector store. + */ + @Generated + private final String name; + + /* + * The total number of bytes used by the files in the vector store. + */ + @Generated + private final int usageBytes; + + /* + * Files count grouped by status processed or being processed by this vector store. + */ + @Generated + private final VectorStoreFileCount fileCounts; + + /* + * The status of the vector store, which can be either `expired`, `in_progress`, or `completed`. A status of + * `completed` indicates that the vector store is ready for use. + */ + @Generated + private final VectorStoreStatus status; + + /* + * Details on when this vector store expires + */ + @Generated + private VectorStoreExpirationPolicy expiresAfter; + + /* + * The Unix timestamp (in seconds) for when the vector store will expire. + */ + @Generated + private Long expiresAt; + + /* + * The Unix timestamp (in seconds) for when the vector store was last active. + */ + @Generated + private final Long lastActiveAt; + + /* + * A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information + * about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 + * characters in length. + */ + @Generated + private final Map metadata; + + /** + * Creates an instance of VectorStore class. + * + * @param id the id value to set. + * @param createdAt the createdAt value to set. + * @param name the name value to set. + * @param usageBytes the usageBytes value to set. + * @param fileCounts the fileCounts value to set. + * @param status the status value to set. + * @param lastActiveAt the lastActiveAt value to set. + * @param metadata the metadata value to set. + */ + @Generated + private VectorStore(String id, OffsetDateTime createdAt, String name, int usageBytes, + VectorStoreFileCount fileCounts, VectorStoreStatus status, OffsetDateTime lastActiveAt, + Map metadata) { + this.id = id; + if (createdAt == null) { + this.createdAt = 0L; + } else { + this.createdAt = createdAt.toEpochSecond(); + } + this.name = name; + this.usageBytes = usageBytes; + this.fileCounts = fileCounts; + this.status = status; + if (lastActiveAt == null) { + this.lastActiveAt = null; + } else { + this.lastActiveAt = lastActiveAt.toEpochSecond(); + } + this.metadata = metadata; + } + + /** + * Get the id property: The identifier, which can be referenced in API endpoints. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the object property: The object type, which is always `vector_store`. + * + * @return the object value. + */ + @Generated + public String getObject() { + return this.object; + } + + /** + * Get the createdAt property: The Unix timestamp (in seconds) for when the vector store was created. + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC); + } + + /** + * Get the name property: The name of the vector store. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the usageBytes property: The total number of bytes used by the files in the vector store. + * + * @return the usageBytes value. + */ + @Generated + public int getUsageBytes() { + return this.usageBytes; + } + + /** + * Get the fileCounts property: Files count grouped by status processed or being processed by this vector store. + * + * @return the fileCounts value. + */ + @Generated + public VectorStoreFileCount getFileCounts() { + return this.fileCounts; + } + + /** + * Get the status property: The status of the vector store, which can be either `expired`, `in_progress`, or + * `completed`. A status of `completed` indicates that the vector store is ready for use. + * + * @return the status value. + */ + @Generated + public VectorStoreStatus getStatus() { + return this.status; + } + + /** + * Get the expiresAfter property: Details on when this vector store expires. + * + * @return the expiresAfter value. + */ + @Generated + public VectorStoreExpirationPolicy getExpiresAfter() { + return this.expiresAfter; + } + + /** + * Get the expiresAt property: The Unix timestamp (in seconds) for when the vector store will expire. + * + * @return the expiresAt value. + */ + @Generated + public OffsetDateTime getExpiresAt() { + if (this.expiresAt == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.expiresAt), ZoneOffset.UTC); + } + + /** + * Get the lastActiveAt property: The Unix timestamp (in seconds) for when the vector store was last active. + * + * @return the lastActiveAt value. + */ + @Generated + public OffsetDateTime getLastActiveAt() { + if (this.lastActiveAt == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.lastActiveAt), ZoneOffset.UTC); + } + + /** + * Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing + * additional information about that object in a structured format. Keys may be up to 64 characters in length and + * values may be up to 512 characters in length. + * + * @return the metadata value. + */ + @Generated + public Map getMetadata() { + return this.metadata; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("object", this.object); + jsonWriter.writeLongField("created_at", this.createdAt); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeIntField("usage_bytes", this.usageBytes); + jsonWriter.writeJsonField("file_counts", this.fileCounts); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeNumberField("last_active_at", this.lastActiveAt); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("expires_after", this.expiresAfter); + jsonWriter.writeNumberField("expires_at", this.expiresAt); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStore from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStore if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VectorStore. + */ + @Generated + public static VectorStore fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + OffsetDateTime createdAt = null; + String name = null; + int usageBytes = 0; + VectorStoreFileCount fileCounts = null; + VectorStoreStatus status = null; + OffsetDateTime lastActiveAt = null; + Map metadata = null; + VectorStoreExpirationPolicy expiresAfter = null; + Long expiresAt = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("created_at".equals(fieldName)) { + createdAt = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("usage_bytes".equals(fieldName)) { + usageBytes = reader.getInt(); + } else if ("file_counts".equals(fieldName)) { + fileCounts = VectorStoreFileCount.fromJson(reader); + } else if ("status".equals(fieldName)) { + status = VectorStoreStatus.fromString(reader.getString()); + } else if ("last_active_at".equals(fieldName)) { + Long lastActiveAtHolder = reader.getNullable(JsonReader::getLong); + if (lastActiveAtHolder != null) { + lastActiveAt + = OffsetDateTime.ofInstant(Instant.ofEpochSecond(lastActiveAtHolder), ZoneOffset.UTC); + } + } else if ("metadata".equals(fieldName)) { + metadata = reader.readMap(reader1 -> reader1.getString()); + } else if ("expires_after".equals(fieldName)) { + expiresAfter = VectorStoreExpirationPolicy.fromJson(reader); + } else if ("expires_at".equals(fieldName)) { + expiresAt = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + VectorStore deserializedVectorStore + = new VectorStore(id, createdAt, name, usageBytes, fileCounts, status, lastActiveAt, metadata); + deserializedVectorStore.expiresAfter = expiresAfter; + deserializedVectorStore.expiresAt = expiresAt; + + return deserializedVectorStore; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreDeletionStatus.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreDeletionStatus.java new file mode 100644 index 0000000000000..ab37f532a7b8f --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreDeletionStatus.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Response object for deleting a vector store. + */ +@Immutable +public final class VectorStoreDeletionStatus implements JsonSerializable { + /* + * The ID of the resource specified for deletion. + */ + @Generated + private final String id; + + /* + * A value indicating whether deletion was successful. + */ + @Generated + private final boolean deleted; + + /* + * The object type, which is always 'vector_store.deleted'. + */ + @Generated + private final String object = "vector_store.deleted"; + + /** + * Creates an instance of VectorStoreDeletionStatus class. + * + * @param id the id value to set. + * @param deleted the deleted value to set. + */ + @Generated + private VectorStoreDeletionStatus(String id, boolean deleted) { + this.id = id; + this.deleted = deleted; + } + + /** + * Get the id property: The ID of the resource specified for deletion. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the deleted property: A value indicating whether deletion was successful. + * + * @return the deleted value. + */ + @Generated + public boolean isDeleted() { + return this.deleted; + } + + /** + * Get the object property: The object type, which is always 'vector_store.deleted'. + * + * @return the object value. + */ + @Generated + public String getObject() { + return this.object; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeBooleanField("deleted", this.deleted); + jsonWriter.writeStringField("object", this.object); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreDeletionStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreDeletionStatus if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VectorStoreDeletionStatus. + */ + @Generated + public static VectorStoreDeletionStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + boolean deleted = false; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("deleted".equals(fieldName)) { + deleted = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + return new VectorStoreDeletionStatus(id, deleted); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreExpirationPolicy.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreExpirationPolicy.java new file mode 100644 index 0000000000000..5d9b3f1e8196a --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreExpirationPolicy.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The expiration policy for a vector store. + */ +@Immutable +public final class VectorStoreExpirationPolicy implements JsonSerializable { + /* + * Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`. + */ + @Generated + private final VectorStoreExpirationPolicyAnchor anchor; + + /* + * The anchor timestamp after which the expiration policy applies. + */ + @Generated + private final int days; + + /** + * Creates an instance of VectorStoreExpirationPolicy class. + * + * @param anchor the anchor value to set. + * @param days the days value to set. + */ + @Generated + public VectorStoreExpirationPolicy(VectorStoreExpirationPolicyAnchor anchor, int days) { + this.anchor = anchor; + this.days = days; + } + + /** + * Get the anchor property: Anchor timestamp after which the expiration policy applies. Supported anchors: + * `last_active_at`. + * + * @return the anchor value. + */ + @Generated + public VectorStoreExpirationPolicyAnchor getAnchor() { + return this.anchor; + } + + /** + * Get the days property: The anchor timestamp after which the expiration policy applies. + * + * @return the days value. + */ + @Generated + public int getDays() { + return this.days; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("anchor", this.anchor == null ? null : this.anchor.toString()); + jsonWriter.writeIntField("days", this.days); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreExpirationPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreExpirationPolicy if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VectorStoreExpirationPolicy. + */ + @Generated + public static VectorStoreExpirationPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorStoreExpirationPolicyAnchor anchor = null; + int days = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("anchor".equals(fieldName)) { + anchor = VectorStoreExpirationPolicyAnchor.fromString(reader.getString()); + } else if ("days".equals(fieldName)) { + days = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new VectorStoreExpirationPolicy(anchor, days); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreExpirationPolicyAnchor.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreExpirationPolicyAnchor.java new file mode 100644 index 0000000000000..ccb1460e03cb0 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreExpirationPolicyAnchor.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes the relationship between the days and the expiration of this vector store. + */ +public final class VectorStoreExpirationPolicyAnchor extends ExpandableStringEnum { + /** + * The expiration policy is based on the last time the vector store was active. + */ + @Generated + public static final VectorStoreExpirationPolicyAnchor LAST_ACTIVE_AT = fromString("last_active_at"); + + /** + * Creates a new instance of VectorStoreExpirationPolicyAnchor value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public VectorStoreExpirationPolicyAnchor() { + } + + /** + * Creates or finds a VectorStoreExpirationPolicyAnchor from its string representation. + * + * @param name a name to look for. + * @return the corresponding VectorStoreExpirationPolicyAnchor. + */ + @Generated + public static VectorStoreExpirationPolicyAnchor fromString(String name) { + return fromString(name, VectorStoreExpirationPolicyAnchor.class); + } + + /** + * Gets known VectorStoreExpirationPolicyAnchor values. + * + * @return known VectorStoreExpirationPolicyAnchor values. + */ + @Generated + public static Collection values() { + return values(VectorStoreExpirationPolicyAnchor.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFile.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFile.java new file mode 100644 index 0000000000000..058a483c2e3c7 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFile.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * Description of a file attached to a vector store. + */ +@Immutable +public final class VectorStoreFile implements JsonSerializable { + /* + * The identifier, which can be referenced in API endpoints. + */ + @Generated + private final String id; + + /* + * The object type, which is always `vector_store.file`. + */ + @Generated + private final String object = "vector_store.file"; + + /* + * The total vector store usage in bytes. Note that this may be different from the original file + * size. + */ + @Generated + private final int usageBytes; + + /* + * The Unix timestamp (in seconds) for when the vector store file was created. + */ + @Generated + private final long createdAt; + + /* + * The ID of the vector store that the file is attached to. + */ + @Generated + private final String vectorStoreId; + + /* + * The status of the vector store file, which can be either `in_progress`, `completed`, `cancelled`, or `failed`. + * The status `completed` indicates that the vector store file is ready for use. + */ + @Generated + private final VectorStoreFileStatus status; + + /* + * The last error associated with this vector store file. Will be `null` if there are no errors. + */ + @Generated + private final VectorStoreFileError lastError; + + /** + * Creates an instance of VectorStoreFile class. + * + * @param id the id value to set. + * @param usageBytes the usageBytes value to set. + * @param createdAt the createdAt value to set. + * @param vectorStoreId the vectorStoreId value to set. + * @param status the status value to set. + * @param lastError the lastError value to set. + */ + @Generated + private VectorStoreFile(String id, int usageBytes, OffsetDateTime createdAt, String vectorStoreId, + VectorStoreFileStatus status, VectorStoreFileError lastError) { + this.id = id; + this.usageBytes = usageBytes; + if (createdAt == null) { + this.createdAt = 0L; + } else { + this.createdAt = createdAt.toEpochSecond(); + } + this.vectorStoreId = vectorStoreId; + this.status = status; + this.lastError = lastError; + } + + /** + * Get the id property: The identifier, which can be referenced in API endpoints. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the object property: The object type, which is always `vector_store.file`. + * + * @return the object value. + */ + @Generated + public String getObject() { + return this.object; + } + + /** + * Get the usageBytes property: The total vector store usage in bytes. Note that this may be different from the + * original file + * size. + * + * @return the usageBytes value. + */ + @Generated + public int getUsageBytes() { + return this.usageBytes; + } + + /** + * Get the createdAt property: The Unix timestamp (in seconds) for when the vector store file was created. + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC); + } + + /** + * Get the vectorStoreId property: The ID of the vector store that the file is attached to. + * + * @return the vectorStoreId value. + */ + @Generated + public String getVectorStoreId() { + return this.vectorStoreId; + } + + /** + * Get the status property: The status of the vector store file, which can be either `in_progress`, `completed`, + * `cancelled`, or `failed`. The status `completed` indicates that the vector store file is ready for use. + * + * @return the status value. + */ + @Generated + public VectorStoreFileStatus getStatus() { + return this.status; + } + + /** + * Get the lastError property: The last error associated with this vector store file. Will be `null` if there are no + * errors. + * + * @return the lastError value. + */ + @Generated + public VectorStoreFileError getLastError() { + return this.lastError; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("object", this.object); + jsonWriter.writeIntField("usage_bytes", this.usageBytes); + jsonWriter.writeLongField("created_at", this.createdAt); + jsonWriter.writeStringField("vector_store_id", this.vectorStoreId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("last_error", this.lastError); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreFile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreFile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VectorStoreFile. + */ + @Generated + public static VectorStoreFile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + int usageBytes = 0; + OffsetDateTime createdAt = null; + String vectorStoreId = null; + VectorStoreFileStatus status = null; + VectorStoreFileError lastError = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("usage_bytes".equals(fieldName)) { + usageBytes = reader.getInt(); + } else if ("created_at".equals(fieldName)) { + createdAt = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else if ("vector_store_id".equals(fieldName)) { + vectorStoreId = reader.getString(); + } else if ("status".equals(fieldName)) { + status = VectorStoreFileStatus.fromString(reader.getString()); + } else if ("last_error".equals(fieldName)) { + lastError = VectorStoreFileError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return new VectorStoreFile(id, usageBytes, createdAt, vectorStoreId, status, lastError); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileBatch.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileBatch.java new file mode 100644 index 0000000000000..ae065c50e57dd --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileBatch.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * A batch of files attached to a vector store. + */ +@Immutable +public final class VectorStoreFileBatch implements JsonSerializable { + /* + * The identifier, which can be referenced in API endpoints. + */ + @Generated + private final String id; + + /* + * The object type, which is always `vector_store.file_batch`. + */ + @Generated + private final String object = "vector_store.files_batch"; + + /* + * The Unix timestamp (in seconds) for when the vector store files batch was created. + */ + @Generated + private final long createdAt; + + /* + * The ID of the vector store that the file is attached to. + */ + @Generated + private final String vectorStoreId; + + /* + * The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or + * `failed`. + */ + @Generated + private final VectorStoreFileBatchStatus status; + + /* + * Files count grouped by status processed or being processed by this vector store. + */ + @Generated + private final VectorStoreFileCount fileCounts; + + /** + * Creates an instance of VectorStoreFileBatch class. + * + * @param id the id value to set. + * @param createdAt the createdAt value to set. + * @param vectorStoreId the vectorStoreId value to set. + * @param status the status value to set. + * @param fileCounts the fileCounts value to set. + */ + @Generated + private VectorStoreFileBatch(String id, OffsetDateTime createdAt, String vectorStoreId, + VectorStoreFileBatchStatus status, VectorStoreFileCount fileCounts) { + this.id = id; + if (createdAt == null) { + this.createdAt = 0L; + } else { + this.createdAt = createdAt.toEpochSecond(); + } + this.vectorStoreId = vectorStoreId; + this.status = status; + this.fileCounts = fileCounts; + } + + /** + * Get the id property: The identifier, which can be referenced in API endpoints. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the object property: The object type, which is always `vector_store.file_batch`. + * + * @return the object value. + */ + @Generated + public String getObject() { + return this.object; + } + + /** + * Get the createdAt property: The Unix timestamp (in seconds) for when the vector store files batch was created. + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC); + } + + /** + * Get the vectorStoreId property: The ID of the vector store that the file is attached to. + * + * @return the vectorStoreId value. + */ + @Generated + public String getVectorStoreId() { + return this.vectorStoreId; + } + + /** + * Get the status property: The status of the vector store files batch, which can be either `in_progress`, + * `completed`, `cancelled` or `failed`. + * + * @return the status value. + */ + @Generated + public VectorStoreFileBatchStatus getStatus() { + return this.status; + } + + /** + * Get the fileCounts property: Files count grouped by status processed or being processed by this vector store. + * + * @return the fileCounts value. + */ + @Generated + public VectorStoreFileCount getFileCounts() { + return this.fileCounts; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("object", this.object); + jsonWriter.writeLongField("created_at", this.createdAt); + jsonWriter.writeStringField("vector_store_id", this.vectorStoreId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("file_counts", this.fileCounts); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreFileBatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreFileBatch if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VectorStoreFileBatch. + */ + @Generated + public static VectorStoreFileBatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + OffsetDateTime createdAt = null; + String vectorStoreId = null; + VectorStoreFileBatchStatus status = null; + VectorStoreFileCount fileCounts = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("created_at".equals(fieldName)) { + createdAt = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else if ("vector_store_id".equals(fieldName)) { + vectorStoreId = reader.getString(); + } else if ("status".equals(fieldName)) { + status = VectorStoreFileBatchStatus.fromString(reader.getString()); + } else if ("file_counts".equals(fieldName)) { + fileCounts = VectorStoreFileCount.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return new VectorStoreFileBatch(id, createdAt, vectorStoreId, status, fileCounts); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileBatchStatus.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileBatchStatus.java new file mode 100644 index 0000000000000..05ab55bd9f41e --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileBatchStatus.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the vector store file batch. + */ +public final class VectorStoreFileBatchStatus extends ExpandableStringEnum { + /** + * The vector store is still processing this file batch. + */ + @Generated + public static final VectorStoreFileBatchStatus IN_PROGRESS = fromString("in_progress"); + + /** + * the vector store file batch is ready for use. + */ + @Generated + public static final VectorStoreFileBatchStatus COMPLETED = fromString("completed"); + + /** + * The vector store file batch was cancelled. + */ + @Generated + public static final VectorStoreFileBatchStatus CANCELLED = fromString("cancelled"); + + /** + * The vector store file batch failed to process. + */ + @Generated + public static final VectorStoreFileBatchStatus FAILED = fromString("failed"); + + /** + * Creates a new instance of VectorStoreFileBatchStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public VectorStoreFileBatchStatus() { + } + + /** + * Creates or finds a VectorStoreFileBatchStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VectorStoreFileBatchStatus. + */ + @Generated + public static VectorStoreFileBatchStatus fromString(String name) { + return fromString(name, VectorStoreFileBatchStatus.class); + } + + /** + * Gets known VectorStoreFileBatchStatus values. + * + * @return known VectorStoreFileBatchStatus values. + */ + @Generated + public static Collection values() { + return values(VectorStoreFileBatchStatus.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileCount.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileCount.java new file mode 100644 index 0000000000000..6564c71b382bd --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileCount.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Counts of files processed or being processed by this vector store grouped by status. + */ +@Immutable +public final class VectorStoreFileCount implements JsonSerializable { + /* + * The number of files that are currently being processed. + */ + @Generated + private final int inProgress; + + /* + * The number of files that have been successfully processed. + */ + @Generated + private final int completed; + + /* + * The number of files that have failed to process. + */ + @Generated + private final int failed; + + /* + * The number of files that were cancelled. + */ + @Generated + private final int cancelled; + + /* + * The total number of files. + */ + @Generated + private final int total; + + /** + * Creates an instance of VectorStoreFileCount class. + * + * @param inProgress the inProgress value to set. + * @param completed the completed value to set. + * @param failed the failed value to set. + * @param cancelled the cancelled value to set. + * @param total the total value to set. + */ + @Generated + private VectorStoreFileCount(int inProgress, int completed, int failed, int cancelled, int total) { + this.inProgress = inProgress; + this.completed = completed; + this.failed = failed; + this.cancelled = cancelled; + this.total = total; + } + + /** + * Get the inProgress property: The number of files that are currently being processed. + * + * @return the inProgress value. + */ + @Generated + public int getInProgress() { + return this.inProgress; + } + + /** + * Get the completed property: The number of files that have been successfully processed. + * + * @return the completed value. + */ + @Generated + public int getCompleted() { + return this.completed; + } + + /** + * Get the failed property: The number of files that have failed to process. + * + * @return the failed value. + */ + @Generated + public int getFailed() { + return this.failed; + } + + /** + * Get the cancelled property: The number of files that were cancelled. + * + * @return the cancelled value. + */ + @Generated + public int getCancelled() { + return this.cancelled; + } + + /** + * Get the total property: The total number of files. + * + * @return the total value. + */ + @Generated + public int getTotal() { + return this.total; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("in_progress", this.inProgress); + jsonWriter.writeIntField("completed", this.completed); + jsonWriter.writeIntField("failed", this.failed); + jsonWriter.writeIntField("cancelled", this.cancelled); + jsonWriter.writeIntField("total", this.total); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreFileCount from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreFileCount if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VectorStoreFileCount. + */ + @Generated + public static VectorStoreFileCount fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int inProgress = 0; + int completed = 0; + int failed = 0; + int cancelled = 0; + int total = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("in_progress".equals(fieldName)) { + inProgress = reader.getInt(); + } else if ("completed".equals(fieldName)) { + completed = reader.getInt(); + } else if ("failed".equals(fieldName)) { + failed = reader.getInt(); + } else if ("cancelled".equals(fieldName)) { + cancelled = reader.getInt(); + } else if ("total".equals(fieldName)) { + total = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new VectorStoreFileCount(inProgress, completed, failed, cancelled, total); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileDeletionStatus.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileDeletionStatus.java new file mode 100644 index 0000000000000..b419d87523c3b --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileDeletionStatus.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Response object for deleting a vector store file relationship. + */ +@Immutable +public final class VectorStoreFileDeletionStatus implements JsonSerializable { + /* + * The ID of the resource specified for deletion. + */ + @Generated + private final String id; + + /* + * A value indicating whether deletion was successful. + */ + @Generated + private final boolean deleted; + + /* + * The object type, which is always 'vector_store.deleted'. + */ + @Generated + private final String object = "vector_store.file.deleted"; + + /** + * Creates an instance of VectorStoreFileDeletionStatus class. + * + * @param id the id value to set. + * @param deleted the deleted value to set. + */ + @Generated + private VectorStoreFileDeletionStatus(String id, boolean deleted) { + this.id = id; + this.deleted = deleted; + } + + /** + * Get the id property: The ID of the resource specified for deletion. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the deleted property: A value indicating whether deletion was successful. + * + * @return the deleted value. + */ + @Generated + public boolean isDeleted() { + return this.deleted; + } + + /** + * Get the object property: The object type, which is always 'vector_store.deleted'. + * + * @return the object value. + */ + @Generated + public String getObject() { + return this.object; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeBooleanField("deleted", this.deleted); + jsonWriter.writeStringField("object", this.object); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreFileDeletionStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreFileDeletionStatus if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VectorStoreFileDeletionStatus. + */ + @Generated + public static VectorStoreFileDeletionStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + boolean deleted = false; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("deleted".equals(fieldName)) { + deleted = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + return new VectorStoreFileDeletionStatus(id, deleted); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileError.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileError.java new file mode 100644 index 0000000000000..34e3ac1f889ba --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileError.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details on the error that may have ocurred while processing a file for this vector store. + */ +@Immutable +public final class VectorStoreFileError implements JsonSerializable { + /* + * One of `server_error` or `rate_limit_exceeded`. + */ + @Generated + private final VectorStoreFileErrorCode code; + + /* + * A human-readable description of the error. + */ + @Generated + private final String message; + + /** + * Creates an instance of VectorStoreFileError class. + * + * @param code the code value to set. + * @param message the message value to set. + */ + @Generated + private VectorStoreFileError(VectorStoreFileErrorCode code, String message) { + this.code = code; + this.message = message; + } + + /** + * Get the code property: One of `server_error` or `rate_limit_exceeded`. + * + * @return the code value. + */ + @Generated + public VectorStoreFileErrorCode getCode() { + return this.code; + } + + /** + * Get the message property: A human-readable description of the error. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code == null ? null : this.code.toString()); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreFileError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreFileError if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VectorStoreFileError. + */ + @Generated + public static VectorStoreFileError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorStoreFileErrorCode code = null; + String message = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + code = VectorStoreFileErrorCode.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + message = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new VectorStoreFileError(code, message); + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileErrorCode.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileErrorCode.java new file mode 100644 index 0000000000000..c8b551f82952a --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileErrorCode.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Error code variants for vector store file processing. + */ +public final class VectorStoreFileErrorCode extends ExpandableStringEnum { + /** + * An internal error occurred. + */ + @Generated + public static final VectorStoreFileErrorCode INTERNAL_ERROR = fromString("internal_error"); + + /** + * The file was not found. + */ + @Generated + public static final VectorStoreFileErrorCode FILE_NOT_FOUND = fromString("file_not_found"); + + /** + * The file could not be parsed. + */ + @Generated + public static final VectorStoreFileErrorCode PARSING_ERROR = fromString("parsing_error"); + + /** + * The file has an unhandled mime type. + */ + @Generated + public static final VectorStoreFileErrorCode UNHANDLED_MIME_TYPE = fromString("unhandled_mime_type"); + + /** + * Creates a new instance of VectorStoreFileErrorCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public VectorStoreFileErrorCode() { + } + + /** + * Creates or finds a VectorStoreFileErrorCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding VectorStoreFileErrorCode. + */ + @Generated + public static VectorStoreFileErrorCode fromString(String name) { + return fromString(name, VectorStoreFileErrorCode.class); + } + + /** + * Gets known VectorStoreFileErrorCode values. + * + * @return known VectorStoreFileErrorCode values. + */ + @Generated + public static Collection values() { + return values(VectorStoreFileErrorCode.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileStatus.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileStatus.java new file mode 100644 index 0000000000000..96d09709009db --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileStatus.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Vector store file status. + */ +public final class VectorStoreFileStatus extends ExpandableStringEnum { + /** + * The file is currently being processed. + */ + @Generated + public static final VectorStoreFileStatus IN_PROGRESS = fromString("in_progress"); + + /** + * The file has been successfully processed. + */ + @Generated + public static final VectorStoreFileStatus COMPLETED = fromString("completed"); + + /** + * The file has failed to process. + */ + @Generated + public static final VectorStoreFileStatus FAILED = fromString("failed"); + + /** + * The file was cancelled. + */ + @Generated + public static final VectorStoreFileStatus CANCELLED = fromString("cancelled"); + + /** + * Creates a new instance of VectorStoreFileStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public VectorStoreFileStatus() { + } + + /** + * Creates or finds a VectorStoreFileStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VectorStoreFileStatus. + */ + @Generated + public static VectorStoreFileStatus fromString(String name) { + return fromString(name, VectorStoreFileStatus.class); + } + + /** + * Gets known VectorStoreFileStatus values. + * + * @return known VectorStoreFileStatus values. + */ + @Generated + public static Collection values() { + return values(VectorStoreFileStatus.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileStatusFilter.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileStatusFilter.java new file mode 100644 index 0000000000000..d2f2bad26fddd --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileStatusFilter.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Query parameter filter for vector store file retrieval endpoint. + */ +public final class VectorStoreFileStatusFilter extends ExpandableStringEnum { + /** + * Retrieve only files that are currently being processed. + */ + @Generated + public static final VectorStoreFileStatusFilter IN_PROGRESS = fromString("in_progress"); + + /** + * Retrieve only files that have been successfully processed. + */ + @Generated + public static final VectorStoreFileStatusFilter COMPLETED = fromString("completed"); + + /** + * Retrieve only files that have failed to process. + */ + @Generated + public static final VectorStoreFileStatusFilter FAILED = fromString("failed"); + + /** + * Retrieve only files that were cancelled. + */ + @Generated + public static final VectorStoreFileStatusFilter CANCELLED = fromString("cancelled"); + + /** + * Creates a new instance of VectorStoreFileStatusFilter value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public VectorStoreFileStatusFilter() { + } + + /** + * Creates or finds a VectorStoreFileStatusFilter from its string representation. + * + * @param name a name to look for. + * @return the corresponding VectorStoreFileStatusFilter. + */ + @Generated + public static VectorStoreFileStatusFilter fromString(String name) { + return fromString(name, VectorStoreFileStatusFilter.class); + } + + /** + * Gets known VectorStoreFileStatusFilter values. + * + * @return known VectorStoreFileStatusFilter values. + */ + @Generated + public static Collection values() { + return values(VectorStoreFileStatusFilter.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreOptions.java new file mode 100644 index 0000000000000..6d0cd00861450 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreOptions.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Request object for creating a vector store. + */ +@Fluent +public final class VectorStoreOptions implements JsonSerializable { + /* + * A list of file IDs that the vector store should use. Useful for tools like `file_search` that can access files. + */ + @Generated + private List fileIds; + + /* + * The name of the vector store. + */ + @Generated + private String name; + + /* + * Details on when this vector store expires + */ + @Generated + private VectorStoreExpirationPolicy expiresAfter; + + /* + * A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information + * about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 + * characters in length. + */ + @Generated + private Map metadata; + + /** + * Creates an instance of VectorStoreOptions class. + */ + @Generated + public VectorStoreOptions() { + } + + /** + * Get the fileIds property: A list of file IDs that the vector store should use. Useful for tools like + * `file_search` that can access files. + * + * @return the fileIds value. + */ + @Generated + public List getFileIds() { + return this.fileIds; + } + + /** + * Set the fileIds property: A list of file IDs that the vector store should use. Useful for tools like + * `file_search` that can access files. + * + * @param fileIds the fileIds value to set. + * @return the VectorStoreOptions object itself. + */ + @Generated + public VectorStoreOptions setFileIds(List fileIds) { + this.fileIds = fileIds; + return this; + } + + /** + * Get the name property: The name of the vector store. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the vector store. + * + * @param name the name value to set. + * @return the VectorStoreOptions object itself. + */ + @Generated + public VectorStoreOptions setName(String name) { + this.name = name; + return this; + } + + /** + * Get the expiresAfter property: Details on when this vector store expires. + * + * @return the expiresAfter value. + */ + @Generated + public VectorStoreExpirationPolicy getExpiresAfter() { + return this.expiresAfter; + } + + /** + * Set the expiresAfter property: Details on when this vector store expires. + * + * @param expiresAfter the expiresAfter value to set. + * @return the VectorStoreOptions object itself. + */ + @Generated + public VectorStoreOptions setExpiresAfter(VectorStoreExpirationPolicy expiresAfter) { + this.expiresAfter = expiresAfter; + return this; + } + + /** + * Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing + * additional information about that object in a structured format. Keys may be up to 64 characters in length and + * values may be up to 512 characters in length. + * + * @return the metadata value. + */ + @Generated + public Map getMetadata() { + return this.metadata; + } + + /** + * Set the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing + * additional information about that object in a structured format. Keys may be up to 64 characters in length and + * values may be up to 512 characters in length. + * + * @param metadata the metadata value to set. + * @return the VectorStoreOptions object itself. + */ + @Generated + public VectorStoreOptions setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("expires_after", this.expiresAfter); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VectorStoreOptions. + */ + @Generated + public static VectorStoreOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorStoreOptions deserializedVectorStoreOptions = new VectorStoreOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("file_ids".equals(fieldName)) { + List fileIds = reader.readArray(reader1 -> reader1.getString()); + deserializedVectorStoreOptions.fileIds = fileIds; + } else if ("name".equals(fieldName)) { + deserializedVectorStoreOptions.name = reader.getString(); + } else if ("expires_after".equals(fieldName)) { + deserializedVectorStoreOptions.expiresAfter = VectorStoreExpirationPolicy.fromJson(reader); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedVectorStoreOptions.metadata = metadata; + } else { + reader.skipChildren(); + } + } + + return deserializedVectorStoreOptions; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStatus.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStatus.java new file mode 100644 index 0000000000000..a66c577705461 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreStatus.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Vector store possible status. + */ +public final class VectorStoreStatus extends ExpandableStringEnum { + /** + * expired status indicates that this vector store has expired and is no longer available for use. + */ + @Generated + public static final VectorStoreStatus EXPIRED = fromString("expired"); + + /** + * in_progress status indicates that this vector store is still processing files. + */ + @Generated + public static final VectorStoreStatus IN_PROGRESS = fromString("in_progress"); + + /** + * completed status indicates that this vector store is ready for use. + */ + @Generated + public static final VectorStoreStatus COMPLETED = fromString("completed"); + + /** + * Creates a new instance of VectorStoreStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public VectorStoreStatus() { + } + + /** + * Creates or finds a VectorStoreStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VectorStoreStatus. + */ + @Generated + public static VectorStoreStatus fromString(String name) { + return fromString(name, VectorStoreStatus.class); + } + + /** + * Gets known VectorStoreStatus values. + * + * @return known VectorStoreStatus values. + */ + @Generated + public static Collection values() { + return values(VectorStoreStatus.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreUpdateOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreUpdateOptions.java new file mode 100644 index 0000000000000..e66e63b2bf1a9 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreUpdateOptions.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Request object for updating a vector store. + */ +@Fluent +public final class VectorStoreUpdateOptions implements JsonSerializable { + /* + * The name of the vector store. + */ + @Generated + private String name; + + /* + * Details on when this vector store expires + */ + @Generated + private VectorStoreExpirationPolicy expiresAfter; + + /* + * A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information + * about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 + * characters in length. + */ + @Generated + private Map metadata; + + /** + * Creates an instance of VectorStoreUpdateOptions class. + */ + @Generated + public VectorStoreUpdateOptions() { + } + + /** + * Get the name property: The name of the vector store. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the vector store. + * + * @param name the name value to set. + * @return the VectorStoreUpdateOptions object itself. + */ + @Generated + public VectorStoreUpdateOptions setName(String name) { + this.name = name; + return this; + } + + /** + * Get the expiresAfter property: Details on when this vector store expires. + * + * @return the expiresAfter value. + */ + @Generated + public VectorStoreExpirationPolicy getExpiresAfter() { + return this.expiresAfter; + } + + /** + * Set the expiresAfter property: Details on when this vector store expires. + * + * @param expiresAfter the expiresAfter value to set. + * @return the VectorStoreUpdateOptions object itself. + */ + @Generated + public VectorStoreUpdateOptions setExpiresAfter(VectorStoreExpirationPolicy expiresAfter) { + this.expiresAfter = expiresAfter; + return this; + } + + /** + * Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing + * additional information about that object in a structured format. Keys may be up to 64 characters in length and + * values may be up to 512 characters in length. + * + * @return the metadata value. + */ + @Generated + public Map getMetadata() { + return this.metadata; + } + + /** + * Set the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing + * additional information about that object in a structured format. Keys may be up to 64 characters in length and + * values may be up to 512 characters in length. + * + * @param metadata the metadata value to set. + * @return the VectorStoreUpdateOptions object itself. + */ + @Generated + public VectorStoreUpdateOptions setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("expires_after", this.expiresAfter); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorStoreUpdateOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorStoreUpdateOptions if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VectorStoreUpdateOptions. + */ + @Generated + public static VectorStoreUpdateOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorStoreUpdateOptions deserializedVectorStoreUpdateOptions = new VectorStoreUpdateOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVectorStoreUpdateOptions.name = reader.getString(); + } else if ("expires_after".equals(fieldName)) { + deserializedVectorStoreUpdateOptions.expiresAfter = VectorStoreExpirationPolicy.fromJson(reader); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedVectorStoreUpdateOptions.metadata = metadata; + } else { + reader.skipChildren(); + } + } + + return deserializedVectorStoreUpdateOptions; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/resources/META-INF/azure-ai-openai-assistants_apiview_properties.json b/sdk/openai/azure-ai-openai-assistants/src/main/resources/META-INF/azure-ai-openai-assistants_apiview_properties.json index 96aa335976e34..6ebf03ed051fa 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/resources/META-INF/azure-ai-openai-assistants_apiview_properties.json +++ b/sdk/openai/azure-ai-openai-assistants/src/main/resources/META-INF/azure-ai-openai-assistants_apiview_properties.json @@ -4,9 +4,9 @@ "com.azure.ai.openai.assistants.AssistantsAsyncClient": "Azure.AI.OpenAI.Assistants.AssistantsClient", "com.azure.ai.openai.assistants.AssistantsAsyncClient.cancelRun": "Azure.AI.OpenAI.Assistants.cancelRun", "com.azure.ai.openai.assistants.AssistantsAsyncClient.cancelRunWithResponse": "Azure.AI.OpenAI.Assistants.cancelRun", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.cancelVectorStoreFileBatch": "Azure.AI.OpenAI.Assistants.cancelVectorStoreFileBatch", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.cancelVectorStoreFileBatchWithResponse": "Azure.AI.OpenAI.Assistants.cancelVectorStoreFileBatch", "com.azure.ai.openai.assistants.AssistantsAsyncClient.createAssistant": "Azure.AI.OpenAI.Assistants.createAssistant", - "com.azure.ai.openai.assistants.AssistantsAsyncClient.createAssistantFile": "Azure.AI.OpenAI.Assistants.createAssistantFile", - "com.azure.ai.openai.assistants.AssistantsAsyncClient.createAssistantFileWithResponse": "Azure.AI.OpenAI.Assistants.createAssistantFile", "com.azure.ai.openai.assistants.AssistantsAsyncClient.createAssistantWithResponse": "Azure.AI.OpenAI.Assistants.createAssistant", "com.azure.ai.openai.assistants.AssistantsAsyncClient.createMessage": "Azure.AI.OpenAI.Assistants.createMessage", "com.azure.ai.openai.assistants.AssistantsAsyncClient.createMessageWithResponse": "Azure.AI.OpenAI.Assistants.createMessage", @@ -16,25 +16,29 @@ "com.azure.ai.openai.assistants.AssistantsAsyncClient.createThreadAndRun": "Azure.AI.OpenAI.Assistants.createThreadAndRun", "com.azure.ai.openai.assistants.AssistantsAsyncClient.createThreadAndRunWithResponse": "Azure.AI.OpenAI.Assistants.createThreadAndRun", "com.azure.ai.openai.assistants.AssistantsAsyncClient.createThreadWithResponse": "Azure.AI.OpenAI.Assistants.createThread", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.createVectorStore": "Azure.AI.OpenAI.Assistants.createVectorStore", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.createVectorStoreFile": "Azure.AI.OpenAI.Assistants.createVectorStoreFile", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.createVectorStoreFileBatch": "Azure.AI.OpenAI.Assistants.createVectorStoreFileBatch", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.createVectorStoreFileBatchWithResponse": "Azure.AI.OpenAI.Assistants.createVectorStoreFileBatch", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.createVectorStoreFileWithResponse": "Azure.AI.OpenAI.Assistants.createVectorStoreFile", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.createVectorStoreWithResponse": "Azure.AI.OpenAI.Assistants.createVectorStore", "com.azure.ai.openai.assistants.AssistantsAsyncClient.deleteAssistant": "Azure.AI.OpenAI.Assistants.deleteAssistant", - "com.azure.ai.openai.assistants.AssistantsAsyncClient.deleteAssistantFile": "Azure.AI.OpenAI.Assistants.deleteAssistantFile", - "com.azure.ai.openai.assistants.AssistantsAsyncClient.deleteAssistantFileWithResponse": "Azure.AI.OpenAI.Assistants.deleteAssistantFile", "com.azure.ai.openai.assistants.AssistantsAsyncClient.deleteAssistantWithResponse": "Azure.AI.OpenAI.Assistants.deleteAssistant", "com.azure.ai.openai.assistants.AssistantsAsyncClient.deleteFile": "Azure.AI.OpenAI.Assistants.deleteFile", "com.azure.ai.openai.assistants.AssistantsAsyncClient.deleteFileWithResponse": "Azure.AI.OpenAI.Assistants.deleteFile", "com.azure.ai.openai.assistants.AssistantsAsyncClient.deleteThread": "Azure.AI.OpenAI.Assistants.deleteThread", "com.azure.ai.openai.assistants.AssistantsAsyncClient.deleteThreadWithResponse": "Azure.AI.OpenAI.Assistants.deleteThread", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.deleteVectorStore": "Azure.AI.OpenAI.Assistants.deleteVectorStore", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.deleteVectorStoreFile": "Azure.AI.OpenAI.Assistants.deleteVectorStoreFile", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.deleteVectorStoreFileWithResponse": "Azure.AI.OpenAI.Assistants.deleteVectorStoreFile", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.deleteVectorStoreWithResponse": "Azure.AI.OpenAI.Assistants.deleteVectorStore", "com.azure.ai.openai.assistants.AssistantsAsyncClient.getAssistant": "Azure.AI.OpenAI.Assistants.getAssistant", - "com.azure.ai.openai.assistants.AssistantsAsyncClient.getAssistantFile": "Azure.AI.OpenAI.Assistants.getAssistantFile", - "com.azure.ai.openai.assistants.AssistantsAsyncClient.getAssistantFileWithResponse": "Azure.AI.OpenAI.Assistants.getAssistantFile", "com.azure.ai.openai.assistants.AssistantsAsyncClient.getAssistantWithResponse": "Azure.AI.OpenAI.Assistants.getAssistant", "com.azure.ai.openai.assistants.AssistantsAsyncClient.getFile": "Azure.AI.OpenAI.Assistants.getFile", "com.azure.ai.openai.assistants.AssistantsAsyncClient.getFileContent": "Azure.AI.OpenAI.Assistants.getFileContent", "com.azure.ai.openai.assistants.AssistantsAsyncClient.getFileContentWithResponse": "Azure.AI.OpenAI.Assistants.getFileContent", "com.azure.ai.openai.assistants.AssistantsAsyncClient.getFileWithResponse": "Azure.AI.OpenAI.Assistants.getFile", "com.azure.ai.openai.assistants.AssistantsAsyncClient.getMessage": "Azure.AI.OpenAI.Assistants.getMessage", - "com.azure.ai.openai.assistants.AssistantsAsyncClient.getMessageFile": "Azure.AI.OpenAI.Assistants.getMessageFile", - "com.azure.ai.openai.assistants.AssistantsAsyncClient.getMessageFileWithResponse": "Azure.AI.OpenAI.Assistants.getMessageFile", "com.azure.ai.openai.assistants.AssistantsAsyncClient.getMessageWithResponse": "Azure.AI.OpenAI.Assistants.getMessage", "com.azure.ai.openai.assistants.AssistantsAsyncClient.getRun": "Azure.AI.OpenAI.Assistants.getRun", "com.azure.ai.openai.assistants.AssistantsAsyncClient.getRunStep": "Azure.AI.OpenAI.Assistants.getRunStep", @@ -42,20 +46,30 @@ "com.azure.ai.openai.assistants.AssistantsAsyncClient.getRunWithResponse": "Azure.AI.OpenAI.Assistants.getRun", "com.azure.ai.openai.assistants.AssistantsAsyncClient.getThread": "Azure.AI.OpenAI.Assistants.getThread", "com.azure.ai.openai.assistants.AssistantsAsyncClient.getThreadWithResponse": "Azure.AI.OpenAI.Assistants.getThread", - "com.azure.ai.openai.assistants.AssistantsAsyncClient.listAssistantFiles": "Azure.AI.OpenAI.Assistants.listAssistantFiles", - "com.azure.ai.openai.assistants.AssistantsAsyncClient.listAssistantFilesWithResponse": "Azure.AI.OpenAI.Assistants.listAssistantFiles", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.getVectorStore": "Azure.AI.OpenAI.Assistants.getVectorStore", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.getVectorStoreFile": "Azure.AI.OpenAI.Assistants.getVectorStoreFile", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.getVectorStoreFileBatch": "Azure.AI.OpenAI.Assistants.getVectorStoreFileBatch", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.getVectorStoreFileBatchWithResponse": "Azure.AI.OpenAI.Assistants.getVectorStoreFileBatch", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.getVectorStoreFileWithResponse": "Azure.AI.OpenAI.Assistants.getVectorStoreFile", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.getVectorStoreWithResponse": "Azure.AI.OpenAI.Assistants.getVectorStore", "com.azure.ai.openai.assistants.AssistantsAsyncClient.listAssistants": "Azure.AI.OpenAI.Assistants.listAssistants", "com.azure.ai.openai.assistants.AssistantsAsyncClient.listAssistantsWithResponse": "Azure.AI.OpenAI.Assistants.listAssistants", "com.azure.ai.openai.assistants.AssistantsAsyncClient.listFiles": "Azure.AI.OpenAI.Assistants.listFiles", "com.azure.ai.openai.assistants.AssistantsAsyncClient.listFilesWithResponse": "Azure.AI.OpenAI.Assistants.listFiles", - "com.azure.ai.openai.assistants.AssistantsAsyncClient.listMessageFiles": "Azure.AI.OpenAI.Assistants.listMessageFiles", - "com.azure.ai.openai.assistants.AssistantsAsyncClient.listMessageFilesWithResponse": "Azure.AI.OpenAI.Assistants.listMessageFiles", "com.azure.ai.openai.assistants.AssistantsAsyncClient.listMessages": "Azure.AI.OpenAI.Assistants.listMessages", "com.azure.ai.openai.assistants.AssistantsAsyncClient.listMessagesWithResponse": "Azure.AI.OpenAI.Assistants.listMessages", "com.azure.ai.openai.assistants.AssistantsAsyncClient.listRunSteps": "Azure.AI.OpenAI.Assistants.listRunSteps", "com.azure.ai.openai.assistants.AssistantsAsyncClient.listRunStepsWithResponse": "Azure.AI.OpenAI.Assistants.listRunSteps", "com.azure.ai.openai.assistants.AssistantsAsyncClient.listRuns": "Azure.AI.OpenAI.Assistants.listRuns", "com.azure.ai.openai.assistants.AssistantsAsyncClient.listRunsWithResponse": "Azure.AI.OpenAI.Assistants.listRuns", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.listVectorStoreFileBatchFiles": "Azure.AI.OpenAI.Assistants.listVectorStoreFileBatchFiles", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.listVectorStoreFileBatchFilesWithResponse": "Azure.AI.OpenAI.Assistants.listVectorStoreFileBatchFiles", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.listVectorStoreFiles": "Azure.AI.OpenAI.Assistants.listVectorStoreFiles", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.listVectorStoreFilesWithResponse": "Azure.AI.OpenAI.Assistants.listVectorStoreFiles", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.listVectorStores": "Azure.AI.OpenAI.Assistants.listVectorStores", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.listVectorStoresWithResponse": "Azure.AI.OpenAI.Assistants.listVectorStores", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.modifyVectorStore": "Azure.AI.OpenAI.Assistants.modifyVectorStore", + "com.azure.ai.openai.assistants.AssistantsAsyncClient.modifyVectorStoreWithResponse": "Azure.AI.OpenAI.Assistants.modifyVectorStore", "com.azure.ai.openai.assistants.AssistantsAsyncClient.submitToolOutputsToRun": "Azure.AI.OpenAI.Assistants.submitToolOutputsToRun", "com.azure.ai.openai.assistants.AssistantsAsyncClient.submitToolOutputsToRunWithResponse": "Azure.AI.OpenAI.Assistants.submitToolOutputsToRun", "com.azure.ai.openai.assistants.AssistantsAsyncClient.updateAssistant": "Azure.AI.OpenAI.Assistants.updateAssistant", @@ -71,9 +85,9 @@ "com.azure.ai.openai.assistants.AssistantsClient": "Azure.AI.OpenAI.Assistants.AssistantsClient", "com.azure.ai.openai.assistants.AssistantsClient.cancelRun": "Azure.AI.OpenAI.Assistants.cancelRun", "com.azure.ai.openai.assistants.AssistantsClient.cancelRunWithResponse": "Azure.AI.OpenAI.Assistants.cancelRun", + "com.azure.ai.openai.assistants.AssistantsClient.cancelVectorStoreFileBatch": "Azure.AI.OpenAI.Assistants.cancelVectorStoreFileBatch", + "com.azure.ai.openai.assistants.AssistantsClient.cancelVectorStoreFileBatchWithResponse": "Azure.AI.OpenAI.Assistants.cancelVectorStoreFileBatch", "com.azure.ai.openai.assistants.AssistantsClient.createAssistant": "Azure.AI.OpenAI.Assistants.createAssistant", - "com.azure.ai.openai.assistants.AssistantsClient.createAssistantFile": "Azure.AI.OpenAI.Assistants.createAssistantFile", - "com.azure.ai.openai.assistants.AssistantsClient.createAssistantFileWithResponse": "Azure.AI.OpenAI.Assistants.createAssistantFile", "com.azure.ai.openai.assistants.AssistantsClient.createAssistantWithResponse": "Azure.AI.OpenAI.Assistants.createAssistant", "com.azure.ai.openai.assistants.AssistantsClient.createMessage": "Azure.AI.OpenAI.Assistants.createMessage", "com.azure.ai.openai.assistants.AssistantsClient.createMessageWithResponse": "Azure.AI.OpenAI.Assistants.createMessage", @@ -83,25 +97,29 @@ "com.azure.ai.openai.assistants.AssistantsClient.createThreadAndRun": "Azure.AI.OpenAI.Assistants.createThreadAndRun", "com.azure.ai.openai.assistants.AssistantsClient.createThreadAndRunWithResponse": "Azure.AI.OpenAI.Assistants.createThreadAndRun", "com.azure.ai.openai.assistants.AssistantsClient.createThreadWithResponse": "Azure.AI.OpenAI.Assistants.createThread", + "com.azure.ai.openai.assistants.AssistantsClient.createVectorStore": "Azure.AI.OpenAI.Assistants.createVectorStore", + "com.azure.ai.openai.assistants.AssistantsClient.createVectorStoreFile": "Azure.AI.OpenAI.Assistants.createVectorStoreFile", + "com.azure.ai.openai.assistants.AssistantsClient.createVectorStoreFileBatch": "Azure.AI.OpenAI.Assistants.createVectorStoreFileBatch", + "com.azure.ai.openai.assistants.AssistantsClient.createVectorStoreFileBatchWithResponse": "Azure.AI.OpenAI.Assistants.createVectorStoreFileBatch", + "com.azure.ai.openai.assistants.AssistantsClient.createVectorStoreFileWithResponse": "Azure.AI.OpenAI.Assistants.createVectorStoreFile", + "com.azure.ai.openai.assistants.AssistantsClient.createVectorStoreWithResponse": "Azure.AI.OpenAI.Assistants.createVectorStore", "com.azure.ai.openai.assistants.AssistantsClient.deleteAssistant": "Azure.AI.OpenAI.Assistants.deleteAssistant", - "com.azure.ai.openai.assistants.AssistantsClient.deleteAssistantFile": "Azure.AI.OpenAI.Assistants.deleteAssistantFile", - "com.azure.ai.openai.assistants.AssistantsClient.deleteAssistantFileWithResponse": "Azure.AI.OpenAI.Assistants.deleteAssistantFile", "com.azure.ai.openai.assistants.AssistantsClient.deleteAssistantWithResponse": "Azure.AI.OpenAI.Assistants.deleteAssistant", "com.azure.ai.openai.assistants.AssistantsClient.deleteFile": "Azure.AI.OpenAI.Assistants.deleteFile", "com.azure.ai.openai.assistants.AssistantsClient.deleteFileWithResponse": "Azure.AI.OpenAI.Assistants.deleteFile", "com.azure.ai.openai.assistants.AssistantsClient.deleteThread": "Azure.AI.OpenAI.Assistants.deleteThread", "com.azure.ai.openai.assistants.AssistantsClient.deleteThreadWithResponse": "Azure.AI.OpenAI.Assistants.deleteThread", + "com.azure.ai.openai.assistants.AssistantsClient.deleteVectorStore": "Azure.AI.OpenAI.Assistants.deleteVectorStore", + "com.azure.ai.openai.assistants.AssistantsClient.deleteVectorStoreFile": "Azure.AI.OpenAI.Assistants.deleteVectorStoreFile", + "com.azure.ai.openai.assistants.AssistantsClient.deleteVectorStoreFileWithResponse": "Azure.AI.OpenAI.Assistants.deleteVectorStoreFile", + "com.azure.ai.openai.assistants.AssistantsClient.deleteVectorStoreWithResponse": "Azure.AI.OpenAI.Assistants.deleteVectorStore", "com.azure.ai.openai.assistants.AssistantsClient.getAssistant": "Azure.AI.OpenAI.Assistants.getAssistant", - "com.azure.ai.openai.assistants.AssistantsClient.getAssistantFile": "Azure.AI.OpenAI.Assistants.getAssistantFile", - "com.azure.ai.openai.assistants.AssistantsClient.getAssistantFileWithResponse": "Azure.AI.OpenAI.Assistants.getAssistantFile", "com.azure.ai.openai.assistants.AssistantsClient.getAssistantWithResponse": "Azure.AI.OpenAI.Assistants.getAssistant", "com.azure.ai.openai.assistants.AssistantsClient.getFile": "Azure.AI.OpenAI.Assistants.getFile", "com.azure.ai.openai.assistants.AssistantsClient.getFileContent": "Azure.AI.OpenAI.Assistants.getFileContent", "com.azure.ai.openai.assistants.AssistantsClient.getFileContentWithResponse": "Azure.AI.OpenAI.Assistants.getFileContent", "com.azure.ai.openai.assistants.AssistantsClient.getFileWithResponse": "Azure.AI.OpenAI.Assistants.getFile", "com.azure.ai.openai.assistants.AssistantsClient.getMessage": "Azure.AI.OpenAI.Assistants.getMessage", - "com.azure.ai.openai.assistants.AssistantsClient.getMessageFile": "Azure.AI.OpenAI.Assistants.getMessageFile", - "com.azure.ai.openai.assistants.AssistantsClient.getMessageFileWithResponse": "Azure.AI.OpenAI.Assistants.getMessageFile", "com.azure.ai.openai.assistants.AssistantsClient.getMessageWithResponse": "Azure.AI.OpenAI.Assistants.getMessage", "com.azure.ai.openai.assistants.AssistantsClient.getRun": "Azure.AI.OpenAI.Assistants.getRun", "com.azure.ai.openai.assistants.AssistantsClient.getRunStep": "Azure.AI.OpenAI.Assistants.getRunStep", @@ -109,20 +127,30 @@ "com.azure.ai.openai.assistants.AssistantsClient.getRunWithResponse": "Azure.AI.OpenAI.Assistants.getRun", "com.azure.ai.openai.assistants.AssistantsClient.getThread": "Azure.AI.OpenAI.Assistants.getThread", "com.azure.ai.openai.assistants.AssistantsClient.getThreadWithResponse": "Azure.AI.OpenAI.Assistants.getThread", - "com.azure.ai.openai.assistants.AssistantsClient.listAssistantFiles": "Azure.AI.OpenAI.Assistants.listAssistantFiles", - "com.azure.ai.openai.assistants.AssistantsClient.listAssistantFilesWithResponse": "Azure.AI.OpenAI.Assistants.listAssistantFiles", + "com.azure.ai.openai.assistants.AssistantsClient.getVectorStore": "Azure.AI.OpenAI.Assistants.getVectorStore", + "com.azure.ai.openai.assistants.AssistantsClient.getVectorStoreFile": "Azure.AI.OpenAI.Assistants.getVectorStoreFile", + "com.azure.ai.openai.assistants.AssistantsClient.getVectorStoreFileBatch": "Azure.AI.OpenAI.Assistants.getVectorStoreFileBatch", + "com.azure.ai.openai.assistants.AssistantsClient.getVectorStoreFileBatchWithResponse": "Azure.AI.OpenAI.Assistants.getVectorStoreFileBatch", + "com.azure.ai.openai.assistants.AssistantsClient.getVectorStoreFileWithResponse": "Azure.AI.OpenAI.Assistants.getVectorStoreFile", + "com.azure.ai.openai.assistants.AssistantsClient.getVectorStoreWithResponse": "Azure.AI.OpenAI.Assistants.getVectorStore", "com.azure.ai.openai.assistants.AssistantsClient.listAssistants": "Azure.AI.OpenAI.Assistants.listAssistants", "com.azure.ai.openai.assistants.AssistantsClient.listAssistantsWithResponse": "Azure.AI.OpenAI.Assistants.listAssistants", "com.azure.ai.openai.assistants.AssistantsClient.listFiles": "Azure.AI.OpenAI.Assistants.listFiles", "com.azure.ai.openai.assistants.AssistantsClient.listFilesWithResponse": "Azure.AI.OpenAI.Assistants.listFiles", - "com.azure.ai.openai.assistants.AssistantsClient.listMessageFiles": "Azure.AI.OpenAI.Assistants.listMessageFiles", - "com.azure.ai.openai.assistants.AssistantsClient.listMessageFilesWithResponse": "Azure.AI.OpenAI.Assistants.listMessageFiles", "com.azure.ai.openai.assistants.AssistantsClient.listMessages": "Azure.AI.OpenAI.Assistants.listMessages", "com.azure.ai.openai.assistants.AssistantsClient.listMessagesWithResponse": "Azure.AI.OpenAI.Assistants.listMessages", "com.azure.ai.openai.assistants.AssistantsClient.listRunSteps": "Azure.AI.OpenAI.Assistants.listRunSteps", "com.azure.ai.openai.assistants.AssistantsClient.listRunStepsWithResponse": "Azure.AI.OpenAI.Assistants.listRunSteps", "com.azure.ai.openai.assistants.AssistantsClient.listRuns": "Azure.AI.OpenAI.Assistants.listRuns", "com.azure.ai.openai.assistants.AssistantsClient.listRunsWithResponse": "Azure.AI.OpenAI.Assistants.listRuns", + "com.azure.ai.openai.assistants.AssistantsClient.listVectorStoreFileBatchFiles": "Azure.AI.OpenAI.Assistants.listVectorStoreFileBatchFiles", + "com.azure.ai.openai.assistants.AssistantsClient.listVectorStoreFileBatchFilesWithResponse": "Azure.AI.OpenAI.Assistants.listVectorStoreFileBatchFiles", + "com.azure.ai.openai.assistants.AssistantsClient.listVectorStoreFiles": "Azure.AI.OpenAI.Assistants.listVectorStoreFiles", + "com.azure.ai.openai.assistants.AssistantsClient.listVectorStoreFilesWithResponse": "Azure.AI.OpenAI.Assistants.listVectorStoreFiles", + "com.azure.ai.openai.assistants.AssistantsClient.listVectorStores": "Azure.AI.OpenAI.Assistants.listVectorStores", + "com.azure.ai.openai.assistants.AssistantsClient.listVectorStoresWithResponse": "Azure.AI.OpenAI.Assistants.listVectorStores", + "com.azure.ai.openai.assistants.AssistantsClient.modifyVectorStore": "Azure.AI.OpenAI.Assistants.modifyVectorStore", + "com.azure.ai.openai.assistants.AssistantsClient.modifyVectorStoreWithResponse": "Azure.AI.OpenAI.Assistants.modifyVectorStore", "com.azure.ai.openai.assistants.AssistantsClient.submitToolOutputsToRun": "Azure.AI.OpenAI.Assistants.submitToolOutputsToRun", "com.azure.ai.openai.assistants.AssistantsClient.submitToolOutputsToRunWithResponse": "Azure.AI.OpenAI.Assistants.submitToolOutputsToRun", "com.azure.ai.openai.assistants.AssistantsClient.updateAssistant": "Azure.AI.OpenAI.Assistants.updateAssistant", @@ -136,40 +164,52 @@ "com.azure.ai.openai.assistants.AssistantsClient.uploadFile": "Azure.AI.OpenAI.Assistants.uploadFile", "com.azure.ai.openai.assistants.AssistantsClient.uploadFileWithResponse": "Azure.AI.OpenAI.Assistants.uploadFile", "com.azure.ai.openai.assistants.AssistantsClientBuilder": "Azure.AI.OpenAI.Assistants.AssistantsClient", - "com.azure.ai.openai.assistants.implementation.models.CreateAssistantFileRequest": "", - "com.azure.ai.openai.assistants.implementation.models.CreateMessageRequest": "", + "com.azure.ai.openai.assistants.implementation.models.CreateVectorStoreFileBatchRequest": "", + "com.azure.ai.openai.assistants.implementation.models.CreateVectorStoreFileRequest": "", "com.azure.ai.openai.assistants.implementation.models.FileListResponse": "Azure.AI.OpenAI.Assistants.FileListResponse", "com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfAssistant": "Azure.AI.OpenAI.Assistants.OpenAIPageableListOf", - "com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfAssistantFile": "Azure.AI.OpenAI.Assistants.OpenAIPageableListOf", - "com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfMessageFile": "Azure.AI.OpenAI.Assistants.OpenAIPageableListOf", "com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfRunStep": "Azure.AI.OpenAI.Assistants.OpenAIPageableListOf", "com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfThreadMessage": "Azure.AI.OpenAI.Assistants.OpenAIPageableListOf", "com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfThreadRun": "Azure.AI.OpenAI.Assistants.OpenAIPageableListOf", + "com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfVectorStore": "Azure.AI.OpenAI.Assistants.OpenAIPageableListOf", + "com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfVectorStoreFile": "Azure.AI.OpenAI.Assistants.OpenAIPageableListOf", "com.azure.ai.openai.assistants.implementation.models.SubmitToolOutputsToRunRequest": "", "com.azure.ai.openai.assistants.implementation.models.UpdateMessageRequest": "", "com.azure.ai.openai.assistants.implementation.models.UpdateRunRequest": "", - "com.azure.ai.openai.assistants.implementation.models.UpdateThreadRequest": "", "com.azure.ai.openai.assistants.implementation.models.UploadFileRequest": "", + "com.azure.ai.openai.assistants.models.ApiResponseFormat": "Azure.AI.OpenAI.Assistants.ApiResponseFormat", "com.azure.ai.openai.assistants.models.Assistant": "Azure.AI.OpenAI.Assistants.Assistant", "com.azure.ai.openai.assistants.models.AssistantCreationOptions": "Azure.AI.OpenAI.Assistants.AssistantCreationOptions", "com.azure.ai.openai.assistants.models.AssistantDeletionStatus": "Azure.AI.OpenAI.Assistants.AssistantDeletionStatus", - "com.azure.ai.openai.assistants.models.AssistantFile": "Azure.AI.OpenAI.Assistants.AssistantFile", - "com.azure.ai.openai.assistants.models.AssistantFileDeletionStatus": "Azure.AI.OpenAI.Assistants.AssistantFileDeletionStatus", "com.azure.ai.openai.assistants.models.AssistantStreamEvent": "Azure.AI.OpenAI.Assistants.AssistantStreamEvent", "com.azure.ai.openai.assistants.models.AssistantThread": "Azure.AI.OpenAI.Assistants.AssistantThread", "com.azure.ai.openai.assistants.models.AssistantThreadCreationOptions": "Azure.AI.OpenAI.Assistants.AssistantThreadCreationOptions", + "com.azure.ai.openai.assistants.models.AssistantsApiResponseFormat": "Azure.AI.OpenAI.Assistants.AssistantsApiResponseFormat", + "com.azure.ai.openai.assistants.models.AssistantsApiResponseFormatMode": "Azure.AI.OpenAI.Assistants.AssistantsApiResponseFormatMode", + "com.azure.ai.openai.assistants.models.AssistantsApiToolChoiceOptionMode": "Azure.AI.OpenAI.Assistants.AssistantsApiToolChoiceOptionMode", + "com.azure.ai.openai.assistants.models.AssistantsNamedToolChoice": "Azure.AI.OpenAI.Assistants.AssistantsNamedToolChoice", + "com.azure.ai.openai.assistants.models.AssistantsNamedToolChoiceType": "Azure.AI.OpenAI.Assistants.AssistantsNamedToolChoiceType", "com.azure.ai.openai.assistants.models.CodeInterpreterToolDefinition": "Azure.AI.OpenAI.Assistants.CodeInterpreterToolDefinition", + "com.azure.ai.openai.assistants.models.CodeInterpreterToolResource": "Azure.AI.OpenAI.Assistants.CodeInterpreterToolResource", "com.azure.ai.openai.assistants.models.CreateAndRunThreadOptions": "Azure.AI.OpenAI.Assistants.CreateAndRunThreadOptions", + "com.azure.ai.openai.assistants.models.CreateCodeInterpreterToolResourceOptions": "Azure.AI.OpenAI.Assistants.CreateCodeInterpreterToolResourceOptions", + "com.azure.ai.openai.assistants.models.CreateFileSearchToolResourceVectorStoreOptions": "Azure.AI.OpenAI.Assistants.CreateFileSearchToolResourceVectorStoreOptions", "com.azure.ai.openai.assistants.models.CreateRunOptions": "Azure.AI.OpenAI.Assistants.CreateRunOptions", + "com.azure.ai.openai.assistants.models.CreateToolResourcesOptions": "Azure.AI.OpenAI.Assistants.CreateToolResourcesOptions", "com.azure.ai.openai.assistants.models.DoneEvent": "Azure.AI.OpenAI.Assistants.DoneEvent", "com.azure.ai.openai.assistants.models.ErrorEvent": "Azure.AI.OpenAI.Assistants.ErrorEvent", "com.azure.ai.openai.assistants.models.FileDeletionStatus": "Azure.AI.OpenAI.Assistants.FileDeletionStatus", "com.azure.ai.openai.assistants.models.FileDetails": "null", "com.azure.ai.openai.assistants.models.FilePurpose": "Azure.AI.OpenAI.Assistants.FilePurpose", + "com.azure.ai.openai.assistants.models.FileSearchToolDefinition": "Azure.AI.OpenAI.Assistants.FileSearchToolDefinition", + "com.azure.ai.openai.assistants.models.FileSearchToolResource": "Azure.AI.OpenAI.Assistants.FileSearchToolResource", + "com.azure.ai.openai.assistants.models.FileState": "Azure.AI.OpenAI.Assistants.FileState", "com.azure.ai.openai.assistants.models.FunctionDefinition": "Azure.AI.OpenAI.Assistants.FunctionDefinition", + "com.azure.ai.openai.assistants.models.FunctionName": "Azure.AI.OpenAI.Assistants.FunctionName", "com.azure.ai.openai.assistants.models.FunctionToolDefinition": "Azure.AI.OpenAI.Assistants.FunctionToolDefinition", "com.azure.ai.openai.assistants.models.IncompleteRunDetails": "Azure.AI.OpenAI.Assistants.IncompleteRunDetails", "com.azure.ai.openai.assistants.models.ListSortOrder": "Azure.AI.OpenAI.Assistants.ListSortOrder", + "com.azure.ai.openai.assistants.models.MessageAttachment": "Azure.AI.OpenAI.Assistants.MessageAttachment", "com.azure.ai.openai.assistants.models.MessageContent": "Azure.AI.OpenAI.Assistants.MessageContent", "com.azure.ai.openai.assistants.models.MessageDelta": "Azure.AI.OpenAI.Assistants.MessageDelta", "com.azure.ai.openai.assistants.models.MessageDeltaChunk": "Azure.AI.OpenAI.Assistants.MessageDeltaChunk", @@ -183,9 +223,9 @@ "com.azure.ai.openai.assistants.models.MessageDeltaTextFileCitationAnnotationObject": "Azure.AI.OpenAI.Assistants.MessageDeltaTextFileCitationAnnotationObject", "com.azure.ai.openai.assistants.models.MessageDeltaTextFilePathAnnotation": "Azure.AI.OpenAI.Assistants.MessageDeltaTextFilePathAnnotation", "com.azure.ai.openai.assistants.models.MessageDeltaTextFilePathAnnotationObject": "Azure.AI.OpenAI.Assistants.MessageDeltaTextFilePathAnnotationObject", - "com.azure.ai.openai.assistants.models.MessageFile": "Azure.AI.OpenAI.Assistants.MessageFile", "com.azure.ai.openai.assistants.models.MessageImageFileContent": "Azure.AI.OpenAI.Assistants.MessageImageFileContent", "com.azure.ai.openai.assistants.models.MessageImageFileDetails": "Azure.AI.OpenAI.Assistants.MessageImageFileDetails", + "com.azure.ai.openai.assistants.models.MessageIncompleteDetails": "Azure.AI.OpenAI.Assistants.MessageIncompleteDetails", "com.azure.ai.openai.assistants.models.MessageIncompleteDetailsReason": "Azure.AI.OpenAI.Assistants.MessageIncompleteDetailsReason", "com.azure.ai.openai.assistants.models.MessageRole": "Azure.AI.OpenAI.Assistants.MessageRole", "com.azure.ai.openai.assistants.models.MessageStatus": "Azure.AI.OpenAI.Assistants.MessageStatus", @@ -202,7 +242,6 @@ "com.azure.ai.openai.assistants.models.RequiredFunctionToolCall": "Azure.AI.OpenAI.Assistants.RequiredFunctionToolCall", "com.azure.ai.openai.assistants.models.RequiredFunctionToolCallDetails": "Azure.AI.OpenAI.Assistants.RequiredFunctionToolCallDetails", "com.azure.ai.openai.assistants.models.RequiredToolCall": "Azure.AI.OpenAI.Assistants.RequiredToolCall", - "com.azure.ai.openai.assistants.models.RetrievalToolDefinition": "Azure.AI.OpenAI.Assistants.RetrievalToolDefinition", "com.azure.ai.openai.assistants.models.RunCompletionUsage": "Azure.AI.OpenAI.Assistants.RunCompletionUsage", "com.azure.ai.openai.assistants.models.RunError": "Azure.AI.OpenAI.Assistants.RunError", "com.azure.ai.openai.assistants.models.RunStatus": "Azure.AI.OpenAI.Assistants.RunStatus", @@ -223,21 +262,21 @@ "com.azure.ai.openai.assistants.models.RunStepDeltaCodeInterpreterOutput": "Azure.AI.OpenAI.Assistants.RunStepDeltaCodeInterpreterOutput", "com.azure.ai.openai.assistants.models.RunStepDeltaCodeInterpreterToolCall": "Azure.AI.OpenAI.Assistants.RunStepDeltaCodeInterpreterToolCall", "com.azure.ai.openai.assistants.models.RunStepDeltaDetail": "Azure.AI.OpenAI.Assistants.RunStepDeltaDetail", + "com.azure.ai.openai.assistants.models.RunStepDeltaFileSearchToolCall": "Azure.AI.OpenAI.Assistants.RunStepDeltaFileSearchToolCall", "com.azure.ai.openai.assistants.models.RunStepDeltaFunction": "Azure.AI.OpenAI.Assistants.RunStepDeltaFunction", "com.azure.ai.openai.assistants.models.RunStepDeltaFunctionToolCall": "Azure.AI.OpenAI.Assistants.RunStepDeltaFunctionToolCall", "com.azure.ai.openai.assistants.models.RunStepDeltaMessageCreation": "Azure.AI.OpenAI.Assistants.RunStepDeltaMessageCreation", "com.azure.ai.openai.assistants.models.RunStepDeltaMessageCreationObject": "Azure.AI.OpenAI.Assistants.RunStepDeltaMessageCreationObject", - "com.azure.ai.openai.assistants.models.RunStepDeltaRetrievalToolCall": "Azure.AI.OpenAI.Assistants.RunStepDeltaRetrievalToolCall", "com.azure.ai.openai.assistants.models.RunStepDeltaToolCall": "Azure.AI.OpenAI.Assistants.RunStepDeltaToolCall", "com.azure.ai.openai.assistants.models.RunStepDeltaToolCallObject": "Azure.AI.OpenAI.Assistants.RunStepDeltaToolCallObject", "com.azure.ai.openai.assistants.models.RunStepDetails": "Azure.AI.OpenAI.Assistants.RunStepDetails", "com.azure.ai.openai.assistants.models.RunStepError": "Azure.AI.OpenAI.Assistants.RunStepError", "com.azure.ai.openai.assistants.models.RunStepErrorCode": "Azure.AI.OpenAI.Assistants.RunStepErrorCode", + "com.azure.ai.openai.assistants.models.RunStepFileSearchToolCall": "Azure.AI.OpenAI.Assistants.RunStepFileSearchToolCall", "com.azure.ai.openai.assistants.models.RunStepFunctionToolCall": "Azure.AI.OpenAI.Assistants.RunStepFunctionToolCall", "com.azure.ai.openai.assistants.models.RunStepFunctionToolCallDetails": "Azure.AI.OpenAI.Assistants.RunStepFunctionToolCallDetails", "com.azure.ai.openai.assistants.models.RunStepMessageCreationDetails": "Azure.AI.OpenAI.Assistants.RunStepMessageCreationDetails", "com.azure.ai.openai.assistants.models.RunStepMessageCreationReference": "Azure.AI.OpenAI.Assistants.RunStepMessageCreationReference", - "com.azure.ai.openai.assistants.models.RunStepRetrievalToolCall": "Azure.AI.OpenAI.Assistants.RunStepRetrievalToolCall", "com.azure.ai.openai.assistants.models.RunStepStatus": "Azure.AI.OpenAI.Assistants.RunStepStatus", "com.azure.ai.openai.assistants.models.RunStepStreamEvent": "Azure.AI.OpenAI.Assistants.RunStepStreamEvent", "com.azure.ai.openai.assistants.models.RunStepToolCall": "Azure.AI.OpenAI.Assistants.RunStepToolCall", @@ -247,12 +286,35 @@ "com.azure.ai.openai.assistants.models.SubmitToolOutputsAction": "Azure.AI.OpenAI.Assistants.SubmitToolOutputsAction", "com.azure.ai.openai.assistants.models.SubmitToolOutputsDetails": "Azure.AI.OpenAI.Assistants.SubmitToolOutputsDetails", "com.azure.ai.openai.assistants.models.ThreadDeletionStatus": "Azure.AI.OpenAI.Assistants.ThreadDeletionStatus", - "com.azure.ai.openai.assistants.models.ThreadInitializationMessage": "Azure.AI.OpenAI.Assistants.ThreadInitializationMessage", "com.azure.ai.openai.assistants.models.ThreadMessage": "Azure.AI.OpenAI.Assistants.ThreadMessage", + "com.azure.ai.openai.assistants.models.ThreadMessageOptions": "Azure.AI.OpenAI.Assistants.ThreadMessageOptions", "com.azure.ai.openai.assistants.models.ThreadRun": "Azure.AI.OpenAI.Assistants.ThreadRun", "com.azure.ai.openai.assistants.models.ThreadStreamEvent": "Azure.AI.OpenAI.Assistants.ThreadStreamEvent", "com.azure.ai.openai.assistants.models.ToolDefinition": "Azure.AI.OpenAI.Assistants.ToolDefinition", "com.azure.ai.openai.assistants.models.ToolOutput": "Azure.AI.OpenAI.Assistants.ToolOutput", - "com.azure.ai.openai.assistants.models.UpdateAssistantOptions": "Azure.AI.OpenAI.Assistants.UpdateAssistantOptions" + "com.azure.ai.openai.assistants.models.ToolResources": "Azure.AI.OpenAI.Assistants.ToolResources", + "com.azure.ai.openai.assistants.models.TruncationObject": "Azure.AI.OpenAI.Assistants.TruncationObject", + "com.azure.ai.openai.assistants.models.TruncationStrategy": "Azure.AI.OpenAI.Assistants.TruncationStrategy", + "com.azure.ai.openai.assistants.models.UpdateAssistantOptions": "Azure.AI.OpenAI.Assistants.UpdateAssistantOptions", + "com.azure.ai.openai.assistants.models.UpdateAssistantThreadOptions": "Azure.AI.OpenAI.Assistants.UpdateAssistantThreadOptions", + "com.azure.ai.openai.assistants.models.UpdateCodeInterpreterToolResourceOptions": "Azure.AI.OpenAI.Assistants.UpdateCodeInterpreterToolResourceOptions", + "com.azure.ai.openai.assistants.models.UpdateFileSearchToolResourceOptions": "Azure.AI.OpenAI.Assistants.UpdateFileSearchToolResourceOptions", + "com.azure.ai.openai.assistants.models.UpdateToolResourcesOptions": "Azure.AI.OpenAI.Assistants.UpdateToolResourcesOptions", + "com.azure.ai.openai.assistants.models.VectorStore": "Azure.AI.OpenAI.Assistants.VectorStore", + "com.azure.ai.openai.assistants.models.VectorStoreDeletionStatus": "Azure.AI.OpenAI.Assistants.VectorStoreDeletionStatus", + "com.azure.ai.openai.assistants.models.VectorStoreExpirationPolicy": "Azure.AI.OpenAI.Assistants.VectorStoreExpirationPolicy", + "com.azure.ai.openai.assistants.models.VectorStoreExpirationPolicyAnchor": "Azure.AI.OpenAI.Assistants.VectorStoreExpirationPolicyAnchor", + "com.azure.ai.openai.assistants.models.VectorStoreFile": "Azure.AI.OpenAI.Assistants.VectorStoreFile", + "com.azure.ai.openai.assistants.models.VectorStoreFileBatch": "Azure.AI.OpenAI.Assistants.VectorStoreFileBatch", + "com.azure.ai.openai.assistants.models.VectorStoreFileBatchStatus": "Azure.AI.OpenAI.Assistants.VectorStoreFileBatchStatus", + "com.azure.ai.openai.assistants.models.VectorStoreFileCount": "Azure.AI.OpenAI.Assistants.VectorStoreFileCount", + "com.azure.ai.openai.assistants.models.VectorStoreFileDeletionStatus": "Azure.AI.OpenAI.Assistants.VectorStoreFileDeletionStatus", + "com.azure.ai.openai.assistants.models.VectorStoreFileError": "Azure.AI.OpenAI.Assistants.VectorStoreFileError", + "com.azure.ai.openai.assistants.models.VectorStoreFileErrorCode": "Azure.AI.OpenAI.Assistants.VectorStoreFileErrorCode", + "com.azure.ai.openai.assistants.models.VectorStoreFileStatus": "Azure.AI.OpenAI.Assistants.VectorStoreFileStatus", + "com.azure.ai.openai.assistants.models.VectorStoreFileStatusFilter": "Azure.AI.OpenAI.Assistants.VectorStoreFileStatusFilter", + "com.azure.ai.openai.assistants.models.VectorStoreOptions": "Azure.AI.OpenAI.Assistants.VectorStoreOptions", + "com.azure.ai.openai.assistants.models.VectorStoreStatus": "Azure.AI.OpenAI.Assistants.VectorStoreStatus", + "com.azure.ai.openai.assistants.models.VectorStoreUpdateOptions": "Azure.AI.OpenAI.Assistants.VectorStoreUpdateOptions" } } diff --git a/sdk/openai/azure-ai-openai-assistants/tsp-location.yaml b/sdk/openai/azure-ai-openai-assistants/tsp-location.yaml index 0f4513cfe2dbd..ea74e2191b185 100644 --- a/sdk/openai/azure-ai-openai-assistants/tsp-location.yaml +++ b/sdk/openai/azure-ai-openai-assistants/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/ai/OpenAI.Assistants -commit: 1bf1fa21be306bd0dd356d7012271650cfd0951e +commit: a55a664ff3273c4998e0ec99517f4bb23cd00497 repo: Azure/azure-rest-api-specs +additionalDirectories: