-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Description
You can use HttpsProxyAgent to access the proxy in vizchat.ts. PROXY_URL can be configured in the .env file as shown below:
PROXY_URL=import {HttpsProxyAgent} from "https-proxy-agent";
const proxy_url = process.env.PROXY_URL;
const agent= new HttpsProxyAgent(proxy_url)
...
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.OPENAI_KEY}`,
},
agent,
body: JSON.stringify({
model: "gpt-3.5-turbo",
messages: messages,
temperature: TEMPERATURE,
n: 1,
}),
});Metadata
Metadata
Assignees
Labels
No labels