chore: prepare GoodBuddy 0.8.5

This commit is contained in:
lofyer
2026-08-07 10:45:01 +08:00
parent e20cb447af
commit 17e66a3369
54 changed files with 1306 additions and 1640 deletions
+6 -3
View File
@@ -2,11 +2,14 @@ export function createAnthropicApiBaseUrl(baseUrl: string): string {
const url = new URL(baseUrl)
const path = url.pathname.replace(/\/+$/, '')
url.pathname = path.endsWith('/v1') ? path : `${path}/v1`
url.search = ''
url.hash = ''
return url.toString().replace(/\/$/, '')
return url.toString()
}
export function createAnthropicMessagesUrl(baseUrl: string): URL {
return new URL(`${createAnthropicApiBaseUrl(baseUrl)}/messages`)
const url = new URL(baseUrl)
const path = url.pathname.replace(/\/+$/u, '')
url.pathname = `${path.endsWith('/v1') ? path : `${path}/v1`}/messages`
url.hash = ''
return url
}