A programming framework for agentic AI
Add default value to the logprobs parameter (#1044)
Davor Runjecb6512dd5a73
diff --git a/autogen/oai/client.py b/autogen/oai/client.pyindex f22562efc..a6569ec02 100644--- a/autogen/oai/client.py+++ b/autogen/oai/client.py@@ -14,7 +14,7 @@ from autogen.token_count_utils import count_tokenTOOL_ENABLED = Falsetry:import openai- from openai import OpenAI, APIError+ from openai import OpenAI, APIError, __version__ as OPENAIVERSIONfrom openai.types.chat import ChatCompletionfrom openai.types.chat.chat_completion import ChatCompletionMessage, Choicefrom openai.types.completion import Completion@@ -330,8 +330,8 @@ class OpenAIWrapper:),)for i in range(len(response_contents)):- try:- # OpenAI versions 0.1.5 and above+ if OPENAIVERSION >= "1.5": # pragma: no cover+ # OpenAI versions 1.5.0 and abovechoice = Choice(index=i,finish_reason=finish_reasons[i],@@ -340,8 +340,8 @@ class OpenAIWrapper:),logprobs=None,)- except ValidationError:- # OpenAI version up to 0.1.4+ else:+ # OpenAI versions below 1.5.0choice = Choice(index=i,finish_reason=finish_reasons[i],diff --git a/setup.py b/setup.pyindex bc06e10cc..8c61cb085 100644--- a/setup.py+++ b/setup.py@@ -14,7 +14,7 @@ with open(os.path.join(here, "autogen/version.py")) as fp:__version__ = version["__version__"]install_requires = [- "openai>=1,<1.5", # a temporary fix for breaking changes in 1.5+ "openai>=1.3,<1.5","diskcache","termcolor","flaml",