Skip to content

Commit

Permalink
Allow setting api_base outside of using Azure
Browse files Browse the repository at this point in the history
Previously, you could only set api_base when using Azure.  This decouples setting api_base from using Azure.
  • Loading branch information
detaos authored Jul 20, 2023
1 parent 3817bbe commit ff8a4f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dsp/modules/gpt3.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ def __init__(
assert "api_version" in kwargs, "Must specify api_version for Azure API"
assert "api_base" in kwargs, "Must specify api_base for Azure API"
openai.api_type = "azure"
openai.api_base = kwargs["api_base"]
if kwargs.get("api_version"):
openai.api_version = kwargs["api_version"]

if api_key:
openai.api_key = api_key

if kwargs.get("api_base"):
openai.api_base = kwargs["api_base"]

self.kwargs = {
"temperature": 0.0,
Expand Down

0 comments on commit ff8a4f7

Please sign in to comment.