From 74549a85a2ab63abd7243ef51cb71851bab8c666 Mon Sep 17 00:00:00 2001 From: Yuxiang Wu Date: Tue, 21 Nov 2023 13:53:17 +0000 Subject: [PATCH] Bug fix: fix error for openai backend: Choice is not subscriptable. --- chatarena/backends/openai.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chatarena/backends/openai.py b/chatarena/backends/openai.py index 74e577ef..7a101512 100644 --- a/chatarena/backends/openai.py +++ b/chatarena/backends/openai.py @@ -80,7 +80,7 @@ def _get_response(self, messages): stop=STOP, ) - response = completion.choices[0]["message"]["content"] + response = completion.choices[0].message.content response = response.strip() return response diff --git a/pyproject.toml b/pyproject.toml index 658d259f..5fb5b866 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ all_backends = ["anthropic>=0.2.8", "cohere>=4.3.1", "transformers>=4.27.4", "ba all_envs = ["pettingzoo>=1.24.0", "chess==1.9.4", "rlcard==1.0.5", "pygame==2.3.0", "langchain>=0.0.135"] database = ["supabase==2.0.3"] testing = ["deptry>=0.12.0", "pytest>=7.4.3", "pytest-cov>=4.1.0", "pytest-xdist>=3.4.0"] -all = ["anthropic>=0.2.8", "cohere>=4.3.1", "transformers>=4.27.4", "gradio==3.34.0", "pydantic==1.10.13", "pettingzoo>=1.24.0", "chess==1.9.4", "rlcard==1.0.5", "pygame==2.3.0", "gymnasium>=0.28.1", +all = ["anthropic==0.2.8", "cohere==4.3.1", "transformers>=4.27.4", "gradio==3.34.0", "pydantic==1.10.13", "pettingzoo>=1.24.0", "chess==1.9.4", "rlcard==1.0.5", "pygame==2.3.0", "gymnasium>=0.28.1", "supabase==2.0.3", "bardapi==0.1.11", "langchain>=0.0.135", "deptry>=0.12.0", "pytest>=7.4.3", "pytest-cov>=4.1.0", "pytest-xdist>=3.4.0"] [tool.deptry.per_rule_ignores]