googleapis / nodejs-vertexai

Apache License 2.0
112 stars 40 forks source link

Support for proxies please! #396

Open pierznewton-john opened 1 month ago

pierznewton-john commented 1 month ago

Is your feature request related to a problem? Please describe. The library does not work behind a proxy. This is because it uses node's in-built fetch function to post to Vertex, and fetch has no proxy support.

Describe the solution you'd like Please use something other than fetch to call the Vertex and allow for proxy support in some way, such as a proxy config object being passed in to the VertexAI constructor (I have not through through the most appropriate way to configure the proxy settings). Note that GCP CLI supports this, so it seems odd that this library does not. It's critical to our use case so I will need to fork the SDK to be able to use it.

Describe alternatives you've considered There are no alternatives. We can't use the SDK without this feature.

happy-qiao commented 1 month ago

@pierznewton-john Thank you for your feedback on using proxies. To help us prioritize the development of proxy-related features, could you please share more about your specific use case? Understanding how you use proxies—whether for security, performance optimization, bypassing restrictions, or other reasons—will allow us to better align our features with your needs.

pierznewton-john commented 1 month ago

@happy-qiao We are developing an API to extract data from customer documents in a loan application setting inside a major bank. For security reasons, we have to operate from behind the corporate proxy server.

pierznewton-john commented 1 month ago

BTW I am currently working around this issue by monkey-patching the global fetch function and using Axios in my replacement fetch method. Which is clearly butt ugly :(