Regen from latest TSP to emit listConversations#48411
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR regenerates the azure-ai-agents SDK from the latest TypeSpec (TSP) to add a new listConversations capability surfaced through ConversationsClient and ConversationsAsyncClient, and wires up internal implementation support.
Changes:
- Added generated REST implementation
ConversationsImpland exposed it viaAgentsClientImpl. - Added
listConversationsAPIs on sync/async Conversations clients (including convenience overloads with filter parameters). - Registered Conversations clients in
AgentsClientBuilderservice client list and updated changelog/metadata.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/ai/azure-ai-agents/tsp-location.yaml | Updates the pinned swagger/spec commit used for generation. |
| sdk/ai/azure-ai-agents/src/main/resources/META-INF/azure-ai-agents_metadata.json | Updates generated metadata to include Conversations APIs and new generated files. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/ConversationsImpl.java | New generated REST proxy implementation for GET /openai/v1/conversations. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsClientImpl.java | Adds and initializes ConversationsImpl and exposes it via getConversations(). |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ConversationsClient.java | Adds listConversations APIs and introduces a ConversationsImpl delegate field. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ConversationsAsyncClient.java | Adds async listConversations APIs and introduces a ConversationsImpl delegate field. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClientBuilder.java | Registers Conversations clients in @ServiceClientBuilder(serviceClients=...). |
| sdk/ai/azure-ai-agents/CHANGELOG.md | Documents the new conversations listing feature. |
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
52
to
+59
| @ServiceClientBuilder( | ||
| serviceClients = { | ||
| AgentsClient.class, | ||
| MemoryStoresClient.class, | ||
| ConversationsClient.class, | ||
| AgentsAsyncClient.class, | ||
| MemoryStoresAsyncClient.class }) | ||
| MemoryStoresAsyncClient.class, | ||
| ConversationsAsyncClient.class }) |
Comment on lines
108
to
+115
| return this.memoryStores; | ||
| } | ||
|
|
||
| /** | ||
| * The ConversationsImpl object to access its operations. | ||
| */ | ||
| private final ConversationsImpl conversations; | ||
|
|
Comment on lines
+133
to
+159
| @Generated | ||
| @ServiceMethod(returns = ReturnType.COLLECTION) | ||
| public PagedIterable<Conversation> listConversations(Integer limit, PageOrder order, String after, String before, | ||
| String agentName, String agentId) { | ||
| // Generated convenience method for listConversations | ||
| RequestOptions requestOptions = new RequestOptions(); | ||
| if (limit != null) { | ||
| requestOptions.addQueryParam("limit", String.valueOf(limit), false); | ||
| } | ||
| if (order != null) { | ||
| requestOptions.addQueryParam("order", order.toString(), false); | ||
| } | ||
| if (after != null) { | ||
| requestOptions.addQueryParam("after", after, false); | ||
| } | ||
| if (before != null) { | ||
| requestOptions.addQueryParam("before", before, false); | ||
| } | ||
| if (agentName != null) { | ||
| requestOptions.addQueryParam("agent_name", agentName, false); | ||
| } | ||
| if (agentId != null) { | ||
| requestOptions.addQueryParam("agent_id", agentId, false); | ||
| } | ||
| return serviceClient.listConversations(requestOptions) | ||
| .mapPage(bodyItemValue -> bodyItemValue.toObject(Conversation.class)); | ||
| } |
Comment on lines
+137
to
+173
| @Generated | ||
| @ServiceMethod(returns = ReturnType.COLLECTION) | ||
| public PagedFlux<Conversation> listConversations(Integer limit, PageOrder order, String after, String before, | ||
| String agentName, String agentId) { | ||
| // Generated convenience method for listConversations | ||
| RequestOptions requestOptions = new RequestOptions(); | ||
| if (limit != null) { | ||
| requestOptions.addQueryParam("limit", String.valueOf(limit), false); | ||
| } | ||
| if (order != null) { | ||
| requestOptions.addQueryParam("order", order.toString(), false); | ||
| } | ||
| if (after != null) { | ||
| requestOptions.addQueryParam("after", after, false); | ||
| } | ||
| if (before != null) { | ||
| requestOptions.addQueryParam("before", before, false); | ||
| } | ||
| if (agentName != null) { | ||
| requestOptions.addQueryParam("agent_name", agentName, false); | ||
| } | ||
| if (agentId != null) { | ||
| requestOptions.addQueryParam("agent_id", agentId, false); | ||
| } | ||
| PagedFlux<BinaryData> pagedFluxResponse = listConversations(requestOptions); | ||
| return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { | ||
| Flux<PagedResponse<BinaryData>> flux = (continuationTokenParam == null) | ||
| ? pagedFluxResponse.byPage().take(1) | ||
| : pagedFluxResponse.byPage(continuationTokenParam).take(1); | ||
| return flux.map(pagedResponse -> new PagedResponseBase<Void, Conversation>(pagedResponse.getRequest(), | ||
| pagedResponse.getStatusCode(), pagedResponse.getHeaders(), | ||
| pagedResponse.getValue() | ||
| .stream() | ||
| .map(protocolMethodData -> protocolMethodData.toObject(Conversation.class)) | ||
| .collect(Collectors.toList()), | ||
| pagedResponse.getContinuationToken(), null)); | ||
| }); |
Comment on lines
+49
to
+50
| @Generated | ||
| private final ConversationsImpl serviceClient; |
|
|
||
| /** | ||
| * Initializes a new instance of the synchronous ConversationsClient type. | ||
| * Initializes a new instance of the synchronous AgentsClient type. |
| } | ||
|
|
||
| @Generated | ||
| private final ConversationsImpl serviceClient; |
|
|
||
| /** | ||
| * Initializes a new instance of the asynchronous ConversationsClient type. | ||
| * Initializes a new instance of the asynchronous AgentsClient type. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to the Azure AI Agents SDK, adding support for listing conversations through the
ConversationsClientandConversationsAsyncClient. These clients now provide methods to retrieve all conversations, with optional filtering and pagination, leveraging the OpenAI Java library'sConversationmodel. The changes also include necessary updates to the client builder and internal plumbing to support the new operations.New Conversations Listing Feature:
listConversationsoperations to bothConversationsClient(sync) andConversationsAsyncClient(async), returning paginated lists ofConversationobjects from the OpenAI Java library. These methods support filtering bylimit,order,after,before,agentName, andagentId. [1] [2] [3]Client and Builder Integration:
ConversationsClientandConversationsAsyncClientwith theAgentsClientBuilder, allowing users to easily construct these clients as part of the SDK's standard builder flow.Internal Implementation:
AgentsClientImplto instantiate and expose aConversationsImplobject, which is used internally by the new clients to perform the actual operations. [1] [2]Documentation and Metadata:
CHANGELOG.mdto document the addition of the newlistConversationsoperation and its capabilities.