generative-ai-js
generative-ai-js copied to clipboard
Supporting `fetch` and `httpAgent` in `ClientOptions`
Description of the feature request:
OpenAI and Anthropic has these following props inside ClientOptions that Google doesn't
/**
* An HTTP agent used to manage HTTP(S) connections.
*
* If not provided, an agent will be constructed by default in the Node.js environment,
* otherwise no agent is used.
*/
httpAgent?: Agent;
/**
* Specify a custom `fetch` function implementation.
*
* If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
* defined globally.
*/
fetch?: Core.Fetch | undefined;
What problem are you trying to solve with this feature?
Customers want to point to their own proxy agents rather than a plain baseUrl.
Any other information you'd like to share?
This is also better for security as you can use something like ssrf-req-filter to filter out attacks
hey @huytool157 is the issue still open ? can You assign this to me
Because of the arrogance of the Google team, they will not support this feature