feat: Allow providing a custom http.Client to the Anthropic plugin for managing HTTP requests#226
feat: Allow providing a custom http.Client to the Anthropic plugin for managing HTTP requests#226pavelgj wants to merge 2 commits into
http.Client to the Anthropic plugin for managing HTTP requests#226Conversation
…for managing HTTP requests
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Anthropic plugin by enabling users to supply their own Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to provide a custom http.Client to the Anthropic plugin. This is a valuable feature for users who need to customize HTTP request behavior, reuse clients for efficiency, or mock HTTP interactions for testing. The implementation is well-executed, correctly passing the custom client through the necessary layers. Crucially, the changes correctly handle the lifecycle of the http.Client, ensuring that user-provided clients are not closed by the plugin. The logic to conditionally close internally created clients, both for the main plugin instance and for temporary request-specific instances, is sound. The necessary dependency on the http package has also been added. Overall, the changes are correct and well-implemented.
| String? apiKey, | ||
| Map<String, String>? headers, | ||
| String? baseUrl, | ||
| http.Client? httpClient, |
There was a problem hiding this comment.
Document the new param? Also be clear that it will be closed w/ the plugin??
No description provided.