Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/openai/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def __init__(
self.websocket_base_url = websocket_base_url

if base_url is None:
base_url = os.environ.get("OPENAI_BASE_URL")
base_url = os.environ.get("OPENAI_BASE_URL") or None
if base_url is None:
base_url = f"https://api.openai.com/v1"

Expand Down Expand Up @@ -536,7 +536,7 @@ def __init__(
self.websocket_base_url = websocket_base_url

if base_url is None:
base_url = os.environ.get("OPENAI_BASE_URL")
base_url = os.environ.get("OPENAI_BASE_URL") or None
if base_url is None:
base_url = f"https://api.openai.com/v1"

Expand Down
2 changes: 1 addition & 1 deletion src/openai/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def model_dump(
exclude_defaults=exclude_defaults,
# warnings are not supported in Pydantic v1
warnings=True if PYDANTIC_V1 else warnings,
by_alias=by_alias,
by_alias=bool(by_alias) if by_alias is not None else False,
)
return cast(
"dict[str, Any]",
Expand Down