Skip to content

Supporting fetch and httpAgent in ClientOptions #288

Open
@huytool157

Description

@huytool157

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:js sdkIssue/PR related to JavaScript SDKstatus:triagedIssue/PR triaged to the corresponding sub-teamtype:feature requestNew feature request/enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions