Skip to content

Commit

Permalink
show button state
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-i committed Dec 19, 2023
1 parent f8142e5 commit b8eb00f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/jupyter-ai-magics/jupyter_ai_magics/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ class OpenAIProvider(BaseProvider, OpenAI):
pypi_package_deps = ["openai"]
auth_strategy = EnvAuthStrategy(name="OPENAI_API_KEY")

@classmethod
def is_api_key_exc(cls, e: Exception):
"""
Determine if the exception is an OpenAI API key error.
Expand Down Expand Up @@ -558,6 +559,7 @@ def append_exchange(self, prompt: str, output: str):
self.prefix_messages.append({"role": "user", "content": prompt})
self.prefix_messages.append({"role": "assistant", "content": output})

@classmethod
def is_api_key_exc(cls, e: Exception):
"""
Determine if the exception is an OpenAI API key error.
Expand Down Expand Up @@ -602,6 +604,7 @@ class ChatOpenAINewProvider(BaseProvider, ChatOpenAI):
TextField(key="openai_proxy", label="Proxy (optional)", format="text"),
]

@classmethod
def is_api_key_exc(cls, e: Exception):
"""
Determine if the exception is an OpenAI API key error.
Expand Down

0 comments on commit b8eb00f

Please sign in to comment.