Skip to content
Open
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 @@ -7,7 +7,9 @@
import com.azure.ai.agents.implementation.OpenAIJsonHelper;
import com.azure.ai.agents.implementation.StreamingUtils;
import com.azure.ai.agents.models.AzureCreateResponseOptions;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
import com.openai.client.OpenAIClientAsync;
import com.openai.core.JsonValue;
import com.openai.models.responses.Response;
Expand Down Expand Up @@ -53,6 +55,7 @@ public ResponseServiceAsync getResponseServiceAsync() {
* @param params The parameters to create the response.
* @return The created Response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response> createAzureResponse(AzureCreateResponseOptions createResponse,
ResponseCreateParams.Builder params) {
Objects.requireNonNull(createResponse, "createResponse cannot be null");
Expand All @@ -71,6 +74,7 @@ public Mono<Response> createAzureResponse(AzureCreateResponseOptions createRespo
* @param params The parameters to create the response.
* @return A {@link Flux} stream of {@link ResponseStreamEvent} items.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createStreamingAzureResponse returns a stream of events via Flux<ResponseStreamEvent>, but it’s annotated as ReturnType.SINGLE. This is inconsistent with the method behavior and may cause incorrect docs/codegen metadata. Please use the appropriate multi-item return type (commonly ReturnType.COLLECTION for reactive streams emitting multiple items).

Suggested change
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.COLLECTION)

Copilot uses AI. Check for mistakes.
public Flux<ResponseStreamEvent> createStreamingAzureResponse(AzureCreateResponseOptions createResponse,
ResponseCreateParams.Builder params) {
Objects.requireNonNull(createResponse, "createResponse cannot be null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import com.azure.ai.agents.implementation.StreamingUtils;
import com.azure.ai.agents.models.AzureCreateResponseOptions;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.ReturnType;
import com.azure.core.util.IterableStream;
import com.openai.client.OpenAIClient;
import com.openai.core.JsonValue;
Expand Down Expand Up @@ -52,6 +54,7 @@ public ResponseService getResponseService() {
* @param params The parameters to create the response.
* @return The created Response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response createAzureResponse(AzureCreateResponseOptions createResponse,
ResponseCreateParams.Builder params) {
Objects.requireNonNull(createResponse, "createResponse cannot be null");
Expand All @@ -70,6 +73,7 @@ public Response createAzureResponse(AzureCreateResponseOptions createResponse,
* @param params The parameters to create the response.
* @return An IterableStream of ResponseStreamEvent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createStreamingAzureResponse returns multiple events via IterableStream<ResponseStreamEvent>, but it’s annotated as ReturnType.SINGLE. This can mislead documentation and tooling that relies on @ServiceMethod. Please change this to the appropriate multi-item return type (typically ReturnType.COLLECTION for IterableStream).

Suggested change
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.COLLECTION)

Copilot uses AI. Check for mistakes.
public IterableStream<ResponseStreamEvent> createStreamingAzureResponse(AzureCreateResponseOptions createResponse,
ResponseCreateParams.Builder params) {
Objects.requireNonNull(createResponse, "createResponse cannot be null");
Expand Down
Loading