@@ -7,15 +7,14 @@ import {
|
7 | 7 | |
8 | 8 | export const DEFAULT_PERPLEXITY_BASE_URL = "https://openrouter.ai/api/v1"; |
9 | 9 | export const PERPLEXITY_DIRECT_BASE_URL = "https://api.perplexity.ai"; |
10 | | -export const PERPLEXITY_CREDENTIAL_PATH = "plugins.entries.perplexity.config.webSearch.apiKey"; |
11 | 10 | |
| 11 | +const PERPLEXITY_CREDENTIAL_PATH = "plugins.entries.perplexity.config.webSearch.apiKey"; |
12 | 12 | const PERPLEXITY_ONBOARDING_SCOPES: Array<"text-inference"> = ["text-inference"]; |
13 | 13 | const PERPLEXITY_KEY_PREFIXES = ["pplx-"]; |
14 | 14 | const OPENROUTER_KEY_PREFIXES = ["sk-or-"]; |
15 | 15 | |
16 | 16 | export type PerplexityTransport = "search_api" | "chat_completions"; |
17 | | -export type PerplexityBaseUrlHint = "direct" | "openrouter"; |
18 | | -export type PerplexityRuntimeTransportContext = { |
| 17 | +type PerplexityRuntimeTransportContext = { |
19 | 18 | searchConfig?: Record<string, unknown>; |
20 | 19 | resolvedKey?: string; |
21 | 20 | keySource: "config" | "secretRef" | "env" | "missing"; |
@@ -70,7 +69,7 @@ function normalizeLowercaseStringOrEmpty(value: unknown): string {
|
70 | 69 | |
71 | 70 | export function inferPerplexityBaseUrlFromApiKey( |
72 | 71 | apiKey?: string, |
73 | | -): PerplexityBaseUrlHint | undefined { |
| 72 | +): "direct" | "openrouter" | undefined { |
74 | 73 | if (!apiKey) { |
75 | 74 | return undefined; |
76 | 75 | } |
@@ -94,7 +93,7 @@ export function isDirectPerplexityBaseUrl(baseUrl: string): boolean {
|
94 | 93 | } |
95 | 94 | } |
96 | 95 | |
97 | | -export function resolvePerplexityRuntimeTransport( |
| 96 | +function resolvePerplexityRuntimeTransport( |
98 | 97 | params: PerplexityRuntimeTransportContext, |
99 | 98 | ): PerplexityTransport | undefined { |
100 | 99 | const perplexity = params.searchConfig?.perplexity; |
|