fix: docker prod env variable fix (#1170)
Some checks are pending
Docker Publish / docker-build-publish (push) Waiting to run
Update Stable Branch / prepare-release (push) Waiting to run

* fix: docker prod env variable fix

* lint and typecheck

* removed hardcoded tag
This commit is contained in:
Anirban Kar
2025-01-25 03:52:26 +05:30
committed by GitHub
parent 5a0489f3c3
commit 660353360f
6 changed files with 63 additions and 20 deletions

View File

@@ -41,11 +41,17 @@ function getProviderInfo(llmManager: LLMManager) {
export async function loader({
request,
params,
context,
}: {
request: Request;
params: { provider?: string };
context: {
cloudflare?: {
env: Record<string, string>;
};
};
}): Promise<Response> {
const llmManager = LLMManager.getInstance(import.meta.env);
const llmManager = LLMManager.getInstance(context.cloudflare?.env);
// Get client side maintained API keys and provider settings from cookies
const cookieHeader = request.headers.get('Cookie');
@@ -63,7 +69,7 @@ export async function loader({
if (provider) {
const staticModels = provider.staticModels;
const dynamicModels = provider.getDynamicModels
? await provider.getDynamicModels(apiKeys, providerSettings, import.meta.env)
? await provider.getDynamicModels(apiKeys, providerSettings, context.cloudflare?.env)
: [];
modelList = [...staticModels, ...dynamicModels];
}
@@ -72,7 +78,7 @@ export async function loader({
modelList = await llmManager.updateModelList({
apiKeys,
providerSettings,
serverEnv: import.meta.env,
serverEnv: context.cloudflare?.env,
});
}