You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the Assistance.ts module in app/server/lib handles API calls to external LLM endpoints (e.g., for the Assistant feature). However, these calls do not leverage the existing proxyAgent utility, which limits the flexibility for self-hosted deployments behind proxies.
Describe the solution you would like
Integrate the proxyAgent utility in Assistance.ts to enable proxy support for API calls. This would align the behavior of Assistance.ts with other modules like Requests.ts, Triggers.ts, and WidgetRepository.ts, which already implement proxy support.
Implementation Details
File to update: app/server/lib/Assistance.ts
Import the proxyAgent utility from app/server/lib/ProxyAgent.
Update the fetch implementation in Assistance.ts to include the agent option using proxyAgent.
`import fetch from 'node-fetch';
import { proxyAgent } from './ProxyAgent';
Describe the problem to be solved
Currently, the Assistance.ts module in app/server/lib handles API calls to external LLM endpoints (e.g., for the Assistant feature). However, these calls do not leverage the existing proxyAgent utility, which limits the flexibility for self-hosted deployments behind proxies.
Describe the solution you would like
Integrate the proxyAgent utility in Assistance.ts to enable proxy support for API calls. This would align the behavior of Assistance.ts with other modules like Requests.ts, Triggers.ts, and WidgetRepository.ts, which already implement proxy support.
Implementation Details
File to update: app/server/lib/Assistance.ts
Import the proxyAgent utility from app/server/lib/ProxyAgent.
Update the fetch implementation in Assistance.ts to include the agent option using proxyAgent.
`import fetch from 'node-fetch';
import { proxyAgent } from './ProxyAgent';
const GRIST_HTTPS_PROXY = process.env.GRIST_HTTPS_PROXY;
export const DEPS = {
fetch: async (url: string, options: any = {}) => {
const agent = GRIST_HTTPS_PROXY ? proxyAgent(new URL(url)) : undefined;
return fetch(url, { ...options, agent });
},
delayTime: 1000,
};
`
The functionality will only activate if the GRIST_HTTPS_PROXY environment variable is set.
The text was updated successfully, but these errors were encountered: