mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:40:43 +00:00
Merged via squash. Supersedes: - #66969 by @saamuelng601-pixel - #67159 by @hclsys Co-authored-by: saamuelng601-pixel <274746699+saamuelng601-pixel@users.noreply.github.com> Co-authored-by: hclsys <7755017+hclsys@users.noreply.github.com>
18 lines
543 B
TypeScript
18 lines
543 B
TypeScript
import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime";
|
|
|
|
export function isOpenAIApiBaseUrl(baseUrl?: string): boolean {
|
|
const trimmed = normalizeOptionalString(baseUrl);
|
|
if (!trimmed) {
|
|
return false;
|
|
}
|
|
return /^https?:\/\/api\.openai\.com(?:\/v1)?\/?$/i.test(trimmed);
|
|
}
|
|
|
|
export function isOpenAICodexBaseUrl(baseUrl?: string): boolean {
|
|
const trimmed = normalizeOptionalString(baseUrl);
|
|
if (!trimmed) {
|
|
return false;
|
|
}
|
|
return /^https?:\/\/chatgpt\.com\/backend-api(?:\/v1)?\/?$/i.test(trimmed);
|
|
}
|