Skip to content

Regen from latest TSP to emit listConversations#48411

Open
kaylieee wants to merge 2 commits intomainfrom
kaylieee/feature/add-list-conversation
Open

Regen from latest TSP to emit listConversations#48411
kaylieee wants to merge 2 commits intomainfrom
kaylieee/feature/add-list-conversation

Conversation

@kaylieee
Copy link
Member

This pull request introduces a new feature to the Azure AI Agents SDK, adding support for listing conversations through the ConversationsClient and ConversationsAsyncClient. These clients now provide methods to retrieve all conversations, with optional filtering and pagination, leveraging the OpenAI Java library's Conversation model. The changes also include necessary updates to the client builder and internal plumbing to support the new operations.

New Conversations Listing Feature:

  • Added listConversations operations to both ConversationsClient (sync) and ConversationsAsyncClient (async), returning paginated lists of Conversation objects from the OpenAI Java library. These methods support filtering by limit, order, after, before, agentName, and agentId. [1] [2] [3]

Client and Builder Integration:

  • Registered ConversationsClient and ConversationsAsyncClient with the AgentsClientBuilder, allowing users to easily construct these clients as part of the SDK's standard builder flow.

Internal Implementation:

  • Updated AgentsClientImpl to instantiate and expose a ConversationsImpl object, which is used internally by the new clients to perform the actual operations. [1] [2]

Documentation and Metadata:

  • Updated the CHANGELOG.md to document the addition of the new listConversations operation and its capabilities.

Copilot AI review requested due to automatic review settings March 13, 2026 02:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 ConversationsImpl and exposed it via AgentsClientImpl.
  • Added listConversations APIs on sync/async Conversations clients (including convenience overloads with filter parameters).
  • Registered Conversations clients in AgentsClientBuilder service 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants