Add skill governance and runtime routing
This commit is contained in:
1 parent
a900016be4
commit
221e9391e0
71 files changed
+7057
-102
No files matched your search
@@ -39,8 +39,14 @@ function normalizeEndpointConfig(
|
||||
function buildCompletionUrl(endpoint: string): string {
|
||||
try {
|
||||
const url = new URL(endpoint);
|
||||
if (!url.pathname || url.pathname === "/") {
|
||||
const normalizedPath = url.pathname.replace(/\/+$/u, "");
|
||||
if (!normalizedPath) {
|
||||
url.pathname = "/v1/chat/completions";
|
||||
} else if (
|
||||
normalizedPath.endsWith("/v1") ||
|
||||
normalizedPath.endsWith("/api/v1")
|
||||
) {
|
||||
url.pathname = `${normalizedPath}/chat/completions`;
|
||||
}
|
||||
url.search = "";
|
||||
url.hash = "";
|
||||
|
||||
Reference in new issue
Block a user