Skip to content

Commit 0229fd2

Browse files
authored
return base url when not None (#643)
1 parent e2c6a07 commit 0229fd2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cohere/client.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ async def _async_wrapped(*args, **kwargs):
121121

122122

123123
def fix_base_url(base_url: typing.Optional[str]) -> typing.Optional[str]:
124-
if base_url is not None and ("cohere.com" in base_url or "cohere.ai" in base_url):
125-
return base_url.replace("/v1", "")
124+
if base_url is not None:
125+
if "cohere.com" in base_url or "cohere.ai" in base_url:
126+
return base_url.replace("/v1", "")
127+
return base_url
126128
return None
127129

128130

0 commit comments

Comments
 (0)