Skip to content

Commit

Permalink
Merge branch 'feature/azure-ai-projects-b2' into glharper/agent_tool_…
Browse files Browse the repository at this point in the history
…v2_updates
  • Loading branch information
glharper committed Nov 15, 2024
2 parents 5d1e38c + 1bee9d4 commit 5661759
Show file tree
Hide file tree
Showing 1,390 changed files with 27,261 additions and 1,325,370 deletions.
3 changes: 2 additions & 1 deletion .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,8 @@
"aiservices",
"OTEL",
"GENAI",
"fspath"
"fspath",
"azureopenai"
]
},
{
Expand Down
6 changes: 6 additions & 0 deletions sdk/ai/azure-ai-inference/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 1.0.0b7 (Unreleased)

### Bugs Fixed

* Fix a bug that would cause an error when tracing was enabled and azure-core-tracing-opentelemetry was not installed and asynchronous chat completion was used.

## 1.0.0b6 (2024-11-11)

### Features Added
Expand Down
2 changes: 1 addition & 1 deletion sdk/ai/azure-ai-inference/azure/ai/inference/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0b6"
VERSION = "1.0.0b7"
219 changes: 187 additions & 32 deletions sdk/ai/azure-ai-projects/README.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__( # pylint: disable=super-init-not-called,too-many-statements
project_name=project_name,
credential=credential,
api_version="2020-02-02",
credential_scopes=["https://management.azure.com"],
credential_scopes=["https://management.azure.com/.default"],
**kwargs0,
)

Expand Down Expand Up @@ -106,7 +106,7 @@ def __init__( # pylint: disable=super-init-not-called,too-many-statements
project_name=project_name,
credential=credential,
api_version="2024-07-01-preview",
credential_scopes=["https://management.azure.com"],
credential_scopes=["https://management.azure.com/.default"],
**kwargs1,
)
_policies1 = kwargs1.pop("policies", None)
Expand Down Expand Up @@ -137,7 +137,7 @@ def __init__( # pylint: disable=super-init-not-called,too-many-statements
project_name=project_name,
credential=credential,
api_version="2024-07-01-preview", # TODO: Update me
credential_scopes=["https://ml.azure.com"],
credential_scopes=["https://ml.azure.com/.default"],
**kwargs2,
)
_policies2 = kwargs2.pop("policies", None)
Expand Down Expand Up @@ -169,7 +169,7 @@ def __init__( # pylint: disable=super-init-not-called,too-many-statements
project_name=project_name,
credential=credential,
api_version="2024-07-01-preview", # TODO: Update me
credential_scopes=["https://ml.azure.com"], # TODO: Update once service changes are ready
credential_scopes=["https://ml.azure.com/.default"], # TODO: Update once service changes are ready
**kwargs3,
)
_policies3 = kwargs3.pop("policies", None)
Expand Down
8 changes: 4 additions & 4 deletions sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__( # pylint: disable=super-init-not-called,too-many-statements
project_name=project_name,
credential=credential,
api_version="2020-02-02",
credential_scopes=["https://management.azure.com"],
credential_scopes=["https://management.azure.com/.default"],
**kwargs0,
)

Expand Down Expand Up @@ -106,7 +106,7 @@ def __init__( # pylint: disable=super-init-not-called,too-many-statements
project_name=project_name,
credential=credential,
api_version="2024-07-01-preview",
credential_scopes=["https://management.azure.com"],
credential_scopes=["https://management.azure.com/.default"],
**kwargs1,
)
_policies1 = kwargs1.pop("policies", None)
Expand Down Expand Up @@ -137,7 +137,7 @@ def __init__( # pylint: disable=super-init-not-called,too-many-statements
project_name=project_name,
credential=credential,
api_version="2024-07-01-preview", # TODO: Update me
credential_scopes=["https://ml.azure.com"],
credential_scopes=["https://ml.azure.com/.default"],
**kwargs2,
)
_policies2 = kwargs2.pop("policies", None)
Expand Down Expand Up @@ -169,7 +169,7 @@ def __init__( # pylint: disable=super-init-not-called,too-many-statements
project_name=project_name,
credential=credential,
api_version="2024-07-01-preview", # TODO: Update me
credential_scopes=["https://ml.azure.com"], # TODO: Update once service changes are ready
credential_scopes=["https://ml.azure.com/.default"], # TODO: Update once service changes are ready
**kwargs3,
)
_policies3 = kwargs3.pop("policies", None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ async def get_azure_openai_client(self, *, api_version: Optional[str] = None, **
:keyword api_version: The Azure OpenAI api-version to use when creating the client. Optional.
See "Data plane - Inference" row in the table at
https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs. If this keyword
https://learn.microsoft.com/azure/ai-services/openai/reference#api-specs. If this keyword
is not specified, you must set the environment variable `OPENAI_API_VERSION` instead.
:paramtype api_version: str
:return: An authenticated AsyncAzureOpenAI client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def get_azure_openai_client(self, *, api_version: Optional[str] = None, **kwargs
:keyword api_version: The Azure OpenAI api-version to use when creating the client. Optional.
See "Data plane - Inference" row in the table at
https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs. If this keyword
https://learn.microsoft.com/azure/ai-services/openai/reference#api-specs. If this keyword
is not specified, you must set the environment variable `OPENAI_API_VERSION` instead.
:paramtype api_version: str
:return: An authenticated AzureOpenAI client
Expand Down Expand Up @@ -253,7 +253,7 @@ def get_azure_openai_client(self, *, api_version: Optional[str] = None, **kwargs
auth = "Creating AzureOpenAI using SAS authentication"
logger.debug("[InferenceOperations.get_azure_openai_client] %s", auth)
client = AzureOpenAI(
# See https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity?view=azure-python#azure-identity-get-bearer-token-provider # pylint: disable=line-too-long
# See https://learn.microsoft.com/python/api/azure-identity/azure.identity?view=azure-python#azure-identity-get-bearer-token-provider # pylint: disable=line-too-long
azure_ad_token_provider=get_bearer_token_provider(
connection.token_credential, "https://cognitiveservices.azure.com/.default"
),
Expand Down
7 changes: 1 addition & 6 deletions sdk/ai/azure-ai-projects/azure_ai_projects_tests.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
# but do not commit these changes to the repository.
#

# The default here should be to run tests from recordings:
AZURE_TEST_RUN_LIVE=false
AZURE_SKIP_LIVE_RECORDING=true
PROXY_URL=http://localhost:5000

########################################################################################################################
# Connection tests
#
Expand All @@ -35,7 +30,7 @@ AZURE_AI_PROJECTS_CONNECTIONS_TESTS_AISERVICES_CONNECTION_NAME=
# - A default AIServices resource with at least one chat-completions model deployed (from OpenAI or non-OpenAI)
# - A default Azure OpenAI resource connected with at least one chat-completions OpenAI model deployed
# Populate the Azure OpenAI api-version and model deployment names below.
# Note: See Azure OpenAI api-versions here: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
# Note: See Azure OpenAI api-versions here: https://learn.microsoft.com/azure/ai-services/openai/reference#api-specs
#
AZURE_AI_PROJECTS_INFERENCE_TESTS_PROJECT_CONNECTION_STRING=
AZURE_AI_PROJECTS_INFERENCE_TESTS_AOAI_API_VERSION=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,20 @@ async def sample_connections_async() -> None:
aoai_client = AsyncAzureOpenAI(
api_key=connection.key,
azure_endpoint=connection.endpoint_url,
api_version="2024-06-01", # See "Data plane - inference" row in table https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
api_version="2024-06-01", # See "Data plane - inference" row in table https://learn.microsoft.com/azure/ai-services/openai/reference#api-specs
)
elif connection.authentication_type == AuthenticationType.ENTRA_ID:
print("====> Creating AzureOpenAI client using Entra ID authentication")
from azure.identity.aio import get_bearer_token_provider

aoai_client = AsyncAzureOpenAI(
# See https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity?view=azure-python#azure-identity-get-bearer-token-provider
# See https://learn.microsoft.com/python/api/azure-identity/azure.identity?view=azure-python#azure-identity-get-bearer-token-provider
azure_ad_token_provider=get_bearer_token_provider(
cast(AsyncTokenCredential, connection.token_credential),
"https://cognitiveservices.azure.com/.default",
),
azure_endpoint=connection.endpoint_url,
api_version="2024-06-01", # See "Data plane - inference" row in table https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
api_version="2024-06-01", # See "Data plane - inference" row in table https://learn.microsoft.com/azure/ai-services/openai/reference#api-specs
)
else:
raise ValueError(f"Authentication type {connection.authentication_type} not supported.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,20 @@
aoai_client = AzureOpenAI(
api_key=connection.key,
azure_endpoint=connection.endpoint_url,
api_version="2024-06-01", # See "Data plane - inference" row in table https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
api_version="2024-06-01", # See "Data plane - inference" row in table https://learn.microsoft.com/azure/ai-services/openai/reference#api-specs
)
elif connection.authentication_type == AuthenticationType.ENTRA_ID:
print("====> Creating AzureOpenAI client using Entra ID authentication")
from azure.core.credentials import TokenCredential
from azure.identity import get_bearer_token_provider

aoai_client = AzureOpenAI(
# See https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity?view=azure-python#azure-identity-get-bearer-token-provider
# See https://learn.microsoft.com/python/api/azure-identity/azure.identity?view=azure-python#azure-identity-get-bearer-token-provider
azure_ad_token_provider=get_bearer_token_provider(
cast(TokenCredential, connection.token_credential), "https://cognitiveservices.azure.com/.default"
),
azure_endpoint=connection.endpoint_url,
api_version="2024-06-01", # See "Data plane - inference" row in table https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
api_version="2024-06-01", # See "Data plane - inference" row in table https://learn.microsoft.com/azure/ai-services/openai/reference#api-specs
)
else:
raise ValueError(f"Authentication type {connection.authentication_type} not supported.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
Before running the sample:
pip install azure-identity
pip install "git+https://github.com/Azure/azure-sdk-for-python.git@users/singankit/ai_project_utils#egg=azure-ai-client&subdirectory=sdk/ai/azure-ai-client"
pip install "git+https://github.com/Azure/azure-sdk-for-python.git@users/singankit/demo_evaluators_id#egg=azure-ai-evaluation&subdirectory=sdk/evaluation/azure-ai-evaluation"
pip install azure-ai-projects
pip install azure-ai-evaluation
Set this environment variables with your own values:
PROJECT_CONNECTION_STRING - the Azure AI Project connection string, as found in your AI Studio Project.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* MODEL_DEPLOYMENT_NAME - The model deployment name, as found in your AI Studio Project.
Update the Azure OpenAI api-version as needed (see `api_version=` below). Values can be found here:
https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
https://learn.microsoft.com/azure/ai-services/openai/reference#api-specs
"""
import os
import asyncio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* MODEL_DEPLOYMENT_NAME - The model deployment name, as found in your AI Studio Project.
Update the Azure OpenAI api-version as needed (see `api_version=` below). Values can be found here:
https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
https://learn.microsoft.com/azure/ai-services/openai/reference#api-specs
"""
import os
from azure.ai.projects import AIProjectClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
messages, which may contain personal data. False by default.
Update the Azure OpenAI api-version as needed (see `api_version=` below). Values can be found here:
https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
https://learn.microsoft.com/azure/ai-services/openai/reference#api-specs
"""
import os
from azure.ai.projects import AIProjectClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
messages, which may contain personal data. False by default.
Update the Azure OpenAI api-version as needed (see `api_version=` below). Values can be found here:
https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
https://learn.microsoft.com/azure/ai-services/openai/reference#api-specs
"""
import os
import sys
Expand Down
2 changes: 1 addition & 1 deletion sdk/ai/azure-ai-projects/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
license="MIT License",
author="Microsoft Corporation",
author_email="[email protected]",
url="https://github.com/Azure/azure-sdk-for-python/tree/main/sdk",
url="https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/ai/azure-ai-projects",
keywords="azure, azure sdk",
classifiers=[
"Development Status :: 4 - Beta",
Expand Down
2 changes: 1 addition & 1 deletion sdk/ai/azure-ai-projects/tests/inference/test_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_inference_get_azure_openai_client(self, **kwargs):
api_version = kwargs.pop("azure_ai_projects_inference_tests_aoai_api_version")
model = kwargs.pop("azure_ai_projects_inference_tests_aoai_model_deployment_name")
with self.get_sync_client(**kwargs) as project_client:
# See API versions in https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
# See API versions in https://learn.microsoft.com/azure/ai-services/openai/reference#api-specs
with project_client.inference.get_azure_openai_client(api_version=api_version) as azure_openai_client:
if is_live_and_not_recording():
response = azure_openai_client.chat.completions.create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async def test_inference_get_azure_openai_client_async(self, **kwargs):
api_version = kwargs.pop("azure_ai_projects_inference_tests_aoai_api_version")
model = kwargs.pop("azure_ai_projects_inference_tests_aoai_model_deployment_name")
async with self.get_async_client(**kwargs) as project_client:
# See API versions in https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
# See API versions in https://learn.microsoft.com/azure/ai-services/openai/reference#api-specs
async with await project_client.inference.get_azure_openai_client(
api_version=api_version
) as azure_openai_client:
Expand Down
4 changes: 4 additions & 0 deletions sdk/ai/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ extends:
TestProxy: true
BuildDocs: true
TestTimeoutInMinutes: 60
# The job "Test ubuntu2004_pypy39" in the "python - ai" pipeline hangs and eventually times out.
# Disable it until the issue is understood.
MatrixFilters:
- PythonVersion=^(?!pypy3).*
# The below were set before when azure-ai-generative and azure-ai-resources packages were built:
# This is a short term solution to create API review for python azure-ml package only when running pipeline manually
# Long term solution should be to have different versions on main branch and release branch for python package so APIView can have different revisions for each version.
Expand Down
1 change: 1 addition & 0 deletions sdk/ai/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ extends:
template: /eng/pipelines/templates/stages/python-analyze-weekly-standalone.yml
parameters:
ServiceDirectory: ai

4 changes: 4 additions & 0 deletions sdk/appservice/azure-mgmt-web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History

## 0.0.0 (2024-11-18)

change log generation failed!!!

## 7.3.1 (2024-08-19)

### Bugs Fixed
Expand Down
6 changes: 3 additions & 3 deletions sdk/appservice/azure-mgmt-web/_meta.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"commit": "c1d839d48ee936c9338431c38f2cbbfbc9879ea2",
"commit": "ff7b8e12e78b352561e2e470dd045be310a313fa",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.17.0",
"@autorest/python@6.26.4",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/web/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.17.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"autorest_command": "autorest specification/web/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.26.4 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"readme": "specification/web/resource-manager/readme.md",
"package-2023-01": "fatal: invalid object name 'from'. from: WebApps.json",
"package-2022-09": "fatal: invalid object name 'from'. from: WebApps.json",
Expand Down
Loading

0 comments on commit 5661759

Please sign in to comment.