Skip to content

Commit

Permalink
fix(playground): add AZURE_OPENAI_API_KEY environment variable (#5570)
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerHYang authored Dec 2, 2024
1 parent b14e814 commit 32e4e64
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/phoenix/server/api/helpers/playground_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ def __init__(
super().__init__(model=model, api_key=api_key)
self._attributes[LLM_PROVIDER] = OpenInferenceLLMProviderValues.AZURE.value
self._attributes[LLM_SYSTEM] = OpenInferenceLLMSystemValues.OPENAI.value
if not (api_key := api_key or os.environ.get("AZURE_OPENAI_API_KEY")):
raise BadRequest("An Azure API key is required for Azure OpenAI models")
if not (endpoint := model.endpoint or os.environ.get("AZURE_OPENAI_ENDPOINT")):
raise BadRequest("An Azure endpoint is required for Azure OpenAI models")
if not (api_version := model.api_version or os.environ.get("OPENAI_API_VERSION")):
Expand Down

0 comments on commit 32e4e64

Please sign in to comment.