🐛 don't add /v1 for perplexity API
This commit is contained in:
parent
ec5dea275f
commit
f5627d1566
1 changed files with 2 additions and 2 deletions
|
|
@ -72,7 +72,7 @@ class OpenAI extends BaseLLM {
|
|||
if (url.endsWith("/")) {
|
||||
url = url.slice(0, -1);
|
||||
}
|
||||
if (!url.endsWith("/v1")) {
|
||||
if (!url.endsWith("/v1") && !url.includes("api.perplexity.ai")) {
|
||||
url += "/v1";
|
||||
}
|
||||
return url + "/completions";
|
||||
|
|
@ -138,7 +138,7 @@ class OpenAI extends BaseLLM {
|
|||
url = url.slice(0, -1);
|
||||
}
|
||||
|
||||
if (!url.includes("/v1")) {
|
||||
if (!url.includes("/v1") && !url.includes("api.perplexity.ai")) {
|
||||
// includes instead of endsWith becuase DeepInfra uses /v1/openai/chat/completions
|
||||
url += "/v1";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue