refactor: trim provider internal exports

This commit is contained in:
Peter Steinberger
2026-05-01 15:16:02 +01:00
parent c2ffe77926
commit 05f607c149
4 changed files with 9 additions and 11 deletions

View File

@@ -294,7 +294,7 @@ function parseDirectiveToken(ctx: SpeechDirectiveTokenParseContext) {
}
}
export async function listElevenLabsVoices(params: {
async function listElevenLabsVoices(params: {
apiKey: string;
baseUrl?: string;
}): Promise<SpeechVoiceOption[]> {

View File

@@ -53,7 +53,7 @@ export function execAz(args: string[]): string {
);
}
export async function execAzAsync(args: string[]): Promise<string> {
async function execAzAsync(args: string[]): Promise<string> {
return await new Promise<string>((resolve, reject) => {
execFile(
"az",

View File

@@ -30,7 +30,7 @@ import {
export { listSubscriptions } from "./cli.js";
export function listFoundryResources(subscriptionId?: string): FoundryResourceOption[] {
function listFoundryResources(subscriptionId?: string): FoundryResourceOption[] {
try {
const accounts = JSON.parse(
execAz([
@@ -121,7 +121,7 @@ export function listResourceDeployments(
}
}
export function buildCreateFoundryHint(selectedSub: AzAccount): string {
function buildCreateFoundryHint(selectedSub: AzAccount): string {
return [
`No Azure AI Foundry or Azure OpenAI resources were found in subscription ${selectedSub.name} (${selectedSub.id}).`,
"Create one in Azure AI Foundry or Azure Portal, then rerun onboard.",
@@ -341,9 +341,7 @@ export function buildFoundryConnectionTest(params: {
};
}
export function extractTenantSuggestions(
rawMessage: string,
): Array<{ id: string; label?: string }> {
function extractTenantSuggestions(rawMessage: string): Array<{ id: string; label?: string }> {
const suggestions: Array<{ id: string; label?: string }> = [];
const seen = new Set<string>();
const regex = /([0-9a-fA-F-]{36})(?:\s+'([^'\r\n]+)')?/g;

View File

@@ -114,7 +114,7 @@ type FoundryConfigShape = {
};
};
export function normalizeFoundryModelName(value?: string | null): string | undefined {
function normalizeFoundryModelName(value?: string | null): string | undefined {
const trimmed = normalizeLowercaseStringOrEmpty(value);
return trimmed || undefined;
}
@@ -181,7 +181,7 @@ export function normalizeFoundryEndpoint(endpoint: string): string {
}
}
export function buildFoundryV1BaseUrl(endpoint: string): string {
function buildFoundryV1BaseUrl(endpoint: string): string {
const base = normalizeFoundryEndpoint(endpoint);
return base.endsWith("/openai/v1") ? base : `${base}/openai/v1`;
}
@@ -218,7 +218,7 @@ export function extractFoundryEndpoint(baseUrl: string | null | undefined): stri
}
}
export function buildFoundryModelCompat(
function buildFoundryModelCompat(
modelId: string,
modelNameHint?: string | null,
configuredApi?: ModelApi | null,
@@ -267,7 +267,7 @@ export function resolveConfiguredModelNameHint(
return trimmedId ? trimmedId : undefined;
}
export function buildFoundryProviderConfig(
function buildFoundryProviderConfig(
endpoint: string,
modelId: string,
modelNameHint?: string | null,