mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-06 15:18:58 +00:00
refactor: trim perplexity helper exports
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user