Make Qwen OAuth work on Vercel

This commit is contained in:
Gemini AI
2025-12-26 00:37:05 +04:00
Unverified
parent a1a30e66fe
commit 79204352fe
7 changed files with 255 additions and 270 deletions

View File

@@ -0,0 +1,7 @@
export const DEFAULT_OLLAMA_BASE = process.env.NEXT_PUBLIC_OLLAMA_ENDPOINT || process.env.OLLAMA_ENDPOINT || "https://ollama.com";
export function normalizeOllamaBase(url?: string): string {
if (!url) return DEFAULT_OLLAMA_BASE.replace(/\/$/, "");
const trimmed = url.trim();
if (!trimmed) return DEFAULT_OLLAMA_BASE.replace(/\/$/, "");
return trimmed.replace(/\/$/, "");
}