export interface LLMConnectionConfig {
  baseUrl: string;
  apiKey?: string | null;
}

export function normalizeLlmBaseUrl(baseUrl: string): string {
  return baseUrl.replace(/\/+$/, "");
}

export function buildModelsUrl(baseUrl: string): string {
  return `${normalizeLlmBaseUrl(baseUrl)}/models`;
}

export function buildChatCompletionsUrl(baseUrl: string): string {
  return `${normalizeLlmBaseUrl(baseUrl)}/chat/completions`;
}

