mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:10:44 +00:00
refactor: trim provider internal exports
This commit is contained in:
@@ -294,7 +294,7 @@ function parseDirectiveToken(ctx: SpeechDirectiveTokenParseContext) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function listElevenLabsVoices(params: {
|
||||
async function listElevenLabsVoices(params: {
|
||||
apiKey: string;
|
||||
baseUrl?: string;
|
||||
}): Promise<SpeechVoiceOption[]> {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user