Skip to content

Commit

Permalink
Fix:Module programming llm (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytropolityka authored Sep 16, 2024
1 parent 2da2d33 commit bbbcbc9
Show file tree
Hide file tree
Showing 3 changed files with 380 additions and 353 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@
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={api_version}", headers=headers, timeout=30)
models_response = requests.get(f"{base_url}/models?api-version=2023-03-15-preview", headers=headers, timeout=30)
models_data = models_response.json()["data"]
deployments_response = requests.get(f"{base_url}/deployments?api-version={api_version}", headers=headers,
deployments_response = requests.get(f"{base_url}/deployments?api-version=2023-03-15-preview", headers=headers,
timeout=30)
deployments_data = deployments_response.json()["data"]

Expand Down
Loading

0 comments on commit bbbcbc9

Please sign in to comment.