Hello Tam Thai Hoang Minh,
Thank you for posting your question in the Microsoft Q&A forum.
The Bing Grounding tool in Azure AI Agents currently presents a limitation where only five search results are returned by default, which can negatively impact the agent's ability to provide comprehensive responses. While this restriction isn't configurable through the Azure AI Studio interface, developers can programmatically adjust the result count using the TypeScript/JavaScript SDK.
To increase the number of search results, you must explicitly configure the Bing Grounding tool during initialization or query execution. The solution involves setting either the count or maxResults parameter to your desired value (e.g., 15) when instantiating the tool or when making API calls. This approach provides greater control over search result retrieval, though developers should be mindful of potential trade-offs, including increased latency and higher API consumption.
Key considerations when implementing this solution include:
- API Limits: Verify that your Bing Search API tier supports the requested number of results
- Error Handling: Implement robust fallback mechanisms for cases where fewer results are returned
- Performance Optimization: Consider caching strategies to minimize repeated API calls
Microsoft's documentation currently lacks explicit guidance on this parameter for TypeScript/JavaScript implementations, but the programmatic approach outlined here effectively addresses the limitation while maintaining compatibility with Azure AI Agents' architecture. As the platform evolves, additional configuration options may become available through the UI, but for now, SDK-based configuration remains the most reliable method for customizing search result volume.
If the above answer helped, please do not forget to "Accept Answer" as this may help other community members to refer the info if facing a similar issue. Your contribution to the Microsoft Q&A community is highly appreciated.