Skip to content

Commit

Permalink
CodeGen from PR 32256 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge a655eafb4e101c071842ac89f41826847d0905ac into 9bc885271d3ad4d4d5697d221e7d25a80d09779d
  • Loading branch information
SDKAuto committed Jan 22, 2025
1 parent c939638 commit f801392
Show file tree
Hide file tree
Showing 62 changed files with 2,209 additions and 282 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -1825,29 +1827,6 @@ public Flux<StreamUpdate> 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<RunStep> 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.
*
Expand Down Expand Up @@ -2381,30 +2360,6 @@ public Mono<ThreadMessage> 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<ThreadRun> 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.
*
Expand Down Expand Up @@ -3919,4 +3874,32 @@ public Mono<VectorStoreFileBatch> 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<RunStep> getRunStep(String threadId, String runId, String stepId, List<RunIncludes> 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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

/**
Expand Down Expand Up @@ -1851,28 +1853,6 @@ public IterableStream<StreamUpdate> 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.
*
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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<RunIncludes> 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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
}
Loading

0 comments on commit f801392

Please sign in to comment.