diff --git a/autogen/oai/client.py b/autogen/oai/client.py index 833cc777219..481e55728c5 100644 --- a/autogen/oai/client.py +++ b/autogen/oai/client.py @@ -1069,7 +1069,7 @@ def extract_text_or_completion_object( def _throttle_api_calls(self, idx: int) -> None: """Rate limit api calls.""" - if self._rate_limiters[idx]: + if idx < len(self._rate_limiters) and self._rate_limiters[idx]: limiter = self._rate_limiters[idx] assert limiter is not None diff --git a/website/docs/Getting-Started.mdx b/website/docs/Getting-Started.mdx index 761ed6f3d34..291345c6f03 100644 --- a/website/docs/Getting-Started.mdx +++ b/website/docs/Getting-Started.mdx @@ -45,7 +45,7 @@ pip install autogen-agentchat~=0.2 import os from autogen import AssistantAgent, UserProxyAgent -llm_config = {"model": "gpt-4", "api_key": os.environ["OPENAI_API_KEY"]} +llm_config = { "config_list": [{ "model": "gpt-4", "api_key": os.environ.get("OPENAI_API_KEY") }] } assistant = AssistantAgent("assistant", llm_config=llm_config) user_proxy = UserProxyAgent("user_proxy", code_execution_config=False)