diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsAsyncClient.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsAsyncClient.java index cc7816580544c..59c2dd750e8fe 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsAsyncClient.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsAsyncClient.java @@ -36,6 +36,7 @@ import com.azure.ai.openai.assistants.models.ListSortOrder; import com.azure.ai.openai.assistants.models.OpenAIFile; import com.azure.ai.openai.assistants.models.PageableList; +import com.azure.ai.openai.assistants.models.RunIncludes; import com.azure.ai.openai.assistants.models.RunStep; import com.azure.ai.openai.assistants.models.StreamUpdate; import com.azure.ai.openai.assistants.models.ThreadDeletionStatus; @@ -70,6 +71,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.stream.Collectors; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -1825,29 +1827,6 @@ public Flux createThreadAndRunStream(CreateAndRunThreadOptions cre return eventStream.getEvents(); } - /** - * Gets a single run step from a thread run. - * - * @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single run step from a thread run on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getRunStep(String threadId, String runId, String stepId) { - // Generated convenience method for getRunStepWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getRunStepWithResponse(threadId, runId, stepId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(RunStep.class)); - } - /** * Gets a list of run steps from a thread run. * @@ -2381,30 +2360,6 @@ public Mono updateMessage(String threadId, String messageId) { .map(protocolMethodData -> protocolMethodData.toObject(ThreadMessage.class)); } - /** - * Creates a new run for an assistant thread. - * - * @param threadId The ID of the thread to run. - * @param createRunOptions The details used when creating a new run of an assistant thread. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data representing a single evaluation run of an assistant thread on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createRun(String threadId, CreateRunOptions createRunOptions) { - // Generated convenience method for createRunWithResponse - RequestOptions requestOptions = new RequestOptions(); - return createRunWithResponse(threadId, BinaryData.fromObject(createRunOptions), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ThreadRun.class)); - } - /** * Creates a new run for an assistant thread. * @@ -3919,4 +3874,32 @@ public Mono createVectorStoreFileBatch(String vectorStoreI .flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(VectorStoreFileBatch.class)); } + + /** + * Gets a single run step from a thread run. + * + * @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 runInclude A list of additional fields to include in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single run step from a thread run on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getRunStep(String threadId, String runId, String stepId, List runInclude) { + // Generated convenience method for getRunStepWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getRunStepWithResponse(threadId, runId, stepId, + runInclude.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.toList()), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(RunStep.class)); + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClient.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClient.java index 876d522fbcad9..f4790dd31d7a8 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClient.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClient.java @@ -36,6 +36,7 @@ import com.azure.ai.openai.assistants.models.ListSortOrder; import com.azure.ai.openai.assistants.models.OpenAIFile; import com.azure.ai.openai.assistants.models.PageableList; +import com.azure.ai.openai.assistants.models.RunIncludes; import com.azure.ai.openai.assistants.models.RunStep; import com.azure.ai.openai.assistants.models.StreamUpdate; import com.azure.ai.openai.assistants.models.ThreadDeletionStatus; @@ -70,6 +71,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.stream.Collectors; import reactor.core.publisher.Flux; /** @@ -1851,28 +1853,6 @@ public IterableStream createThreadAndRunStream(CreateAndRunThreadO return new IterableStream<>(eventStream.getEvents()); } - /** - * Gets a single run step from a thread run. - * - * @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single run step from a thread run. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public RunStep getRunStep(String threadId, String runId, String stepId) { - // Generated convenience method for getRunStepWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getRunStepWithResponse(threadId, runId, stepId, requestOptions).getValue().toObject(RunStep.class); - } - /** * Gets a list of run steps from a thread run. * @@ -2394,28 +2374,6 @@ public ThreadMessage updateMessage(String threadId, String messageId) { .toObject(ThreadMessage.class); } - /** - * Creates a new run for an assistant thread. - * - * @param threadId The ID of the thread to run. - * @param createRunOptions The details used when creating a new run of an assistant thread. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data representing a single evaluation run of an assistant thread. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public ThreadRun createRun(String threadId, CreateRunOptions createRunOptions) { - // Generated convenience method for createRunWithResponse - RequestOptions requestOptions = new RequestOptions(); - return createRunWithResponse(threadId, BinaryData.fromObject(createRunOptions), requestOptions).getValue() - .toObject(ThreadRun.class); - } - /** * Creates a new run for an assistant thread. * @@ -3932,4 +3890,31 @@ public VectorStoreFileBatch createVectorStoreFileBatch(String vectorStoreId, Lis .getValue() .toObject(VectorStoreFileBatch.class); } + + /** + * Gets a single run step from a thread run. + * + * @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 runInclude A list of additional fields to include in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single run step from a thread run. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public RunStep getRunStep(String threadId, String runId, String stepId, List runInclude) { + // Generated convenience method for getRunStepWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getRunStepWithResponse(threadId, runId, stepId, + runInclude.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.toList()), + requestOptions).getValue().toObject(RunStep.class); + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsServiceVersion.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsServiceVersion.java index 9e9fadb08ff19..f5f67a496ce6d 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsServiceVersion.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsServiceVersion.java @@ -23,7 +23,22 @@ public enum AssistantsServiceVersion implements ServiceVersion { /** * Enum value 2024-07-01-preview. */ - V2024_07_01_PREVIEW("2024-07-01-preview"); + V2024_07_01_PREVIEW("2024-07-01-preview"), + + /** + * Enum value 2024-09-01-preview. + */ + V2024_09_01_PREVIEW("2024-09-01-preview"), + + /** + * Enum value 2024-10-01-preview. + */ + V2024_10_01_PREVIEW("2024-10-01-preview"), + + /** + * Enum value 2024-12-01-preview. + */ + V2024_12_01_PREVIEW("2024-12-01-preview"); private final String version; @@ -45,6 +60,6 @@ public String getVersion() { * @return The latest {@link AssistantsServiceVersion}. */ public static AssistantsServiceVersion getLatest() { - return V2024_07_01_PREVIEW; + return V2024_12_01_PREVIEW; } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java index 098ebf6cd5858..eeb2ddf8e1082 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -34,6 +35,9 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; import reactor.core.publisher.Mono; /** @@ -428,9 +432,9 @@ Response updateMessageSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createRun(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createRunOptions, - RequestOptions requestOptions, Context context); + @PathParam("threadId") String threadId, @QueryParam("include[]") String runInclude, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData createRunOptions, RequestOptions requestOptions, Context context); @Post("/threads/{threadId}/runs") @ExpectedResponses({ 200 }) @@ -439,9 +443,9 @@ Mono> createRun(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createRunSync(@HostParam("endpoint") String endpoint, - @PathParam("threadId") String threadId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createRunOptions, - RequestOptions requestOptions, Context context); + @PathParam("threadId") String threadId, @QueryParam("include[]") String runInclude, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData createRunOptions, RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/runs") @ExpectedResponses({ 200 }) @@ -579,8 +583,8 @@ Response createThreadAndRunSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getRunStep(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @PathParam("stepId") String stepId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + @PathParam("stepId") String stepId, @QueryParam("include[]") String runInclude, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/runs/{runId}/steps/{stepId}") @ExpectedResponses({ 200 }) @@ -590,8 +594,8 @@ Mono> getRunStep(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getRunStepSync(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @PathParam("stepId") String stepId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + @PathParam("stepId") String stepId, @QueryParam("include[]") String runInclude, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/runs/{runId}/steps") @ExpectedResponses({ 200 }) @@ -601,7 +605,8 @@ Response getRunStepSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listRunSteps(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("include[]") String runInclude, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/threads/{threadId}/runs/{runId}/steps") @ExpectedResponses({ 200 }) @@ -611,7 +616,8 @@ Mono> listRunSteps(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response listRunStepsSync(@HostParam("endpoint") String endpoint, @PathParam("threadId") String threadId, @PathParam("runId") String runId, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("include[]") String runInclude, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/files") @ExpectedResponses({ 200 }) @@ -1178,7 +1184,7 @@ public Response createAssistantWithResponse(BinaryData assistantCrea * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. * beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the * list. * @@ -1259,7 +1265,7 @@ public Mono> listAssistantsWithResponseAsync(RequestOptions * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. * beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the * list. * @@ -2320,7 +2326,7 @@ public Response createMessageWithResponse(String threadId, BinaryDat * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. * beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the * list. * @@ -2402,7 +2408,7 @@ public Mono> listMessagesWithResponseAsync(String threadId, * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. * beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the * list. * @@ -2773,6 +2779,7 @@ public Response updateMessageWithResponse(String threadId, String me * type: String (Required) * } * ] + * parallel_tool_calls: Boolean (Optional) * stream: Boolean (Optional) * temperature: Double (Optional) * top_p: Double (Optional) @@ -2836,6 +2843,7 @@ public Response updateMessageWithResponse(String threadId, String me * last_messages: Integer (Optional) * } * tool_choice: BinaryData (Required) + * parallel_tool_calls: boolean (Required) * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) @@ -2845,6 +2853,7 @@ public Response updateMessageWithResponse(String threadId, String me * * * @param threadId The ID of the thread to run. + * @param runInclude A list of additional fields to include in the response. * @param createRunOptions The details used when creating a new run of an 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. @@ -2855,12 +2864,15 @@ public Response updateMessageWithResponse(String threadId, String me * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createRunWithResponseAsync(String threadId, BinaryData createRunOptions, - RequestOptions requestOptions) { + public Mono> createRunWithResponseAsync(String threadId, List runInclude, + BinaryData createRunOptions, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createRun(this.getEndpoint(), threadId, contentType, accept, - createRunOptions, requestOptions, context)); + String runIncludeConverted = runInclude.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil.withContext(context -> service.createRun(this.getEndpoint(), threadId, runIncludeConverted, + contentType, accept, createRunOptions, requestOptions, context)); } /** @@ -2912,6 +2924,7 @@ public Mono> createRunWithResponseAsync(String threadId, Bi * type: String (Required) * } * ] + * parallel_tool_calls: Boolean (Optional) * stream: Boolean (Optional) * temperature: Double (Optional) * top_p: Double (Optional) @@ -2975,6 +2988,7 @@ public Mono> createRunWithResponseAsync(String threadId, Bi * last_messages: Integer (Optional) * } * tool_choice: BinaryData (Required) + * parallel_tool_calls: boolean (Required) * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) @@ -2984,6 +2998,7 @@ public Mono> createRunWithResponseAsync(String threadId, Bi * * * @param threadId The ID of the thread to run. + * @param runInclude A list of additional fields to include in the response. * @param createRunOptions The details used when creating a new run of an 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. @@ -2993,12 +3008,15 @@ public Mono> createRunWithResponseAsync(String threadId, Bi * @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) { + public Response createRunWithResponse(String threadId, List runInclude, + BinaryData createRunOptions, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.createRunSync(this.getEndpoint(), threadId, contentType, accept, createRunOptions, - requestOptions, Context.NONE); + String runIncludeConverted = runInclude.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.createRunSync(this.getEndpoint(), threadId, runIncludeConverted, contentType, accept, + createRunOptions, requestOptions, Context.NONE); } /** @@ -3015,7 +3033,7 @@ public Response createRunWithResponse(String threadId, BinaryData cr * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. * beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the * list. * @@ -3068,6 +3086,7 @@ public Response createRunWithResponse(String threadId, BinaryData cr * last_messages: Integer (Optional) * } * tool_choice: BinaryData (Required) + * parallel_tool_calls: boolean (Required) * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) @@ -3111,7 +3130,7 @@ public Mono> listRunsWithResponseAsync(String threadId, Req * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. * beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the * list. * @@ -3164,6 +3183,7 @@ public Mono> listRunsWithResponseAsync(String threadId, Req * last_messages: Integer (Optional) * } * tool_choice: BinaryData (Required) + * parallel_tool_calls: boolean (Required) * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) @@ -3238,6 +3258,7 @@ public Response listRunsWithResponse(String threadId, RequestOptions * last_messages: Integer (Optional) * } * tool_choice: BinaryData (Required) + * parallel_tool_calls: boolean (Required) * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) @@ -3311,6 +3332,7 @@ public Mono> getRunWithResponseAsync(String threadId, Strin * last_messages: Integer (Optional) * } * tool_choice: BinaryData (Required) + * parallel_tool_calls: boolean (Required) * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) @@ -3393,6 +3415,7 @@ public Response getRunWithResponse(String threadId, String runId, Re * last_messages: Integer (Optional) * } * tool_choice: BinaryData (Required) + * parallel_tool_calls: boolean (Required) * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) @@ -3480,6 +3503,7 @@ public Mono> updateRunWithResponseAsync(String threadId, St * last_messages: Integer (Optional) * } * tool_choice: BinaryData (Required) + * parallel_tool_calls: boolean (Required) * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) @@ -3571,6 +3595,7 @@ public Response updateRunWithResponse(String threadId, String runId, * last_messages: Integer (Optional) * } * tool_choice: BinaryData (Required) + * parallel_tool_calls: boolean (Required) * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) @@ -3663,6 +3688,7 @@ public Mono> submitToolOutputsToRunWithResponseAsync(String * last_messages: Integer (Optional) * } * tool_choice: BinaryData (Required) + * parallel_tool_calls: boolean (Required) * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) @@ -3737,6 +3763,7 @@ public Response submitToolOutputsToRunWithResponse(String threadId, * last_messages: Integer (Optional) * } * tool_choice: BinaryData (Required) + * parallel_tool_calls: boolean (Required) * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) @@ -3810,6 +3837,7 @@ public Mono> cancelRunWithResponseAsync(String threadId, St * last_messages: Integer (Optional) * } * tool_choice: BinaryData (Required) + * parallel_tool_calls: boolean (Required) * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) @@ -3878,6 +3906,7 @@ public Response cancelRunWithResponse(String threadId, String runId, * type: String (Required) * } * ] + * parallel_tool_calls: Boolean (Optional) * tool_resources (Optional): { * code_interpreter (Optional): { * file_ids (Optional): [ @@ -3953,6 +3982,7 @@ public Response cancelRunWithResponse(String threadId, String runId, * last_messages: Integer (Optional) * } * tool_choice: BinaryData (Required) + * parallel_tool_calls: boolean (Required) * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) @@ -4024,6 +4054,7 @@ public Mono> createThreadAndRunWithResponseAsync(BinaryData * type: String (Required) * } * ] + * parallel_tool_calls: Boolean (Optional) * tool_resources (Optional): { * code_interpreter (Optional): { * file_ids (Optional): [ @@ -4099,6 +4130,7 @@ public Mono> createThreadAndRunWithResponseAsync(BinaryData * last_messages: Integer (Optional) * } * tool_choice: BinaryData (Required) + * parallel_tool_calls: boolean (Required) * response_format: BinaryData (Required) * metadata (Required): { * String: String (Required) @@ -4165,6 +4197,7 @@ public Response createThreadAndRunWithResponse(BinaryData createAndR * @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 runInclude A list of additional fields to include in the response. * @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. @@ -4174,10 +4207,13 @@ public Response createThreadAndRunWithResponse(BinaryData createAndR */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRunStepWithResponseAsync(String threadId, String runId, String stepId, - RequestOptions requestOptions) { + List runInclude, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getRunStep(this.getEndpoint(), threadId, runId, stepId, accept, - requestOptions, context)); + String runIncludeConverted = runInclude.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil.withContext(context -> service.getRunStep(this.getEndpoint(), threadId, runId, stepId, + runIncludeConverted, accept, requestOptions, context)); } /** @@ -4221,6 +4257,7 @@ public Mono> getRunStepWithResponseAsync(String threadId, S * @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 runInclude A list of additional fields to include in the response. * @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. @@ -4230,10 +4267,13 @@ public Mono> getRunStepWithResponseAsync(String threadId, S */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getRunStepWithResponse(String threadId, String runId, String stepId, - RequestOptions requestOptions) { + List runInclude, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getRunStepSync(this.getEndpoint(), threadId, runId, stepId, accept, requestOptions, - Context.NONE); + String runIncludeConverted = runInclude.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.getRunStepSync(this.getEndpoint(), threadId, runId, stepId, runIncludeConverted, accept, + requestOptions, Context.NONE); } /** @@ -4250,7 +4290,7 @@ public Response getRunStepWithResponse(String threadId, String runId * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. * beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the * list. * @@ -4301,6 +4341,7 @@ 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 runInclude A list of additional fields to include in the response. * @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. @@ -4311,10 +4352,13 @@ public Response getRunStepWithResponse(String threadId, String runId */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listRunStepsWithResponseAsync(String threadId, String runId, - RequestOptions requestOptions) { + List runInclude, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listRunSteps(this.getEndpoint(), threadId, runId, accept, requestOptions, context)); + String runIncludeConverted = runInclude.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil.withContext(context -> service.listRunSteps(this.getEndpoint(), threadId, runId, + runIncludeConverted, accept, requestOptions, context)); } /** @@ -4331,7 +4375,7 @@ public Mono> listRunStepsWithResponseAsync(String threadId, * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. * beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the * list. * @@ -4382,6 +4426,7 @@ 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 runInclude A list of additional fields to include in the response. * @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. @@ -4390,9 +4435,14 @@ public Mono> listRunStepsWithResponseAsync(String threadId, * @return a list of run steps from a thread run along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listRunStepsWithResponse(String threadId, String runId, RequestOptions requestOptions) { + public Response listRunStepsWithResponse(String threadId, String runId, List runInclude, + RequestOptions requestOptions) { final String accept = "application/json"; - return service.listRunStepsSync(this.getEndpoint(), threadId, runId, accept, requestOptions, Context.NONE); + String runIncludeConverted = runInclude.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return service.listRunStepsSync(this.getEndpoint(), threadId, runId, runIncludeConverted, accept, + requestOptions, Context.NONE); } /** @@ -4748,7 +4798,7 @@ public Response getFileContentWithResponse(String fileId, RequestOpt * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. * beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the * list. * @@ -4821,7 +4871,7 @@ public Mono> listVectorStoresWithResponseAsync(RequestOptio * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. * beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the * list. * @@ -5337,7 +5387,7 @@ public Response deleteVectorStoreWithResponse(String vectorStoreId, * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. * beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the * list. * @@ -5357,7 +5407,7 @@ public Response deleteVectorStoreWithResponse(String vectorStoreId, * 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) + * code: String(server_error/unsupported_file/invalid_file) (Required) * message: String (Required) * } * chunking_strategy (Required): { @@ -5405,7 +5455,7 @@ public Mono> listVectorStoreFilesWithResponseAsync(String v * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. * beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the * list. * @@ -5425,7 +5475,7 @@ public Mono> listVectorStoreFilesWithResponseAsync(String v * 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) + * code: String(server_error/unsupported_file/invalid_file) (Required) * message: String (Required) * } * chunking_strategy (Required): { @@ -5482,7 +5532,7 @@ public Response listVectorStoreFilesWithResponse(String vectorStoreI * 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) + * code: String(server_error/unsupported_file/invalid_file) (Required) * message: String (Required) * } * chunking_strategy (Required): { @@ -5538,7 +5588,7 @@ public Mono> createVectorStoreFileWithResponseAsync(String * 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) + * code: String(server_error/unsupported_file/invalid_file) (Required) * message: String (Required) * } * chunking_strategy (Required): { @@ -5580,7 +5630,7 @@ public Response createVectorStoreFileWithResponse(String vectorStore * 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) + * code: String(server_error/unsupported_file/invalid_file) (Required) * message: String (Required) * } * chunking_strategy (Required): { @@ -5622,7 +5672,7 @@ public Mono> getVectorStoreFileWithResponseAsync(String vec * 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) + * code: String(server_error/unsupported_file/invalid_file) (Required) * message: String (Required) * } * chunking_strategy (Required): { @@ -6009,7 +6059,7 @@ public Response cancelVectorStoreFileBatchWithResponse(String vector * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. * beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the * list. * @@ -6029,7 +6079,7 @@ public Response cancelVectorStoreFileBatchWithResponse(String vector * 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) + * code: String(server_error/unsupported_file/invalid_file) (Required) * message: String (Required) * } * chunking_strategy (Required): { @@ -6078,7 +6128,7 @@ public Mono> listVectorStoreFileBatchFilesWithResponseAsync * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with * obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. * beforeStringNoA cursor for use in pagination. before is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + * defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with * obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the * list. * @@ -6098,7 +6148,7 @@ public Mono> listVectorStoreFileBatchFilesWithResponseAsync * 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) + * code: String(server_error/unsupported_file/invalid_file) (Required) * message: String (Required) * } * chunking_strategy (Required): { diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ApiResponseFormat.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ApiResponseFormat.java index 084aba93e31bf..4fc29e8e70894 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ApiResponseFormat.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ApiResponseFormat.java @@ -54,4 +54,10 @@ public static ApiResponseFormat fromString(String name) { public static Collection values() { return values(ApiResponseFormat.class); } + + /** + * Using `json_schema` format will ensure the model matches the supplied JSON schema. + */ + @Generated + public static final ApiResponseFormat JSON_SCHEMA = fromString("json_schema"); } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormat.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormat.java index 01d625f8a3080..c7e6deda1ba36 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormat.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormat.java @@ -3,8 +3,8 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.assistants.models; -import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,14 +16,14 @@ * be passed to the Run. * If `text` the model can return text or any value needed. */ -@Fluent -public final class AssistantsApiResponseFormat implements JsonSerializable { +@Immutable +public class AssistantsApiResponseFormat implements JsonSerializable { /* - * Must be one of `text` or `json_object`. + * Must be one of `text`, `json_object` or `json_schema` . */ @Generated - private ApiResponseFormat type; + private ApiResponseFormat type = ApiResponseFormat.fromString("AssistantsApiResponseFormat"); /** * Creates an instance of AssistantsApiResponseFormat class. @@ -41,7 +41,7 @@ public AssistantsApiResponseFormat(ApiResponseFormat type) { } /** - * Get the type property: Must be one of `text` or `json_object`. + * Get the type property: Must be one of `text`, `json_object` or `json_schema` . * * @return the type value. */ @@ -50,18 +50,6 @@ public ApiResponseFormat getType() { return this.type; } - /** - * Set the type property: Must be one of `text` or `json_object`. - * - * @param type the type value to set. - * @return the AssistantsApiResponseFormat object itself. - */ - @Generated - public AssistantsApiResponseFormat setType(ApiResponseFormat type) { - this.type = type; - return this; - } - /** * {@inheritDoc} */ @@ -83,6 +71,37 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { */ @Generated public static AssistantsApiResponseFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("text".equals(discriminatorValue)) { + return AssistantsApiResponseFormatText.fromJson(readerToUse.reset()); + } else if ("json_object".equals(discriminatorValue)) { + return AssistantsApiResponseFormatJsonObject.fromJson(readerToUse.reset()); + } else if ("json_schema".equals(discriminatorValue)) { + return AssistantsApiResponseFormatJsonSchema.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static AssistantsApiResponseFormat fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { AssistantsApiResponseFormat deserializedAssistantsApiResponseFormat = new AssistantsApiResponseFormat(); while (reader.nextToken() != JsonToken.END_OBJECT) { diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatJsonObject.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatJsonObject.java new file mode 100644 index 0000000000000..f2edc27f083f0 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatJsonObject.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An object describing expected output of the model as a JSON object. + */ +@Immutable +public final class AssistantsApiResponseFormatJsonObject extends AssistantsApiResponseFormat { + /* + * Must be one of `text`, `json_object` or `json_schema` . + */ + @Generated + private ApiResponseFormat type = ApiResponseFormat.JSON_OBJECT; + + /** + * Creates an instance of AssistantsApiResponseFormatJsonObject class. + */ + @Generated + public AssistantsApiResponseFormatJsonObject() { + } + + /** + * Get the type property: Must be one of `text`, `json_object` or `json_schema` . + * + * @return the type value. + */ + @Generated + @Override + public ApiResponseFormat getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssistantsApiResponseFormatJsonObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssistantsApiResponseFormatJsonObject if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AssistantsApiResponseFormatJsonObject. + */ + @Generated + public static AssistantsApiResponseFormatJsonObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssistantsApiResponseFormatJsonObject deserializedAssistantsApiResponseFormatJsonObject + = new AssistantsApiResponseFormatJsonObject(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAssistantsApiResponseFormatJsonObject.type + = ApiResponseFormat.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAssistantsApiResponseFormatJsonObject; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatJsonSchema.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatJsonSchema.java new file mode 100644 index 0000000000000..d94adb94ff78b --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatJsonSchema.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An object describing expected output of the model to match a JSON schema. + */ +@Immutable +public final class AssistantsApiResponseFormatJsonSchema extends AssistantsApiResponseFormat { + /* + * Must be one of `text`, `json_object` or `json_schema` . + */ + @Generated + private ApiResponseFormat type = ApiResponseFormat.JSON_SCHEMA; + + /* + * The JSON schema that the model must output. + */ + @Generated + private final AssistantsApiResponseFormatJsonSchemaJsonSchema jsonSchema; + + /** + * Creates an instance of AssistantsApiResponseFormatJsonSchema class. + * + * @param jsonSchema the jsonSchema value to set. + */ + @Generated + public AssistantsApiResponseFormatJsonSchema(AssistantsApiResponseFormatJsonSchemaJsonSchema jsonSchema) { + this.jsonSchema = jsonSchema; + } + + /** + * Get the type property: Must be one of `text`, `json_object` or `json_schema` . + * + * @return the type value. + */ + @Generated + @Override + public ApiResponseFormat getType() { + return this.type; + } + + /** + * Get the jsonSchema property: The JSON schema that the model must output. + * + * @return the jsonSchema value. + */ + @Generated + public AssistantsApiResponseFormatJsonSchemaJsonSchema getJsonSchema() { + return this.jsonSchema; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("json_schema", this.jsonSchema); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssistantsApiResponseFormatJsonSchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssistantsApiResponseFormatJsonSchema 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 AssistantsApiResponseFormatJsonSchema. + */ + @Generated + public static AssistantsApiResponseFormatJsonSchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssistantsApiResponseFormatJsonSchemaJsonSchema jsonSchema = null; + ApiResponseFormat type = ApiResponseFormat.JSON_SCHEMA; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("json_schema".equals(fieldName)) { + jsonSchema = AssistantsApiResponseFormatJsonSchemaJsonSchema.fromJson(reader); + } else if ("type".equals(fieldName)) { + type = ApiResponseFormat.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + AssistantsApiResponseFormatJsonSchema deserializedAssistantsApiResponseFormatJsonSchema + = new AssistantsApiResponseFormatJsonSchema(jsonSchema); + deserializedAssistantsApiResponseFormatJsonSchema.type = type; + + return deserializedAssistantsApiResponseFormatJsonSchema; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatJsonSchemaJsonSchema.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatJsonSchemaJsonSchema.java new file mode 100644 index 0000000000000..14428a88e6673 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatJsonSchemaJsonSchema.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The AssistantsApiResponseFormatJsonSchemaJsonSchema model. + */ +@Fluent +public final class AssistantsApiResponseFormatJsonSchemaJsonSchema + implements JsonSerializable { + /* + * A description of what the response format is for, used by the model to determine how to respond in the format. + */ + @Generated + private String description; + + /* + * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length + * of 64. + */ + @Generated + private final String name; + + /* + * The schema for the response format, described as a JSON Schema object. + */ + @Generated + private final BinaryData schema; + + /* + * Whether to enable strict schema adherence when generating the output. If set to true, the model will always + * follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is + * `true`. To learn more, read the Structured Outputs guide. + */ + @Generated + private Boolean strict; + + /** + * Creates an instance of AssistantsApiResponseFormatJsonSchemaJsonSchema class. + * + * @param name the name value to set. + * @param schema the schema value to set. + */ + @Generated + public AssistantsApiResponseFormatJsonSchemaJsonSchema(String name, BinaryData schema) { + this.name = name; + this.schema = schema; + } + + /** + * Get the description property: A description of what the response format is for, used by the model to determine + * how to respond in the format. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: A description of what the response format is for, used by the model to determine + * how to respond in the format. + * + * @param description the description value to set. + * @return the AssistantsApiResponseFormatJsonSchemaJsonSchema object itself. + */ + @Generated + public AssistantsApiResponseFormatJsonSchemaJsonSchema setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the name property: The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, + * with a maximum length of 64. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the schema property: The schema for the response format, described as a JSON Schema object. + * + * @return the schema value. + */ + @Generated + public BinaryData getSchema() { + return this.schema; + } + + /** + * Get the strict property: Whether to enable strict schema adherence when generating the output. If set to true, + * the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is + * supported when `strict` is `true`. To learn more, read the Structured Outputs guide. + * + * @return the strict value. + */ + @Generated + public Boolean isStrict() { + return this.strict; + } + + /** + * Set the strict property: Whether to enable strict schema adherence when generating the output. If set to true, + * the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is + * supported when `strict` is `true`. To learn more, read the Structured Outputs guide. + * + * @param strict the strict value to set. + * @return the AssistantsApiResponseFormatJsonSchemaJsonSchema object itself. + */ + @Generated + public AssistantsApiResponseFormatJsonSchemaJsonSchema setStrict(Boolean strict) { + this.strict = strict; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeFieldName("schema"); + this.schema.writeTo(jsonWriter); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeBooleanField("strict", this.strict); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssistantsApiResponseFormatJsonSchemaJsonSchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssistantsApiResponseFormatJsonSchemaJsonSchema 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 AssistantsApiResponseFormatJsonSchemaJsonSchema. + */ + @Generated + public static AssistantsApiResponseFormatJsonSchemaJsonSchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + BinaryData schema = null; + String description = null; + Boolean strict = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("schema".equals(fieldName)) { + schema = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("strict".equals(fieldName)) { + strict = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + AssistantsApiResponseFormatJsonSchemaJsonSchema deserializedAssistantsApiResponseFormatJsonSchemaJsonSchema + = new AssistantsApiResponseFormatJsonSchemaJsonSchema(name, schema); + deserializedAssistantsApiResponseFormatJsonSchemaJsonSchema.description = description; + deserializedAssistantsApiResponseFormatJsonSchemaJsonSchema.strict = strict; + + return deserializedAssistantsApiResponseFormatJsonSchemaJsonSchema; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatMode.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatMode.java index eafae255a1ad6..ef3aa7012a542 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatMode.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatMode.java @@ -18,12 +18,6 @@ public final class AssistantsApiResponseFormatMode extends ExpandableStringEnum< @Generated public static final AssistantsApiResponseFormatMode AUTO = fromString("auto"); - /** - * Setting the value to `none`, will result in a 400 Bad request. - */ - @Generated - public static final AssistantsApiResponseFormatMode NONE = fromString("none"); - /** * Creates a new instance of AssistantsApiResponseFormatMode value. * diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatText.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatText.java new file mode 100644 index 0000000000000..298bf1cb94285 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatText.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An object describing expected output of the model as text. + */ +@Immutable +public final class AssistantsApiResponseFormatText extends AssistantsApiResponseFormat { + /* + * Must be one of `text`, `json_object` or `json_schema` . + */ + @Generated + private ApiResponseFormat type = ApiResponseFormat.TEXT; + + /** + * Creates an instance of AssistantsApiResponseFormatText class. + */ + @Generated + public AssistantsApiResponseFormatText() { + } + + /** + * Get the type property: Must be one of `text`, `json_object` or `json_schema` . + * + * @return the type value. + */ + @Generated + @Override + public ApiResponseFormat getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssistantsApiResponseFormatText from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssistantsApiResponseFormatText if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AssistantsApiResponseFormatText. + */ + @Generated + public static AssistantsApiResponseFormatText fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssistantsApiResponseFormatText deserializedAssistantsApiResponseFormatText + = new AssistantsApiResponseFormatText(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAssistantsApiResponseFormatText.type = ApiResponseFormat.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAssistantsApiResponseFormatText; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatType.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatType.java new file mode 100644 index 0000000000000..7bd5e15af378d --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantsApiResponseFormatType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +/** + * Defines values for AssistantsApiResponseFormatType. + */ +public enum AssistantsApiResponseFormatType { + /** + * Enum value text. + */ + TEXT("text"); + + /** + * The actual serialized value for a AssistantsApiResponseFormatType instance. + */ + private final String value; + + AssistantsApiResponseFormatType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AssistantsApiResponseFormatType instance. + * + * @param value the serialized value to parse. + * @return the parsed AssistantsApiResponseFormatType object, or null if unable to parse. + */ + public static AssistantsApiResponseFormatType fromString(String value) { + if (value == null) { + return null; + } + AssistantsApiResponseFormatType[] items = AssistantsApiResponseFormatType.values(); + for (AssistantsApiResponseFormatType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateAndRunThreadOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateAndRunThreadOptions.java index 10493076d5893..c27351a674ada 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateAndRunThreadOptions.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateAndRunThreadOptions.java @@ -206,6 +206,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("model", this.model); jsonWriter.writeStringField("instructions", this.instructions); jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("parallel_tool_calls", this.parallelToolCalls); jsonWriter.writeJsonField("tool_resources", this.toolResources); jsonWriter.writeBooleanField("stream", this.stream); jsonWriter.writeNumberField("temperature", this.temperature); @@ -242,6 +243,7 @@ public static CreateAndRunThreadOptions fromJson(JsonReader jsonReader) throws I String model = null; String instructions = null; List tools = null; + Boolean parallelToolCalls = null; UpdateToolResourcesOptions toolResources = null; Boolean stream = null; Double temperature = null; @@ -265,6 +267,8 @@ public static CreateAndRunThreadOptions fromJson(JsonReader jsonReader) throws I instructions = reader.getString(); } else if ("tools".equals(fieldName)) { tools = reader.readArray(reader1 -> ToolDefinition.fromJson(reader1)); + } else if ("parallel_tool_calls".equals(fieldName)) { + parallelToolCalls = reader.getNullable(JsonReader::getBoolean); } else if ("tool_resources".equals(fieldName)) { toolResources = UpdateToolResourcesOptions.fromJson(reader); } else if ("stream".equals(fieldName)) { @@ -297,6 +301,7 @@ public static CreateAndRunThreadOptions fromJson(JsonReader jsonReader) throws I deserializedCreateAndRunThreadOptions.model = model; deserializedCreateAndRunThreadOptions.instructions = instructions; deserializedCreateAndRunThreadOptions.tools = tools; + deserializedCreateAndRunThreadOptions.parallelToolCalls = parallelToolCalls; deserializedCreateAndRunThreadOptions.toolResources = toolResources; deserializedCreateAndRunThreadOptions.stream = stream; deserializedCreateAndRunThreadOptions.temperature = temperature; @@ -617,4 +622,32 @@ public CreateAndRunThreadOptions setResponseFormat(AssistantsApiResponseFormatOp } return this; } + + /* + * Whether to enable parallel function calling during tool use. + */ + @Generated + private Boolean parallelToolCalls; + + /** + * Get the parallelToolCalls property: Whether to enable parallel function calling during tool use. + * + * @return the parallelToolCalls value. + */ + @Generated + public Boolean isParallelToolCalls() { + return this.parallelToolCalls; + } + + /** + * Set the parallelToolCalls property: Whether to enable parallel function calling during tool use. + * + * @param parallelToolCalls the parallelToolCalls value to set. + * @return the CreateAndRunThreadOptions object itself. + */ + @Generated + public CreateAndRunThreadOptions setParallelToolCalls(Boolean parallelToolCalls) { + this.parallelToolCalls = parallelToolCalls; + return this; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateRunOptions.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateRunOptions.java index 6048bd34d1fb5..6f46951a03ecc 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateRunOptions.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateRunOptions.java @@ -214,6 +214,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("additional_messages", this.additionalMessages, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("parallel_tool_calls", this.parallelToolCalls); jsonWriter.writeBooleanField("stream", this.stream); jsonWriter.writeNumberField("temperature", this.temperature); jsonWriter.writeNumberField("top_p", this.topP); @@ -250,6 +251,7 @@ public static CreateRunOptions fromJson(JsonReader jsonReader) throws IOExceptio String additionalInstructions = null; List additionalMessages = null; List tools = null; + Boolean parallelToolCalls = null; Boolean stream = null; Double temperature = null; Double topP = null; @@ -274,6 +276,8 @@ public static CreateRunOptions fromJson(JsonReader jsonReader) throws IOExceptio additionalMessages = reader.readArray(reader1 -> ThreadMessage.fromJson(reader1)); } else if ("tools".equals(fieldName)) { tools = reader.readArray(reader1 -> ToolDefinition.fromJson(reader1)); + } else if ("parallel_tool_calls".equals(fieldName)) { + parallelToolCalls = reader.getNullable(JsonReader::getBoolean); } else if ("stream".equals(fieldName)) { stream = reader.getNullable(JsonReader::getBoolean); } else if ("temperature".equals(fieldName)) { @@ -304,6 +308,7 @@ public static CreateRunOptions fromJson(JsonReader jsonReader) throws IOExceptio deserializedCreateRunOptions.additionalInstructions = additionalInstructions; deserializedCreateRunOptions.additionalMessages = additionalMessages; deserializedCreateRunOptions.tools = tools; + deserializedCreateRunOptions.parallelToolCalls = parallelToolCalls; deserializedCreateRunOptions.stream = stream; deserializedCreateRunOptions.temperature = temperature; deserializedCreateRunOptions.topP = topP; @@ -620,4 +625,32 @@ public CreateRunOptions setResponseFormat(AssistantsApiResponseFormatOption resp } return this; } + + /* + * Whether to enable parallel function calling during tool use. + */ + @Generated + private Boolean parallelToolCalls; + + /** + * Get the parallelToolCalls property: Whether to enable parallel function calling during tool use. + * + * @return the parallelToolCalls value. + */ + @Generated + public Boolean isParallelToolCalls() { + return this.parallelToolCalls; + } + + /** + * Set the parallelToolCalls property: Whether to enable parallel function calling during tool use. + * + * @param parallelToolCalls the parallelToolCalls value to set. + * @return the CreateRunOptions object itself. + */ + @Generated + public CreateRunOptions setParallelToolCalls(Boolean parallelToolCalls) { + this.parallelToolCalls = parallelToolCalls; + return this; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolCallResult.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolCallResult.java new file mode 100644 index 0000000000000..4b60013076fec --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolCallResult.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * File search tool call result. + */ +@Immutable +public final class FileSearchToolCallResult implements JsonSerializable { + /* + * The ID of the file that result was found in. + */ + @Generated + private final String fileId; + + /* + * The name of the file that result was found in. + */ + @Generated + private final String fileName; + + /* + * The score of the result. All values must be a floating point number between 0 and 1. + */ + @Generated + private final double score; + + /* + * The content of the result that was found. The content is only included if requested via the include query + * parameter. + */ + @Generated + private List content; + + /** + * Creates an instance of FileSearchToolCallResult class. + * + * @param fileId the fileId value to set. + * @param fileName the fileName value to set. + * @param score the score value to set. + */ + @Generated + private FileSearchToolCallResult(String fileId, String fileName, double score) { + this.fileId = fileId; + this.fileName = fileName; + this.score = score; + } + + /** + * Get the fileId property: The ID of the file that result was found in. + * + * @return the fileId value. + */ + @Generated + public String getFileId() { + return this.fileId; + } + + /** + * Get the fileName property: The name of the file that result was found in. + * + * @return the fileName value. + */ + @Generated + public String getFileName() { + return this.fileName; + } + + /** + * Get the score property: The score of the result. All values must be a floating point number between 0 and 1. + * + * @return the score value. + */ + @Generated + public double getScore() { + return this.score; + } + + /** + * Get the content property: The content of the result that was found. The content is only included if requested via + * the include query parameter. + * + * @return the content value. + */ + @Generated + public List getContent() { + return this.content; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("file_id", this.fileId); + jsonWriter.writeStringField("file_name", this.fileName); + jsonWriter.writeDoubleField("score", this.score); + jsonWriter.writeArrayField("content", this.content, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileSearchToolCallResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileSearchToolCallResult 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 FileSearchToolCallResult. + */ + @Generated + public static FileSearchToolCallResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String fileId = null; + String fileName = null; + double score = 0.0; + List content = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("file_id".equals(fieldName)) { + fileId = reader.getString(); + } else if ("file_name".equals(fieldName)) { + fileName = reader.getString(); + } else if ("score".equals(fieldName)) { + score = reader.getDouble(); + } else if ("content".equals(fieldName)) { + content = reader.readArray(reader1 -> FileSearchToolCallResultContentItem.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + FileSearchToolCallResult deserializedFileSearchToolCallResult + = new FileSearchToolCallResult(fileId, fileName, score); + deserializedFileSearchToolCallResult.content = content; + + return deserializedFileSearchToolCallResult; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolCallResultContentItem.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolCallResultContentItem.java new file mode 100644 index 0000000000000..6d9c0bb22dc53 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/FileSearchToolCallResultContentItem.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Content item in a file search result. + */ +@Immutable +public final class FileSearchToolCallResultContentItem + implements JsonSerializable { + /* + * The type of the content. + */ + @Generated + private AssistantsApiResponseFormatType type; + + /* + * The text content of the file. + */ + @Generated + private String text; + + /** + * Creates an instance of FileSearchToolCallResultContentItem class. + */ + @Generated + private FileSearchToolCallResultContentItem() { + } + + /** + * Get the type property: The type of the content. + * + * @return the type value. + */ + @Generated + public AssistantsApiResponseFormatType getType() { + return this.type; + } + + /** + * Get the text property: The text content of the file. + * + * @return the text value. + */ + @Generated + public String getText() { + return this.text; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("text", this.text); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileSearchToolCallResultContentItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileSearchToolCallResultContentItem if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FileSearchToolCallResultContentItem. + */ + @Generated + public static FileSearchToolCallResultContentItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileSearchToolCallResultContentItem deserializedFileSearchToolCallResultContentItem + = new FileSearchToolCallResultContentItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedFileSearchToolCallResultContentItem.type + = AssistantsApiResponseFormatType.fromString(reader.getString()); + } else if ("text".equals(fieldName)) { + deserializedFileSearchToolCallResultContentItem.text = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFileSearchToolCallResultContentItem; + }); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunIncludes.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunIncludes.java new file mode 100644 index 0000000000000..82c320e65a2a2 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunIncludes.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.assistants.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Values to for the includes parameter in the create run operation. + */ +public final class RunIncludes extends ExpandableStringEnum { + /** + * Fetch the file search result content. + */ + @Generated + public static final RunIncludes FILE_SEARCH_CONTENT + = fromString("step_details.tool_calls[*].file_search.results[*].content"); + + /** + * Creates a new instance of RunIncludes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public RunIncludes() { + } + + /** + * Creates or finds a RunIncludes from its string representation. + * + * @param name a name to look for. + * @return the corresponding RunIncludes. + */ + @Generated + public static RunIncludes fromString(String name) { + return fromString(name, RunIncludes.class); + } + + /** + * Gets known RunIncludes values. + * + * @return known RunIncludes values. + */ + @Generated + public static Collection values() { + return values(RunIncludes.class); + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepFileSearchToolCall.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepFileSearchToolCall.java index 309bef61d2414..147e02f3b296e 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepFileSearchToolCall.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/RunStepFileSearchToolCall.java @@ -9,7 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.Map; +import java.util.List; /** * A record of a call to a file search tool, issued by the model in evaluation of a defined tool, that represents @@ -25,22 +25,10 @@ public final class RunStepFileSearchToolCall extends RunStepToolCall { private String type = "file_search"; /* - * Reserved for future use. + * The results of the file search. */ @Generated - private final Map fileSearch; - - /** - * Creates an instance of RunStepFileSearchToolCall class. - * - * @param id the id value to set. - * @param fileSearch the fileSearch value to set. - */ - @Generated - private RunStepFileSearchToolCall(String id, Map fileSearch) { - super(id); - this.fileSearch = fileSearch; - } + private final List fileSearch; /** * Get the type property: The object type. @@ -54,12 +42,12 @@ public String getType() { } /** - * Get the fileSearch property: Reserved for future use. + * Get the fileSearch property: The results of the file search. * * @return the fileSearch value. */ @Generated - public Map getFileSearch() { + public List getFileSearch() { return this.fileSearch; } @@ -71,7 +59,7 @@ public Map getFileSearch() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("id", getId()); - jsonWriter.writeMapField("file_search", this.fileSearch, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("file_search", this.fileSearch, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("type", this.type); return jsonWriter.writeEndObject(); } @@ -89,7 +77,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static RunStepFileSearchToolCall fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String id = null; - Map fileSearch = null; + List fileSearch = null; String type = "file_search"; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -97,7 +85,7 @@ public static RunStepFileSearchToolCall fromJson(JsonReader jsonReader) throws I if ("id".equals(fieldName)) { id = reader.getString(); } else if ("file_search".equals(fieldName)) { - fileSearch = reader.readMap(reader1 -> reader1.getString()); + fileSearch = reader.readArray(reader1 -> FileSearchToolCallResult.fromJson(reader1)); } else if ("type".equals(fieldName)) { type = reader.getString(); } else { @@ -110,4 +98,16 @@ public static RunStepFileSearchToolCall fromJson(JsonReader jsonReader) throws I return deserializedRunStepFileSearchToolCall; }); } + + /** + * Creates an instance of RunStepFileSearchToolCall class. + * + * @param id the id value to set. + * @param fileSearch the fileSearch value to set. + */ + @Generated + private RunStepFileSearchToolCall(String id, List fileSearch) { + super(id); + this.fileSearch = fileSearch; + } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadRun.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadRun.java index dc64119771914..c4a52e359f84c 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadRun.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadRun.java @@ -344,6 +344,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("truncation_strategy", this.truncationStrategy); jsonWriter.writeFieldName("tool_choice"); this.toolChoice.writeTo(jsonWriter); + jsonWriter.writeBooleanField("parallel_tool_calls", this.parallelToolCalls); jsonWriter.writeFieldName("response_format"); this.responseFormat.writeTo(jsonWriter); jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); @@ -385,6 +386,7 @@ public static ThreadRun fromJson(JsonReader jsonReader) throws IOException { Integer maxCompletionTokens = null; TruncationObject truncationStrategy = null; BinaryData toolChoice = null; + boolean parallelToolCalls = false; BinaryData responseFormat = null; Map metadata = null; RequiredAction requiredAction = null; @@ -451,6 +453,8 @@ public static ThreadRun fromJson(JsonReader jsonReader) throws IOException { } else if ("tool_choice".equals(fieldName)) { toolChoice = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else if ("parallel_tool_calls".equals(fieldName)) { + parallelToolCalls = reader.getBoolean(); } else if ("response_format".equals(fieldName)) { responseFormat = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); @@ -469,7 +473,7 @@ public static ThreadRun fromJson(JsonReader jsonReader) throws IOException { ThreadRun deserializedThreadRun = new ThreadRun(id, threadId, assistantId, status, lastError, model, instructions, tools, createdAt, expiresAt, startedAt, completedAt, cancelledAt, failedAt, incompleteDetails, usage, maxPromptTokens, - maxCompletionTokens, truncationStrategy, toolChoice, responseFormat, metadata); + maxCompletionTokens, truncationStrategy, toolChoice, parallelToolCalls, responseFormat, metadata); deserializedThreadRun.requiredAction = requiredAction; deserializedThreadRun.temperature = temperature; deserializedThreadRun.topP = topP; @@ -554,6 +558,83 @@ public IncompleteRunDetails getIncompleteDetails() { @Generated private final BinaryData responseFormat; + /** + * Get the temperature property: The sampling temperature used for this run. If not set, defaults to 1. + * + * @return the temperature value. + */ + @Generated + public Double getTemperature() { + return this.temperature; + } + + /** + * Get the topP property: The nucleus sampling value used for this run. If not set, defaults to 1. + * + * @return the topP value. + */ + @Generated + public Double getTopP() { + return this.topP; + } + + /** + * Get the maxPromptTokens property: The maximum number of prompt tokens specified to have been used over the course + * of the run. + * + * @return the maxPromptTokens value. + */ + @Generated + public Integer getMaxPromptTokens() { + return this.maxPromptTokens; + } + + /** + * Get the maxCompletionTokens property: The maximum number of completion tokens specified to have been used over + * the course of the run. + * + * @return the maxCompletionTokens value. + */ + @Generated + public Integer getMaxCompletionTokens() { + return this.maxCompletionTokens; + } + + /** + * Get the truncationStrategy property: The strategy to use for dropping messages as the context windows moves + * forward. + * + * @return the truncationStrategy value. + */ + @Generated + public TruncationObject getTruncationStrategy() { + return this.truncationStrategy; + } + + /** + * Get the toolChoice property: Controls whether or not and which tool is called by the model. + * + * @return the toolChoice value. + */ + public AssistantsApiToolChoiceOption getToolChoice() { + return AssistantsApiToolChoiceOption.fromBinaryData(this.toolChoice); + } + + /** + * Get the responseFormat property: The response format of the tool calls used in this run. + * + * @return the responseFormat value. + */ + public AssistantsApiResponseFormatOption getResponseFormat() { + return AssistantsApiResponseFormatOption.fromBinaryData(this.responseFormat); + } + + /* + * Whether to enable parallel function calling during tool use. + */ + @Generated + private final boolean parallelToolCalls; + /** * Creates an instance of ThreadRun class. * @@ -577,6 +658,7 @@ public IncompleteRunDetails getIncompleteDetails() { * @param maxCompletionTokens the maxCompletionTokens value to set. * @param truncationStrategy the truncationStrategy value to set. * @param toolChoice the toolChoice value to set. + * @param parallelToolCalls the parallelToolCalls value to set. * @param responseFormat the responseFormat value to set. * @param metadata the metadata value to set. */ @@ -586,7 +668,7 @@ private ThreadRun(String id, String threadId, String assistantId, RunStatus stat OffsetDateTime expiresAt, OffsetDateTime startedAt, OffsetDateTime completedAt, OffsetDateTime cancelledAt, OffsetDateTime failedAt, IncompleteRunDetails incompleteDetails, RunCompletionUsage usage, Integer maxPromptTokens, Integer maxCompletionTokens, TruncationObject truncationStrategy, - BinaryData toolChoice, BinaryData responseFormat, Map metadata) { + BinaryData toolChoice, boolean parallelToolCalls, BinaryData responseFormat, Map metadata) { this.id = id; this.threadId = threadId; this.assistantId = assistantId; @@ -631,78 +713,18 @@ private ThreadRun(String id, String threadId, String assistantId, RunStatus stat this.maxCompletionTokens = maxCompletionTokens; this.truncationStrategy = truncationStrategy; this.toolChoice = toolChoice; + this.parallelToolCalls = parallelToolCalls; this.responseFormat = responseFormat; this.metadata = metadata; } /** - * Get the temperature property: The sampling temperature used for this run. If not set, defaults to 1. - * - * @return the temperature value. - */ - @Generated - public Double getTemperature() { - return this.temperature; - } - - /** - * Get the topP property: The nucleus sampling value used for this run. If not set, defaults to 1. - * - * @return the topP value. - */ - @Generated - public Double getTopP() { - return this.topP; - } - - /** - * Get the maxPromptTokens property: The maximum number of prompt tokens specified to have been used over the course - * of the run. - * - * @return the maxPromptTokens value. - */ - @Generated - public Integer getMaxPromptTokens() { - return this.maxPromptTokens; - } - - /** - * Get the maxCompletionTokens property: The maximum number of completion tokens specified to have been used over - * the course of the run. - * - * @return the maxCompletionTokens value. - */ - @Generated - public Integer getMaxCompletionTokens() { - return this.maxCompletionTokens; - } - - /** - * Get the truncationStrategy property: The strategy to use for dropping messages as the context windows moves - * forward. + * Get the parallelToolCalls property: Whether to enable parallel function calling during tool use. * - * @return the truncationStrategy value. + * @return the parallelToolCalls value. */ @Generated - public TruncationObject getTruncationStrategy() { - return this.truncationStrategy; - } - - /** - * Get the toolChoice property: Controls whether or not and which tool is called by the model. - * - * @return the toolChoice value. - */ - public AssistantsApiToolChoiceOption getToolChoice() { - return AssistantsApiToolChoiceOption.fromBinaryData(this.toolChoice); - } - - /** - * Get the responseFormat property: The response format of the tool calls used in this run. - * - * @return the responseFormat value. - */ - public AssistantsApiResponseFormatOption getResponseFormat() { - return AssistantsApiResponseFormatOption.fromBinaryData(this.responseFormat); + public boolean isParallelToolCalls() { + return this.parallelToolCalls; } } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileErrorCode.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileErrorCode.java index 8f84f3c38a1fa..e7c578e2fc083 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileErrorCode.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/VectorStoreFileErrorCode.java @@ -12,30 +12,6 @@ */ public final class VectorStoreFileErrorCode extends ExpandableStringEnum { - /** - * An internal error occurred. - */ - @Generated - public static final VectorStoreFileErrorCode INTERNAL_ERROR = fromString("internal_error"); - - /** - * The file was not found. - */ - @Generated - public static final VectorStoreFileErrorCode FILE_NOT_FOUND = fromString("file_not_found"); - - /** - * The file could not be parsed. - */ - @Generated - public static final VectorStoreFileErrorCode PARSING_ERROR = fromString("parsing_error"); - - /** - * The file has an unhandled mime type. - */ - @Generated - public static final VectorStoreFileErrorCode UNHANDLED_MIME_TYPE = fromString("unhandled_mime_type"); - /** * Creates a new instance of VectorStoreFileErrorCode value. * @@ -66,4 +42,22 @@ public static VectorStoreFileErrorCode fromString(String name) { public static Collection values() { return values(VectorStoreFileErrorCode.class); } + + /** + * The server encountered an error. + */ + @Generated + public static final VectorStoreFileErrorCode SERVER_ERROR = fromString("server_error"); + + /** + * The file format is not supported. + */ + @Generated + public static final VectorStoreFileErrorCode UNSUPPORTED_FILE = fromString("unsupported_file"); + + /** + * The file is invalid. + */ + @Generated + public static final VectorStoreFileErrorCode INVALID_FILE = fromString("invalid_file"); } diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/resources/META-INF/azure-ai-openai-assistants_apiview_properties.json b/sdk/openai/azure-ai-openai-assistants/src/main/resources/META-INF/azure-ai-openai-assistants_apiview_properties.json index a86dad23ca77c..5e204d9ef5e56 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/resources/META-INF/azure-ai-openai-assistants_apiview_properties.json +++ b/sdk/openai/azure-ai-openai-assistants/src/main/resources/META-INF/azure-ai-openai-assistants_apiview_properties.json @@ -185,7 +185,12 @@ "com.azure.ai.openai.assistants.models.AssistantThread": "Azure.AI.OpenAI.Assistants.AssistantThread", "com.azure.ai.openai.assistants.models.AssistantThreadCreationOptions": "Azure.AI.OpenAI.Assistants.AssistantThreadCreationOptions", "com.azure.ai.openai.assistants.models.AssistantsApiResponseFormat": "Azure.AI.OpenAI.Assistants.AssistantsApiResponseFormat", + "com.azure.ai.openai.assistants.models.AssistantsApiResponseFormatJsonObject": "Azure.AI.OpenAI.Assistants.AssistantsApiResponseFormatJsonObject", + "com.azure.ai.openai.assistants.models.AssistantsApiResponseFormatJsonSchema": "Azure.AI.OpenAI.Assistants.AssistantsApiResponseFormatJsonSchema", + "com.azure.ai.openai.assistants.models.AssistantsApiResponseFormatJsonSchemaJsonSchema": "Azure.AI.OpenAI.Assistants.AssistantsApiResponseFormatJsonSchema.jsonSchema.anonymous", "com.azure.ai.openai.assistants.models.AssistantsApiResponseFormatMode": "Azure.AI.OpenAI.Assistants.AssistantsApiResponseFormatMode", + "com.azure.ai.openai.assistants.models.AssistantsApiResponseFormatText": "Azure.AI.OpenAI.Assistants.AssistantsApiResponseFormatText", + "com.azure.ai.openai.assistants.models.AssistantsApiResponseFormatType": null, "com.azure.ai.openai.assistants.models.AssistantsApiToolChoiceOptionMode": "Azure.AI.OpenAI.Assistants.AssistantsApiToolChoiceOptionMode", "com.azure.ai.openai.assistants.models.AssistantsNamedToolChoice": "Azure.AI.OpenAI.Assistants.AssistantsNamedToolChoice", "com.azure.ai.openai.assistants.models.AssistantsNamedToolChoiceType": "Azure.AI.OpenAI.Assistants.AssistantsNamedToolChoiceType", @@ -201,6 +206,8 @@ "com.azure.ai.openai.assistants.models.FileDeletionStatus": "Azure.AI.OpenAI.Assistants.FileDeletionStatus", "com.azure.ai.openai.assistants.models.FileDetails": null, "com.azure.ai.openai.assistants.models.FilePurpose": "Azure.AI.OpenAI.Assistants.FilePurpose", + "com.azure.ai.openai.assistants.models.FileSearchToolCallResult": "Azure.AI.OpenAI.Assistants.FileSearchToolCallResult", + "com.azure.ai.openai.assistants.models.FileSearchToolCallResultContentItem": "Azure.AI.OpenAI.Assistants.FileSearchToolCallResultContentItem", "com.azure.ai.openai.assistants.models.FileSearchToolDefinition": "Azure.AI.OpenAI.Assistants.FileSearchToolDefinition", "com.azure.ai.openai.assistants.models.FileSearchToolDefinitionDetails": "Azure.AI.OpenAI.Assistants.FileSearchToolDefinitionDetails", "com.azure.ai.openai.assistants.models.FileSearchToolResource": "Azure.AI.OpenAI.Assistants.FileSearchToolResource", @@ -245,6 +252,7 @@ "com.azure.ai.openai.assistants.models.RequiredToolCall": "Azure.AI.OpenAI.Assistants.RequiredToolCall", "com.azure.ai.openai.assistants.models.RunCompletionUsage": "Azure.AI.OpenAI.Assistants.RunCompletionUsage", "com.azure.ai.openai.assistants.models.RunError": "Azure.AI.OpenAI.Assistants.RunError", + "com.azure.ai.openai.assistants.models.RunIncludes": "Azure.AI.OpenAI.Assistants.RunIncludes", "com.azure.ai.openai.assistants.models.RunStatus": "Azure.AI.OpenAI.Assistants.RunStatus", "com.azure.ai.openai.assistants.models.RunStep": "Azure.AI.OpenAI.Assistants.RunStep", "com.azure.ai.openai.assistants.models.RunStepCodeInterpreterImageOutput": "Azure.AI.OpenAI.Assistants.RunStepCodeInterpreterImageOutput", diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CancelAVectorStoreFileBatchThisAttemptsToCancelTheProcessingOfFilesInThisBatchAsSoonAsPossible.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CancelAVectorStoreFileBatchThisAttemptsToCancelTheProcessingOfFilesInThisBatchAsSoonAsPossible.java new file mode 100644 index 0000000000000..b7a57f14db484 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CancelAVectorStoreFileBatchThisAttemptsToCancelTheProcessingOfFilesInThisBatchAsSoonAsPossible.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.VectorStoreFileBatch; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CancelAVectorStoreFileBatchThisAttemptsToCancelTheProcessingOfFilesInThisBatchAsSoonAsPossible { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.cancelvectorstorefilebatch.cancelavectorstorefilebatchthisattemptstocanceltheprocessingoffilesinthisbatchassoonaspossible + VectorStoreFileBatch response = assistantsClient.cancelVectorStoreFileBatch("vs_abc123", "vsfb_abc123"); + // END:com.azure.ai.openai.assistants.generated.cancelvectorstorefilebatch.cancelavectorstorefilebatchthisattemptstocanceltheprocessingoffilesinthisbatchassoonaspossible + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CancelsARunThatIsInProgress.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CancelsARunThatIsInProgress.java new file mode 100644 index 0000000000000..133da7e1ae915 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CancelsARunThatIsInProgress.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.ThreadRun; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CancelsARunThatIsInProgress { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.cancelrun.cancelsarunthatisinprogress + ThreadRun response = assistantsClient.cancelRun("thread_abc123", "run_abc123"); + // END:com.azure.ai.openai.assistants.generated.cancelrun.cancelsarunthatisinprogress + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAMessage.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAMessage.java new file mode 100644 index 0000000000000..a09889b6e38db --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAMessage.java @@ -0,0 +1,26 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.MessageRole; +import com.azure.ai.openai.assistants.models.ThreadMessage; +import com.azure.ai.openai.assistants.models.ThreadMessageOptions; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CreateAMessage { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.createmessage.createamessage + ThreadMessage response = assistantsClient.createMessage("thread_v7V4csrNOxtNmgcwGg496Smx", + new ThreadMessageOptions(MessageRole.USER, + "What is the cube root of the sum of 12, 14, 1234, 4321, 90000, 123213541223, 443123123124, 5423324234, 234324324234, 653434534545, 200000000, 98237432984, 99999999, 99999999999, 220000000000, 3309587702? Give me the answer rounded to the nearest integer without commas or spaces.")); + // END:com.azure.ai.openai.assistants.generated.createmessage.createamessage + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateARun.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateARun.java new file mode 100644 index 0000000000000..a6d4be5fba783 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateARun.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.CreateRunOptions; +import com.azure.ai.openai.assistants.models.ThreadRun; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CreateARun { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.createrun.createarun + ThreadRun response = assistantsClient.createRun("thread_abc123", null, new CreateRunOptions("asst_abc123")); + // END:com.azure.ai.openai.assistants.generated.createrun.createarun + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAThreadAndRunItInOneRequest.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAThreadAndRunItInOneRequest.java new file mode 100644 index 0000000000000..36cd8460abefb --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAThreadAndRunItInOneRequest.java @@ -0,0 +1,29 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.AssistantThreadCreationOptions; +import com.azure.ai.openai.assistants.models.CreateAndRunThreadOptions; +import com.azure.ai.openai.assistants.models.MessageRole; +import com.azure.ai.openai.assistants.models.ThreadMessageOptions; +import com.azure.ai.openai.assistants.models.ThreadRun; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.util.Arrays; + +public class CreateAThreadAndRunItInOneRequest { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.createthreadandrun.createathreadandrunitinonerequest + ThreadRun response = assistantsClient.createThreadAndRun( + new CreateAndRunThreadOptions("asst_abc123").setThread(new AssistantThreadCreationOptions().setMessages( + Arrays.asList(new ThreadMessageOptions(MessageRole.USER, "Explain deep learning to a 5 year old."))))); + // END:com.azure.ai.openai.assistants.generated.createthreadandrun.createathreadandrunitinonerequest + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAVectorStoreFileBatch.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAVectorStoreFileBatch.java new file mode 100644 index 0000000000000..2ab0ec3b270bc --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAVectorStoreFileBatch.java @@ -0,0 +1,24 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.VectorStoreFileBatch; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.util.Arrays; + +public class CreateAVectorStoreFileBatch { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.createvectorstorefilebatch.createavectorstorefilebatch + VectorStoreFileBatch response = assistantsClient.createVectorStoreFileBatch("vs_abc123", + Arrays.asList("file-abc123", "file-abc456"), null); + // END:com.azure.ai.openai.assistants.generated.createvectorstorefilebatch.createavectorstorefilebatch + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAVectorStoreFileByAttachingAFileToAVectorStore.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAVectorStoreFileByAttachingAFileToAVectorStore.java new file mode 100644 index 0000000000000..9d346a0f63fa6 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAVectorStoreFileByAttachingAFileToAVectorStore.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.VectorStoreFile; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CreateAVectorStoreFileByAttachingAFileToAVectorStore { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.createvectorstorefile.createavectorstorefilebyattachingafiletoavectorstore + VectorStoreFile response = assistantsClient.createVectorStoreFile("vs_abc123", "file-abc123", null); + // END:com.azure.ai.openai.assistants.generated.createvectorstorefile.createavectorstorefilebyattachingafiletoavectorstore + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAnAssistantWithAModelAndInstructions.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAnAssistantWithAModelAndInstructions.java new file mode 100644 index 0000000000000..b79071869a1eb --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreateAnAssistantWithAModelAndInstructions.java @@ -0,0 +1,29 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.Assistant; +import com.azure.ai.openai.assistants.models.AssistantCreationOptions; +import com.azure.ai.openai.assistants.models.CodeInterpreterToolDefinition; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.util.Arrays; + +public class CreateAnAssistantWithAModelAndInstructions { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.createassistant.createanassistantwithamodelandinstructions + Assistant response + = assistantsClient.createAssistant(new AssistantCreationOptions("gpt-4-1106-preview").setName("Math Tutor") + .setInstructions( + "When a customer asks about a specific math problem, use Python to evaluate their query.") + .setTools(Arrays.asList(new CodeInterpreterToolDefinition()))); + // END:com.azure.ai.openai.assistants.generated.createassistant.createanassistantwithamodelandinstructions + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreatesAThread.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreatesAThread.java new file mode 100644 index 0000000000000..d80fe2a35c6b3 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreatesAThread.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.AssistantThread; +import com.azure.ai.openai.assistants.models.AssistantThreadCreationOptions; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CreatesAThread { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.createthread.createsathread + AssistantThread response = assistantsClient.createThread(new AssistantThreadCreationOptions()); + // END:com.azure.ai.openai.assistants.generated.createthread.createsathread + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreatesAVectorStore.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreatesAVectorStore.java new file mode 100644 index 0000000000000..7037c291fdb0d --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/CreatesAVectorStore.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.VectorStore; +import com.azure.ai.openai.assistants.models.VectorStoreOptions; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CreatesAVectorStore { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.createvectorstore.createsavectorstore + VectorStore response = assistantsClient.createVectorStore(new VectorStoreOptions().setName("Support FAQ")); + // END:com.azure.ai.openai.assistants.generated.createvectorstore.createsavectorstore + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeleteAPreviouslyUploadedFile.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeleteAPreviouslyUploadedFile.java new file mode 100644 index 0000000000000..59b068e316e6e --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeleteAPreviouslyUploadedFile.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.FileDeletionStatus; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeleteAPreviouslyUploadedFile { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.deletefile.deleteapreviouslyuploadedfile + FileDeletionStatus response = assistantsClient.deleteFile("assistant-uzdgnx4i8PPe96zgXQ1vJ9W3"); + // END:com.azure.ai.openai.assistants.generated.deletefile.deleteapreviouslyuploadedfile + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeleteAVectorStoreFileThisWillRemoveTheFileFromTheVectorStoreButTheFileItselfWillNotBeDeletedToDeleteTheFileUseTheDeleteFileEndpoint.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeleteAVectorStoreFileThisWillRemoveTheFileFromTheVectorStoreButTheFileItselfWillNotBeDeletedToDeleteTheFileUseTheDeleteFileEndpoint.java new file mode 100644 index 0000000000000..ad543b33b9112 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeleteAVectorStoreFileThisWillRemoveTheFileFromTheVectorStoreButTheFileItselfWillNotBeDeletedToDeleteTheFileUseTheDeleteFileEndpoint.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.VectorStoreFileDeletionStatus; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeleteAVectorStoreFileThisWillRemoveTheFileFromTheVectorStoreButTheFileItselfWillNotBeDeletedToDeleteTheFileUseTheDeleteFileEndpoint { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.deletevectorstorefile.deleteavectorstorefilethiswillremovethefilefromthevectorstorebutthefileitselfwillnotbedeletedtodeletethefileusethedeletefileendpoint + VectorStoreFileDeletionStatus response = assistantsClient.deleteVectorStoreFile("vs_abc123", "file_abc123"); + // END:com.azure.ai.openai.assistants.generated.deletevectorstorefile.deleteavectorstorefilethiswillremovethefilefromthevectorstorebutthefileitselfwillnotbedeletedtodeletethefileusethedeletefileendpoint + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeletesAThread.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeletesAThread.java new file mode 100644 index 0000000000000..76434d3fedb93 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeletesAThread.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.ThreadDeletionStatus; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeletesAThread { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.deletethread.deletesathread + ThreadDeletionStatus response = assistantsClient.deleteThread("thread_v7V4csrNOxtNmgcwGg496Smx"); + // END:com.azure.ai.openai.assistants.generated.deletethread.deletesathread + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeletesAVectorStore.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeletesAVectorStore.java new file mode 100644 index 0000000000000..7951dd59f9bfd --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeletesAVectorStore.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.VectorStoreDeletionStatus; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeletesAVectorStore { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.deletevectorstore.deletesavectorstore + VectorStoreDeletionStatus response = assistantsClient.deleteVectorStore("vs_abc123 "); + // END:com.azure.ai.openai.assistants.generated.deletevectorstore.deletesavectorstore + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeletesAnAssistant.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeletesAnAssistant.java new file mode 100644 index 0000000000000..44b25ee4711c8 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/DeletesAnAssistant.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.AssistantDeletionStatus; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeletesAnAssistant { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.deleteassistant.deletesanassistant + AssistantDeletionStatus response = assistantsClient.deleteAssistant("asst_4nsG2qgNzimRPE7MazXTXbU7"); + // END:com.azure.ai.openai.assistants.generated.deleteassistant.deletesanassistant + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/GetsARun.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/GetsARun.java new file mode 100644 index 0000000000000..37a94f2927bc5 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/GetsARun.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.ThreadRun; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetsARun { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.getrun.getsarun + ThreadRun response = assistantsClient.getRun("thread_eRNwflE3ncDYak1np6MdMHJh", "run_HsO8tYM4K5AAMAHgK0J3om8Q"); + // END:com.azure.ai.openai.assistants.generated.getrun.getsarun + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ListMessages.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ListMessages.java new file mode 100644 index 0000000000000..776d00bb2f8b2 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ListMessages.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfThreadMessage; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListMessages { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.listmessages.listmessages + OpenAIPageableListOfThreadMessage response + = assistantsClient.listMessages("thread_abc123", null, null, null, null, null); + // END:com.azure.ai.openai.assistants.generated.listmessages.listmessages + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifiesARun.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifiesARun.java new file mode 100644 index 0000000000000..a79393624b26d --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifiesARun.java @@ -0,0 +1,36 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.ThreadRun; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.util.HashMap; +import java.util.Map; + +public class ModifiesARun { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.updaterun.modifiesarun + ThreadRun response = assistantsClient.updateRun("thread_abc123", "run_abc123", mapOf("user_id", "user_abc123")); + // END:com.azure.ai.openai.assistants.generated.updaterun.modifiesarun + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifiesAThread.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifiesAThread.java new file mode 100644 index 0000000000000..ae0016c6c2f26 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifiesAThread.java @@ -0,0 +1,38 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.AssistantThread; +import com.azure.ai.openai.assistants.models.UpdateAssistantThreadOptions; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.util.HashMap; +import java.util.Map; + +public class ModifiesAThread { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.updatethread.modifiesathread + AssistantThread response = assistantsClient.updateThread("thread_v7V4csrNOxtNmgcwGg496Smx", + new UpdateAssistantThreadOptions().setMetadata(mapOf("modified", "true", "user", "abc123"))); + // END:com.azure.ai.openai.assistants.generated.updatethread.modifiesathread + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifiesAVectorStore.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifiesAVectorStore.java new file mode 100644 index 0000000000000..f465d71c0ad38 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifiesAVectorStore.java @@ -0,0 +1,24 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.VectorStore; +import com.azure.ai.openai.assistants.models.VectorStoreUpdateOptions; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ModifiesAVectorStore { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.modifyvectorstore.modifiesavectorstore + VectorStore response + = assistantsClient.modifyVectorStore("vs_abc123", new VectorStoreUpdateOptions().setName("Support FAQ")); + // END:com.azure.ai.openai.assistants.generated.modifyvectorstore.modifiesavectorstore + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifiesAnAssistant.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifiesAnAssistant.java new file mode 100644 index 0000000000000..d7c74bdb207d3 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifiesAnAssistant.java @@ -0,0 +1,29 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.Assistant; +import com.azure.ai.openai.assistants.models.FileSearchToolDefinition; +import com.azure.ai.openai.assistants.models.UpdateAssistantOptions; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.util.Arrays; + +public class ModifiesAnAssistant { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.updateassistant.modifiesanassistant + Assistant response = assistantsClient.updateAssistant("asst_abc123", new UpdateAssistantOptions() + .setModel("gpt-4-turbo") + .setInstructions( + "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.") + .setTools(Arrays.asList(new FileSearchToolDefinition()))); + // END:com.azure.ai.openai.assistants.generated.updateassistant.modifiesanassistant + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifyAMessage.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifyAMessage.java new file mode 100644 index 0000000000000..f50b72f282f25 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ModifyAMessage.java @@ -0,0 +1,37 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.ThreadMessage; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.util.HashMap; +import java.util.Map; + +public class ModifyAMessage { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.updatemessage.modifyamessage + ThreadMessage response = assistantsClient.updateMessage("thread_abc123", "msg_abc123 ", + mapOf("modified", "true", "user", "abc123")); + // END:com.azure.ai.openai.assistants.generated.updatemessage.modifyamessage + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrieveAMessage.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrieveAMessage.java new file mode 100644 index 0000000000000..c87efdf7487d3 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrieveAMessage.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.ThreadMessage; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class RetrieveAMessage { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.getmessage.retrieveamessage + ThreadMessage response + = assistantsClient.getMessage("thread_v7V4csrNOxtNmgcwGg496Smx", "msg_as3XIk1tpVP3hdHjWBGg3uG4"); + // END:com.azure.ai.openai.assistants.generated.getmessage.retrieveamessage + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesARunStep.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesARunStep.java new file mode 100644 index 0000000000000..6baabfdac5d8a --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesARunStep.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.RunStep; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class RetrievesARunStep { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.getrunstep.retrievesarunstep + RunStep response = assistantsClient.getRunStep("thread_eRNwflE3ncDYak1np6MdMHJh", + "run_HsO8tYM4K5AAMAHgK0J3om8Q", "step_abc123", null); + // END:com.azure.ai.openai.assistants.generated.getrunstep.retrievesarunstep + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAThread.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAThread.java new file mode 100644 index 0000000000000..039ba8557ec1c --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAThread.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.AssistantThread; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class RetrievesAThread { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.getthread.retrievesathread + AssistantThread response = assistantsClient.getThread("thread_v7V4csrNOxtNmgcwGg496Smx"); + // END:com.azure.ai.openai.assistants.generated.getthread.retrievesathread + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAVectorStore.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAVectorStore.java new file mode 100644 index 0000000000000..517cfde1c80b3 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAVectorStore.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.VectorStore; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class RetrievesAVectorStore { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.getvectorstore.retrievesavectorstore + VectorStore response = assistantsClient.getVectorStore("vs_abc123"); + // END:com.azure.ai.openai.assistants.generated.getvectorstore.retrievesavectorstore + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAVectorStoreFile.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAVectorStoreFile.java new file mode 100644 index 0000000000000..b3f999246a055 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAVectorStoreFile.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.VectorStoreFile; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class RetrievesAVectorStoreFile { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.getvectorstorefile.retrievesavectorstorefile + VectorStoreFile response = assistantsClient.getVectorStoreFile("vs_abc123", "file-abc123"); + // END:com.azure.ai.openai.assistants.generated.getvectorstorefile.retrievesavectorstorefile + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAVectorStoreFileBatch.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAVectorStoreFileBatch.java new file mode 100644 index 0000000000000..3e13bcb43c113 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAVectorStoreFileBatch.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.VectorStoreFileBatch; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class RetrievesAVectorStoreFileBatch { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.getvectorstorefilebatch.retrievesavectorstorefilebatch + VectorStoreFileBatch response = assistantsClient.getVectorStoreFileBatch("vs_abc123", "vsfb_abc123"); + // END:com.azure.ai.openai.assistants.generated.getvectorstorefilebatch.retrievesavectorstorefilebatch + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAnAssistant.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAnAssistant.java new file mode 100644 index 0000000000000..1e81ce5be4af9 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/RetrievesAnAssistant.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.Assistant; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class RetrievesAnAssistant { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.getassistant.retrievesanassistant + Assistant response = assistantsClient.getAssistant("asst_abc123"); + // END:com.azure.ai.openai.assistants.generated.getassistant.retrievesanassistant + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAFile.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAFile.java new file mode 100644 index 0000000000000..1b28b57eed034 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAFile.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.OpenAIFile; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ReturnsAFile { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.getfile.returnsafile + OpenAIFile response = assistantsClient.getFile("assistant-uzdgnx4i8PPe96zgXQ1vJ9W3"); + // END:com.azure.ai.openai.assistants.generated.getfile.returnsafile + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfAssistants.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfAssistants.java new file mode 100644 index 0000000000000..921322e68ce94 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfAssistants.java @@ -0,0 +1,24 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfAssistant; +import com.azure.ai.openai.assistants.models.ListSortOrder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ReturnsAListOfAssistants { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.listassistants.returnsalistofassistants + OpenAIPageableListOfAssistant response + = assistantsClient.listAssistants(20, ListSortOrder.DESCENDING, null, null); + // END:com.azure.ai.openai.assistants.generated.listassistants.returnsalistofassistants + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfFilesFilteredByPurpose.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfFilesFilteredByPurpose.java new file mode 100644 index 0000000000000..efbcfd1b3a0c2 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfFilesFilteredByPurpose.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.implementation.models.FileListResponse; +import com.azure.ai.openai.assistants.models.FilePurpose; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ReturnsAListOfFilesFilteredByPurpose { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.listfiles.returnsalistoffilesfilteredbypurpose + FileListResponse response = assistantsClient.listFiles(FilePurpose.ASSISTANTS); + // END:com.azure.ai.openai.assistants.generated.listfiles.returnsalistoffilesfilteredbypurpose + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfRunStepsBelongingToARun.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfRunStepsBelongingToARun.java new file mode 100644 index 0000000000000..059d1bb361498 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfRunStepsBelongingToARun.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfRunStep; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ReturnsAListOfRunStepsBelongingToARun { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.listrunsteps.returnsalistofrunstepsbelongingtoarun + OpenAIPageableListOfRunStep response + = assistantsClient.listRunSteps("thread_abc123", "run_abc123", null, null, null, null, null); + // END:com.azure.ai.openai.assistants.generated.listrunsteps.returnsalistofrunstepsbelongingtoarun + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfRunsBelongingToAThread.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfRunsBelongingToAThread.java new file mode 100644 index 0000000000000..e71d3d3b2977f --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfRunsBelongingToAThread.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfThreadRun; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ReturnsAListOfRunsBelongingToAThread { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.listruns.returnsalistofrunsbelongingtoathread + OpenAIPageableListOfThreadRun response = assistantsClient.listRuns("thread_abc123", null, null, null, null); + // END:com.azure.ai.openai.assistants.generated.listruns.returnsalistofrunsbelongingtoathread + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfVectorStoreFiles.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfVectorStoreFiles.java new file mode 100644 index 0000000000000..7f384d7270d4a --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfVectorStoreFiles.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfVectorStoreFile; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ReturnsAListOfVectorStoreFiles { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.listvectorstorefiles.returnsalistofvectorstorefiles + OpenAIPageableListOfVectorStoreFile response + = assistantsClient.listVectorStoreFiles("vs_abc123", null, null, null, null, null); + // END:com.azure.ai.openai.assistants.generated.listvectorstorefiles.returnsalistofvectorstorefiles + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfVectorStoreFilesOfAGivenBatch.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfVectorStoreFilesOfAGivenBatch.java new file mode 100644 index 0000000000000..4265789d2d2ee --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfVectorStoreFilesOfAGivenBatch.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfVectorStoreFile; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ReturnsAListOfVectorStoreFilesOfAGivenBatch { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.listvectorstorefilebatchfiles.returnsalistofvectorstorefilesofagivenbatch + OpenAIPageableListOfVectorStoreFile response + = assistantsClient.listVectorStoreFileBatchFiles("vs_abc123", "batch-abc123", null, null, null, null, null); + // END:com.azure.ai.openai.assistants.generated.listvectorstorefilebatchfiles.returnsalistofvectorstorefilesofagivenbatch + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfVectorStores.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfVectorStores.java new file mode 100644 index 0000000000000..f7474486aef9b --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsAListOfVectorStores.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.implementation.models.OpenAIPageableListOfVectorStore; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ReturnsAListOfVectorStores { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.listvectorstores.returnsalistofvectorstores + OpenAIPageableListOfVectorStore response = assistantsClient.listVectorStores(null, null, null, null); + // END:com.azure.ai.openai.assistants.generated.listvectorstores.returnsalistofvectorstores + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsTheContentOfAFile.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsTheContentOfAFile.java new file mode 100644 index 0000000000000..b808fecb87c42 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/ReturnsTheContentOfAFile.java @@ -0,0 +1,21 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ReturnsTheContentOfAFile { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.getfilecontent.returnsthecontentofafile + byte[] response = assistantsClient.getFileContent("assistant-uzdgnx4i8PPe96zgXQ1vJ9W3"); + // END:com.azure.ai.openai.assistants.generated.getfilecontent.returnsthecontentofafile + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/UploadsAFile.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/UploadsAFile.java new file mode 100644 index 0000000000000..c2edfac030065 --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/UploadsAFile.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.OpenAIFile; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class UploadsAFile { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.uploadfile.uploadsafile + OpenAIFile response = assistantsClient.uploadFile(null, null, null); + // END:com.azure.ai.openai.assistants.generated.uploadfile.uploadsafile + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/WhenARunHasTheStatusRequiresActionAndRequiredActionTypeIsSubmitToolOutputsThisEndpointCanBeUsedToSubmitTheOutputsFromTheToolCallsOnceTheyReAllCompletedAllOutputsMustBeSubmittedInASingleRequest.java b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/WhenARunHasTheStatusRequiresActionAndRequiredActionTypeIsSubmitToolOutputsThisEndpointCanBeUsedToSubmitTheOutputsFromTheToolCallsOnceTheyReAllCompletedAllOutputsMustBeSubmittedInASingleRequest.java new file mode 100644 index 0000000000000..f1fbff18fab9a --- /dev/null +++ b/sdk/openai/azure-ai-openai-assistants/src/samples/java/com/azure/ai/openai/assistants/generated/WhenARunHasTheStatusRequiresActionAndRequiredActionTypeIsSubmitToolOutputsThisEndpointCanBeUsedToSubmitTheOutputsFromTheToolCallsOnceTheyReAllCompletedAllOutputsMustBeSubmittedInASingleRequest.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.ai.openai.assistants.AssistantsClient; +import com.azure.ai.openai.assistants.AssistantsClientBuilder; +import com.azure.ai.openai.assistants.models.ThreadRun; +import com.azure.ai.openai.assistants.models.ToolOutput; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.util.Arrays; + +public class WhenARunHasTheStatusRequiresActionAndRequiredActionTypeIsSubmitToolOutputsThisEndpointCanBeUsedToSubmitTheOutputsFromTheToolCallsOnceTheyReAllCompletedAllOutputsMustBeSubmittedInASingleRequest { + public static void main(String[] args) { + AssistantsClient assistantsClient + = new AssistantsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("{endpoint}") + .buildClient(); + // BEGIN:com.azure.ai.openai.assistants.generated.submittooloutputstorun.whenarunhasthestatusrequiresactionandrequiredactiontypeissubmittooloutputsthisendpointcanbeusedtosubmittheoutputsfromthetoolcallsoncetheyreallcompletedalloutputsmustbesubmittedinasinglerequest + ThreadRun response = assistantsClient.submitToolOutputsToRun("thread_123", "run_123", + Arrays.asList(new ToolOutput().setToolCallId("call_001").setOutput("70 degrees and sunny.")), null); + // END:com.azure.ai.openai.assistants.generated.submittooloutputstorun.whenarunhasthestatusrequiresactionandrequiredactiontypeissubmittooloutputsthisendpointcanbeusedtosubmittheoutputsfromthetoolcallsoncetheyreallcompletedalloutputsmustbesubmittedinasinglerequest + } +} diff --git a/sdk/openai/azure-ai-openai-assistants/tsp-location.yaml b/sdk/openai/azure-ai-openai-assistants/tsp-location.yaml index c6f8abad06419..6aa97fe7f0c11 100644 --- a/sdk/openai/azure-ai-openai-assistants/tsp-location.yaml +++ b/sdk/openai/azure-ai-openai-assistants/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/ai/OpenAI.Assistants -commit: cd41ba31a6af51dae34b0a5930eeb2e77a04b481 +commit: f1ff60664410e0d62b52a90251dddf5c8af5238b repo: Azure/azure-rest-api-specs +additionalDirectories: