-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add service method annotations #48544
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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; | ||||||
|
|
@@ -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"); | ||||||
|
|
@@ -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) | ||||||
|
||||||
| @ServiceMethod(returns = ReturnType.SINGLE) | |
| @ServiceMethod(returns = ReturnType.COLLECTION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createStreamingAzureResponsereturns a stream of events viaFlux<ResponseStreamEvent>, but it’s annotated asReturnType.SINGLE. This is inconsistent with the method behavior and may cause incorrect docs/codegen metadata. Please use the appropriate multi-item return type (commonlyReturnType.COLLECTIONfor reactive streams emitting multiple items).