mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 23:56:39 +08:00
17 lines
409 B
TypeScript
17 lines
409 B
TypeScript
export function makeAzurePath(
|
|
path: string,
|
|
apiVersion: string,
|
|
azureModel?: string,
|
|
) {
|
|
// should omit /v1 prefix
|
|
// path = path.replaceAll("v1/", "");
|
|
path = path.replaceAll(
|
|
"v1/chat/completions",
|
|
`openai/deployments/${azureModel}/chat/completions`,
|
|
);
|
|
// should add api-key to query string
|
|
path += `${path.includes("?") ? "&" : "?"}api-version=${apiVersion}`;
|
|
|
|
return path;
|
|
}
|