Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

small fix, to update _openai_client

KCaverly745aaf2a7f16
diff --git a/dsp/modules/gpt3.py b/dsp/modules/gpt3.py
index 9bbca4b0a..f7293bdeb 100644
--- a/dsp/modules/gpt3.py
+++ b/dsp/modules/gpt3.py
@@ -134,7 +134,10 @@ class GPT3(LM):
self.history: list[dict[str, Any]] = []
def _openai_client(self):
- return client
+ if OPENAI_LEGACY:
+ return openai
+
+ return self.client
def log_usage(self, response):
"""Log the total tokens from the OpenAI API response."""