fix(audit): fallback the baseUrl properly using || to avoid relative POSTs on empty string
This commit is contained in:
@@ -114,7 +114,7 @@ async function callMinimax(
|
||||
onProgress?: (msg: string) => void,
|
||||
): Promise<string> {
|
||||
onProgress?.('Enviando para MiniMax...');
|
||||
const url = config.baseUrl ?? 'https://api.minimax.chat/v1/chat/completions';
|
||||
const url = config.baseUrl || 'https://api.minimax.chat/v1/chat/completions';
|
||||
const body = {
|
||||
model: config.model,
|
||||
messages: [
|
||||
@@ -146,7 +146,7 @@ async function callOpenRouter(
|
||||
onProgress?: (msg: string) => void,
|
||||
): Promise<string> {
|
||||
onProgress?.('Enviando para OpenRouter...');
|
||||
const url = config.baseUrl ?? 'https://openrouter.ai/api/v1/chat/completions';
|
||||
const url = config.baseUrl || 'https://openrouter.ai/api/v1/chat/completions';
|
||||
const body = {
|
||||
model: config.model,
|
||||
messages: [
|
||||
@@ -183,7 +183,7 @@ async function callOllama(
|
||||
onProgress?: (msg: string) => void,
|
||||
): Promise<string> {
|
||||
onProgress?.('Enviando para Ollama (local)...');
|
||||
const baseUrl = config.baseUrl ?? 'http://localhost:11434';
|
||||
const baseUrl = config.baseUrl || 'http://localhost:11434';
|
||||
const body = {
|
||||
model: config.model,
|
||||
messages: [
|
||||
|
||||
Reference in New Issue
Block a user