generative-ai-js icon indicating copy to clipboard operation
generative-ai-js copied to clipboard

Supporting `fetch` and `httpAgent` in `ClientOptions`

Open huytool157 opened this issue 1 year ago • 2 comments

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

huytool157 avatar Oct 31 '24 17:10 huytool157

hey @huytool157 is the issue still open ? can You assign this to me

akhileshdasari2004 avatar Mar 07 '25 14:03 akhileshdasari2004

Because of the arrogance of the Google team, they will not support this feature

wujohns avatar Apr 08 '25 10:04 wujohns