Skip to content

Commit

Permalink
proper api version, new dependencies, gitignore, lock file
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytropolityka committed Sep 5, 2024
1 parent 412f045 commit 76ab595
Show file tree
Hide file tree
Showing 4 changed files with 264 additions and 250 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ data/*
!.idea/runConfigurations/
.env
**/.env
**/data.sqlite
**/data/*
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@
def _get_azure_openai_deployments() -> List[str]:
# If this breaks in the future we have to use azure-mgmt-cognitiveservices which needs 6 additional environment variables
base_url = f"{os.environ.get('AZURE_OPENAI_ENDPOINT')}/openai"
api_version = f"{os.environ.get('LLM_AZURE_OPENAI_API_VERSION')}"
headers = {
"api-key": os.environ["AZURE_OPENAI_API_KEY"]
}

models_response = requests.get(f"{base_url}/models?api-version=2023-03-15-preview", headers=headers, timeout=30)
models_response = requests.get(f"{base_url}/models?api-version={api_version}", headers=headers, timeout=30)
models_data = models_response.json()["data"]
deployments_response = requests.get(f"{base_url}/deployments?api-version=2023-03-15-preview", headers=headers,
deployments_response = requests.get(f"{base_url}/deployments?api-version={api_version}", headers=headers,
timeout=30)
deployments_data = deployments_response.json()["data"]

Expand Down
Loading

0 comments on commit 76ab595

Please sign in to comment.