NextChat-U/app/azure.ts

10 lines
262 B
TypeScript
Raw Normal View History

2023-11-10 03:43:30 +09:00
export function makeAzurePath(path: string, apiVersion: string) {
// should omit /v1 prefix
path = path.replaceAll("v1/", "");
// should add api-key to query string
path += `${path.includes("?") ? "&" : "?"}api-version=${apiVersion}`;
return path;
}