Skip to content

Commit

Permalink
Merge pull request #155 from pauldotyu/main
Browse files Browse the repository at this point in the history
feat: adding additional env vars for oai endpoint in ai-service
  • Loading branch information
pauldotyu committed Jul 15, 2024
2 parents a7dffd3 + 1398ed4 commit 10c18c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ai-service/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async def get_health():
capabilities = ["description"]

# Check if the environment variable is set
if os.environ.get("AZURE_OPENAI_DALLE_ENDPOINT") and os.environ.get("AZURE_OPENAI_DALLE_DEPLOYMENT_NAME"):
if (os.environ.get("AZURE_OPENAI_DALLE_ENDPOINT") or os.environ.get("AZURE_OPENAI_ENDPOINT")) and os.environ.get("AZURE_OPENAI_DALLE_DEPLOYMENT_NAME"):
# If it is, add "image" to the array
capabilities.append("image")

Expand Down
2 changes: 1 addition & 1 deletion src/ai-service/routers/image_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async def post_image(request: Request) -> JSONResponse:
print("Calling OpenAI")

api_version = os.environ.get("AZURE_OPENAI_API_VERSION")
endpoint = os.environ.get("AZURE_OPENAI_DALLE_ENDPOINT")
endpoint = os.environ.get("AZURE_OPENAI_DALLE_ENDPOINT") or os.environ.get("AZURE_OPENAI_ENDPOINT")
model_deployment_name = os.environ.get("AZURE_OPENAI_DALLE_DEPLOYMENT_NAME")

token_provider = get_bearer_token_provider(DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default")
Expand Down

0 comments on commit 10c18c5

Please sign in to comment.