Skip to content

Commit

Permalink
Give direct access to the openai client
Browse files Browse the repository at this point in the history
  • Loading branch information
detaos authored Jul 20, 2023
1 parent ff8a4f7 commit caa315c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dsp/modules/gpt3.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(

if api_key:
openai.api_key = api_key

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

Expand All @@ -72,6 +72,9 @@ def __init__(
self.kwargs["model"] = model
self.history: list[dict[str, Any]] = []

def _openai_client():
return openai

def basic_request(self, prompt: str, **kwargs) -> OpenAIObject:
raw_kwargs = kwargs

Expand Down

0 comments on commit caa315c

Please sign in to comment.