Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-ai-openai-assistants] [OpenAI] [Assistants] PR feedback #10283

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3158,4 +3158,34 @@ public Mono<byte[]> getFileContent(String fileId) {
return getFileContentWithResponse(fileId, requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(byte[].class));
}

/**
* Submits outputs from tools as requested by tool calls in a run. Runs that need submitted tool outputs will have a
* status of 'requires_action' with a required_action.type of 'submit_tool_outputs'.
*
* @param threadId The ID of the thread that was run.
* @param runId The ID of the run that requires tool outputs.
* @param toolOutputs The list of tool outputs requested by tool calls from the specified run.
* @param stream If `true`, returns a stream of events that happen during the Run as server-sent events, terminating
* when the Run enters a terminal state with a `data: [DONE]` message.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return data representing a single evaluation run of an assistant thread on successful completion of
* {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ThreadRun> submitToolOutputsToRun(String threadId, String runId, List<ToolOutput> toolOutputs,
Boolean stream) {
// Generated convenience method for submitToolOutputsToRunWithResponse
RequestOptions requestOptions = new RequestOptions();
SubmitToolOutputsToRunRequest requestObj = new SubmitToolOutputsToRunRequest(toolOutputs).setStream(stream);
BinaryData request = BinaryData.fromObject(requestObj);
return submitToolOutputsToRunWithResponse(threadId, runId, request, requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(ThreadRun.class));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3096,4 +3096,33 @@ public byte[] getFileContent(String fileId) {
RequestOptions requestOptions = new RequestOptions();
return getFileContentWithResponse(fileId, requestOptions).getValue().toObject(byte[].class);
}

/**
* Submits outputs from tools as requested by tool calls in a run. Runs that need submitted tool outputs will have a
* status of 'requires_action' with a required_action.type of 'submit_tool_outputs'.
*
* @param threadId The ID of the thread that was run.
* @param runId The ID of the run that requires tool outputs.
* @param toolOutputs The list of tool outputs requested by tool calls from the specified run.
* @param stream If `true`, returns a stream of events that happen during the Run as server-sent events, terminating
* when the Run enters a terminal state with a `data: [DONE]` message.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return data representing a single evaluation run of an assistant thread.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public ThreadRun submitToolOutputsToRun(String threadId, String runId, List<ToolOutput> toolOutputs,
Boolean stream) {
// Generated convenience method for submitToolOutputsToRunWithResponse
RequestOptions requestOptions = new RequestOptions();
SubmitToolOutputsToRunRequest requestObj = new SubmitToolOutputsToRunRequest(toolOutputs).setStream(stream);
BinaryData request = BinaryData.fromObject(requestObj);
return submitToolOutputsToRunWithResponse(threadId, runId, request, requestOptions).getValue()
.toObject(ThreadRun.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ public enum AssistantsServiceVersion implements ServiceVersion {
/**
* Enum value 2024-02-15-preview.
*/
V2024_02_15_PREVIEW("2024-02-15-preview");
V2024_02_15_PREVIEW("2024-02-15-preview"),

/**
* Enum value placeholder-for-future-release.
*/
VPLACEHOLDER_FOR_FUTURE_RELEASE("placeholder-for-future-release");

private final String version;

Expand All @@ -35,6 +40,6 @@ public String getVersion() {
* @return The latest {@link AssistantsServiceVersion}.
*/
public static AssistantsServiceVersion getLatest() {
return V2024_02_15_PREVIEW;
return VPLACEHOLDER_FOR_FUTURE_RELEASE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1991,6 +1991,10 @@ public Response<BinaryData> deleteThreadWithResponse(String threadId, RequestOpt
* object: String (Required)
* created_at: long (Required)
* thread_id: String (Required)
* status: String(in_progress/incomplete/completed) (Required)
* incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed) (Required)
* completed_at: Long (Required)
* incomplete_at: Long (Required)
* role: String(user/assistant) (Required)
* content (Required): [
* (Required){
Expand Down Expand Up @@ -2051,6 +2055,10 @@ public Mono<Response<BinaryData>> createMessageWithResponseAsync(String threadId
* object: String (Required)
* created_at: long (Required)
* thread_id: String (Required)
* status: String(in_progress/incomplete/completed) (Required)
* incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed) (Required)
* completed_at: Long (Required)
* incomplete_at: Long (Required)
* role: String(user/assistant) (Required)
* content (Required): [
* (Required){
Expand Down Expand Up @@ -2114,6 +2122,10 @@ public Response<BinaryData> createMessageWithResponse(String threadId, BinaryDat
* object: String (Required)
* created_at: long (Required)
* thread_id: String (Required)
* status: String(in_progress/incomplete/completed) (Required)
* incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed) (Required)
* completed_at: Long (Required)
* incomplete_at: Long (Required)
* role: String(user/assistant) (Required)
* content (Required): [
* (Required){
Expand Down Expand Up @@ -2182,6 +2194,10 @@ public Mono<Response<BinaryData>> listMessagesWithResponseAsync(String threadId,
* object: String (Required)
* created_at: long (Required)
* thread_id: String (Required)
* status: String(in_progress/incomplete/completed) (Required)
* incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed) (Required)
* completed_at: Long (Required)
* incomplete_at: Long (Required)
* role: String(user/assistant) (Required)
* content (Required): [
* (Required){
Expand Down Expand Up @@ -2228,6 +2244,10 @@ public Response<BinaryData> listMessagesWithResponse(String threadId, RequestOpt
* object: String (Required)
* created_at: long (Required)
* thread_id: String (Required)
* status: String(in_progress/incomplete/completed) (Required)
* incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed) (Required)
* completed_at: Long (Required)
* incomplete_at: Long (Required)
* role: String(user/assistant) (Required)
* content (Required): [
* (Required){
Expand Down Expand Up @@ -2273,6 +2293,10 @@ public Mono<Response<BinaryData>> getMessageWithResponseAsync(String threadId, S
* object: String (Required)
* created_at: long (Required)
* thread_id: String (Required)
* status: String(in_progress/incomplete/completed) (Required)
* incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed) (Required)
* completed_at: Long (Required)
* incomplete_at: Long (Required)
* role: String(user/assistant) (Required)
* content (Required): [
* (Required){
Expand Down Expand Up @@ -2326,6 +2350,10 @@ public Response<BinaryData> getMessageWithResponse(String threadId, String messa
* object: String (Required)
* created_at: long (Required)
* thread_id: String (Required)
* status: String(in_progress/incomplete/completed) (Required)
* incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed) (Required)
* completed_at: Long (Required)
* incomplete_at: Long (Required)
* role: String(user/assistant) (Required)
* content (Required): [
* (Required){
Expand Down Expand Up @@ -2382,6 +2410,10 @@ public Mono<Response<BinaryData>> updateMessageWithResponseAsync(String threadId
* object: String (Required)
* created_at: long (Required)
* thread_id: String (Required)
* status: String(in_progress/incomplete/completed) (Required)
* incomplete_details: String(content_filter/max_tokens/run_cancelled/run_failed) (Required)
* completed_at: Long (Required)
* incomplete_at: Long (Required)
* role: String(user/assistant) (Required)
* content (Required): [
* (Required){
Expand Down Expand Up @@ -2606,6 +2638,7 @@ public Response<BinaryData> getMessageFileWithResponse(String threadId, String m
* type: String (Required)
* }
* ]
* stream: Boolean (Optional)
* metadata (Optional): {
* String: String (Required)
* }
Expand Down Expand Up @@ -2683,6 +2716,7 @@ public Mono<Response<BinaryData>> createRunWithResponseAsync(String threadId, Bi
* type: String (Required)
* }
* ]
* stream: Boolean (Optional)
* metadata (Optional): {
* String: String (Required)
* }
Expand Down Expand Up @@ -3167,6 +3201,7 @@ public Response<BinaryData> updateRunWithResponse(String threadId, String runId,
* output: String (Optional)
* }
* ]
* stream: Boolean (Optional)
* }
* }</pre>
*
Expand Down Expand Up @@ -3240,6 +3275,7 @@ public Mono<Response<BinaryData>> submitToolOutputsToRunWithResponseAsync(String
* output: String (Optional)
* }
* ]
* stream: Boolean (Optional)
* }
* }</pre>
*
Expand Down Expand Up @@ -3443,6 +3479,7 @@ public Response<BinaryData> cancelRunWithResponse(String threadId, String runId,
* type: String (Required)
* }
* ]
* stream: Boolean (Optional)
* metadata (Optional): {
* String: String (Required)
* }
Expand Down Expand Up @@ -3535,6 +3572,7 @@ public Mono<Response<BinaryData>> createThreadAndRunWithResponseAsync(BinaryData
* type: String (Required)
* }
* ]
* stream: Boolean (Optional)
* metadata (Optional): {
* String: String (Required)
* }
Expand Down
Loading