31 lines
988 B
TypeScript
31 lines
988 B
TypeScript
import type { LLMConfig } from '@page-agent/llms'
|
|
|
|
// Demo LLM for testing
|
|
export const DEMO_MODEL = 'qwen3.5-plus'
|
|
export const DEMO_BASE_URL = 'https://page-ag-testing-ohftxirgbn.cn-shanghai.fcapp.run'
|
|
export const DEMO_API_KEY = 'NA'
|
|
|
|
export const DEMO_CONFIG: LLMConfig = {
|
|
apiKey: DEMO_API_KEY,
|
|
baseURL: DEMO_BASE_URL,
|
|
model: DEMO_MODEL,
|
|
}
|
|
|
|
/** Legacy testing endpoints that should be auto-migrated to DEMO_BASE_URL */
|
|
export const LEGACY_TESTING_ENDPOINTS = [
|
|
'https://hwcxiuzfylggtcktqgij.supabase.co/functions/v1/llm-testing-proxy',
|
|
]
|
|
|
|
export function isTestingEndpoint(url: string): boolean {
|
|
const normalized = url.replace(/\/+$/, '')
|
|
return normalized === DEMO_BASE_URL || LEGACY_TESTING_ENDPOINTS.some((ep) => normalized === ep)
|
|
}
|
|
|
|
export function migrateLegacyEndpoint(config: LLMConfig): LLMConfig {
|
|
const normalized = config.baseURL.replace(/\/+$/, '')
|
|
if (LEGACY_TESTING_ENDPOINTS.some((ep) => normalized === ep)) {
|
|
return { ...DEMO_CONFIG }
|
|
}
|
|
return config
|
|
}
|