after | String | No | 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
+ @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
+ * Name | Type | Required | Description |
+ * limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the default is 20. |
+ * order | String | No | Sort order by the created_at timestamp of the objects. asc for
+ * ascending order and desc for descending order. Allowed values: "asc", "desc". |
+ * after | String | No | 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. |
* before | String | No | 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
@@ -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
+ * Name | Type | Required | Description |
+ * limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the default is 20. |
+ * order | String | No | Sort order by the created_at timestamp of the objects. asc for
+ * ascending order and desc for descending order. Allowed values: "asc", "desc". |
+ * after | String | No | 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. |
+ * before | String | No | 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. |
+ *
+ * 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
- * Name | Type | Required | Description |
- * limit | Integer | No | A limit on the number of objects to be returned. Limit can range
- * between 1 and 100, and the default is 20. |
- * order | String | No | Sort order by the created_at timestamp of the objects. asc for
- * ascending order and desc for descending order. Allowed values: "asc", "desc". |
- * after | String | No | 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. |
- * before | String | No | 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. |
- *
- * 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
* Name | Type | Required | Description |
+ * runId | String | No | Filter messages by the run ID that generated them. |
* limit | Integer | No | A limit on the number of objects to be returned. Limit can range
* between 1 and 100, and the default is 20. |
* order | String | No | Sort 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
* Name | Type | Required | Description |
+ * runId | String | No | Filter messages by the run ID that generated them. |
* limit | Integer | No | A limit on the number of objects to be returned. Limit can range
* between 1 and 100, and the default is 20. |
* order | String | No | Sort 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
+ * Name | Type | Required | Description |
+ * limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the default is 20. |
+ * order | String | No | Sort order by the created_at timestamp of the objects. asc for
+ * ascending order and desc for descending order. Allowed values: "asc", "desc". |
+ * after | String | No | 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. |
+ * before | String | No | 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. |
+ *
+ * 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
+ * Name | Type | Required | Description |
+ * limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the default is 20. |
+ * order | String | No | Sort order by the created_at timestamp of the objects. asc for
+ * ascending order and desc for descending order. Allowed values: "asc", "desc". |
+ * after | String | No | 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. |
+ * before | String | No | 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. |
+ *
+ * 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
- * Name | Type | Required | Description |
- * limit | Integer | No | A limit on the number of objects to be returned. Limit can range
- * between 1 and 100, and the default is 20. |
- * order | String | No | Sort order by the created_at timestamp of the objects. asc for
- * ascending order and desc for descending order. Allowed values: "asc", "desc". |
- * after | String | No | 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. |
- * before | String | No | 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. |
- *
- * 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
- * Name | Type | Required | Description |
- * limit | Integer | No | A limit on the number of objects to be returned. Limit can range
- * between 1 and 100, and the default is 20. |
- * order | String | No | Sort order by the created_at timestamp of the objects. asc for
- * ascending order and desc for descending order. Allowed values: "asc", "desc". |
- * after | String | No | 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. |
- * before | String | No | 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. |
- *
- * 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
*
* 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
+ * Name | Type | Required | Description |
+ * purpose | String | No | A 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
+ * Name | Type | Required | Description |
+ * purpose | String | No | A 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
- * Name | Type | Required | Description |
- * limit | Integer | No | A limit on the number of objects to be returned. Limit can range
- * between 1 and 100, and the default is 20. |
- * order | String | No | Sort order by the created_at timestamp of the objects. asc for
- * ascending order and desc for descending order. Allowed values: "asc", "desc". |
- * after | String | No | 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. |
- * before | String | No | 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. |
- *
- * 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
- * Name | Type | Required | Description |
- * limit | Integer | No | A limit on the number of objects to be returned. Limit can range
- * between 1 and 100, and the default is 20. |
- * order | String | No | Sort order by the created_at timestamp of the objects. asc for
- * ascending order and desc for descending order. Allowed values: "asc", "desc". |
- * after | String | No | 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. |
- * before | String | No | 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. |
- *
- * 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
+ * Name | Type | Required | Description |
+ * limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the default is 20. |
+ * order | String | No | Sort order by the created_at timestamp of the objects. asc for
+ * ascending order and desc for descending order. Allowed values: "asc", "desc". |
+ * after | String | No | 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. |
+ * before | String | No | 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. |
+ *
+ * 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
+ * Name | Type | Required | Description |
+ * limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the default is 20. |
+ * order | String | No | Sort order by the created_at timestamp of the objects. asc for
+ * ascending order and desc for descending order. Allowed values: "asc", "desc". |
+ * after | String | No | 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. |
+ * before | String | No | 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. |
+ *
+ * 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
* Name | Type | Required | Description |
+ * filter | String | No | Filter by file status. Allowed values: "in_progress",
+ * "completed", "failed", "cancelled". |
* limit | Integer | No | A limit on the number of objects to be returned. Limit can range
* between 1 and 100, and the default is 20. |
* order | String | No | Sort 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
* Name | Type | Required | Description |
+ * filter | String | No | Filter by file status. Allowed values: "in_progress",
+ * "completed", "failed", "cancelled". |
* limit | Integer | No | A limit on the number of objects to be returned. Limit can range
* between 1 and 100, and the default is 20. |
* order | String | No | Sort 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
- * Name | Type | Required | Description |
- * purpose | String | No | A 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
- * Name | Type | Required | Description |
- * purpose | String | No | A 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
+ * Name | Type | Required | Description |
+ * filter | String | No | Filter by file status. Allowed values: "in_progress",
+ * "completed", "failed", "cancelled". |
+ * limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the default is 20. |
+ * order | String | No | Sort order by the created_at timestamp of the objects. asc for
+ * ascending order and desc for descending order. Allowed values: "asc", "desc". |
+ * after | String | No | 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. |
+ * before | String | No | 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. |
+ *
+ * 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
+ * Name | Type | Required | Description |
+ * filter | String | No | Filter by file status. Allowed values: "in_progress",
+ * "completed", "failed", "cancelled". |
+ * limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the default is 20. |
+ * order | String | No | Sort order by the created_at timestamp of the objects. asc for
+ * ascending order and desc for descending order. Allowed values: "asc", "desc". |
+ * after | String | No | 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. |
+ * before | String | No | 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. |
+ *
+ * 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 | | | | | |