refactor: trim perplexity helper exports

This commit is contained in:
Peter Steinberger
2026-05-01 19:52:45 +01:00
parent 1f1a735ef5
commit c566956b1f

View File

@@ -7,15 +7,14 @@ import {
export const DEFAULT_PERPLEXITY_BASE_URL = "https://openrouter.ai/api/v1";
export const PERPLEXITY_DIRECT_BASE_URL = "https://api.perplexity.ai";
export const PERPLEXITY_CREDENTIAL_PATH = "plugins.entries.perplexity.config.webSearch.apiKey";
const PERPLEXITY_CREDENTIAL_PATH = "plugins.entries.perplexity.config.webSearch.apiKey";
const PERPLEXITY_ONBOARDING_SCOPES: Array<"text-inference"> = ["text-inference"];
const PERPLEXITY_KEY_PREFIXES = ["pplx-"];
const OPENROUTER_KEY_PREFIXES = ["sk-or-"];
export type PerplexityTransport = "search_api" | "chat_completions";
export type PerplexityBaseUrlHint = "direct" | "openrouter";
export type PerplexityRuntimeTransportContext = {
type PerplexityRuntimeTransportContext = {
searchConfig?: Record<string, unknown>;
resolvedKey?: string;
keySource: "config" | "secretRef" | "env" | "missing";
@@ -70,7 +69,7 @@ function normalizeLowercaseStringOrEmpty(value: unknown): string {
export function inferPerplexityBaseUrlFromApiKey(
apiKey?: string,
): PerplexityBaseUrlHint | undefined {
): "direct" | "openrouter" | undefined {
if (!apiKey) {
return undefined;
}
@@ -94,7 +93,7 @@ export function isDirectPerplexityBaseUrl(baseUrl: string): boolean {
}
}
export function resolvePerplexityRuntimeTransport(
function resolvePerplexityRuntimeTransport(
params: PerplexityRuntimeTransportContext,
): PerplexityTransport | undefined {
const perplexity = params.searchConfig?.perplexity;