Uh oh!
There was an error while loading. Please reload this page.
Configuring aiohttp.web.ClientSession creation for CopilotStudio through ConnectionSettings - #278
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds the ability to configure the underlying aiohttp ClientSession by allowing users to pass custom keyword arguments through the ConnectionSettings. It also adds comprehensive docstrings to several methods in the CopilotClient class.
- Adds a
client_session_kwargsparameter toConnectionSettingsto allow customization of aiohttp's ClientSession - Updates
CopilotClient.post_request()to use the configurable session kwargs - Adds docstrings to
post_request(),start_conversation(),ask_question(), andask_question_with_activity()methods
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| connection_settings.py | Adds client_session_kwargs parameter with default values for optional parameters, includes initialization and documentation |
| copilot_client.py | Updates post_request() to use the new client_session_kwargs and adds comprehensive docstrings to public async methods |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This pull request enhances the flexibility and maintainability of the Copilot Studio client by allowing custom configuration of the underlying HTTP client and improving code documentation. The most significant updates include support for passing custom arguments to the
aiohttp.ClientSession, and the addition of detailed docstrings to key methods for better clarity.Custom client session configuration:
client_session_kwargsto theConnectionSettingsclass, allowing users to pass custom keyword arguments to the underlyingaiohttp.ClientSession(e.g., for timeouts, proxies, etc.). This parameter is stored as an instance variable and defaults to an empty dictionary if not provided. [1][2]CopilotClient.post_requestmethod to use these custom session arguments when creating anaiohttp.ClientSession, increasing flexibility for different networking requirements.Improved documentation:
ConnectionSettings.__init__,CopilotClient.post_request,CopilotClient.start_conversation,CopilotClient.ask_question, andCopilotClient.ask_question_with_activitymethods. These docstrings clarify the purpose, parameters, and return values of each method, making the codebase easier to understand and maintain. [1][2][3][4][5]