-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
AI AgentsClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Description
Bug: Missing required query parameter: api-version when calling agentsClient.files.list()
Description
When calling agentsClient.files.list(), the SDK throws a RestError with the message "Missing required query parameter: api-version".
Environment
- Package:
@azure/ai-agents - Version:
1.1.0
Steps to Reproduce
- Create an
AgentsClientinstance:
const agentsClient = new AgentsClient(baseEndpoint, credentials, {
apiVersion: '2025-05-15-preview'
});- Call the client.files.list():
agentsClient.files.list- The request fails with:
RestError: Missing required query parameter: api-version
Workaround
As a temporary workaround, we can manually inject the api-version parameter using a custom pipeline policy:
// Workaround: manually inject api-version parameter via pipeline policy
agentsClient.pipeline.addPolicy(
{
name: 'ApiVersionPolicy',
sendRequest: async (request, next) => {
const url = new URL(request.url);
url.searchParams.delete('api-version');
url.searchParams.set('api-version', apiVersion);
request.url = url.toString();
return next(request);
}
},
{ afterPhase: 'Serialize' }
);
// Now the client works correctly
const files = await agentsClient.files.list();Metadata
Metadata
Assignees
Labels
AI AgentsClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that