No HTTP proxy support
The PineconeClient doesn't expose any of the options by the underlying API client, which means there's no way to configure it to use an HTTP proxy, or more generally control the behavior of the HTTP client, such as keep-alive. This makes it difficult to use in controlled environments.
The generated api client exposes a fetchApi option where you can supply a fetch-compatible implementation, where you could inject such functionality. Unfortunately the native fetch API doesn't support node's Agent interface, so you'd have to swap it out and do some mapping, but at least it's possible. Something like:
import undici, { RequestInit, ProxyAgent } from 'undici'
const dispatcher = new ProxyAgent(process.env.HTTPS_PROXY!)
const configuration = {
environment,
apiKey,
fetch: async (input: string | URL, init?: RequestInit) => {
return undici.fetch(input, { ...init, dispatcher })
}
}
await client.init(configuration)
An example of another API client that I think is generated using the same tooling that you are using, which does support this, is the Adobe Target SDK
@Nevon thanks for the feedback! We'll definitely looking into and look into how we can support use cases like yours.
Hey @Nevon just wanted to chime in and say that this is on my to-do list for the upcoming quarter or two! We haven't forgotten about you :)
Hey all, proxy support is enabled in the client. Now, see the README for instructions.