Skip to content

Commit

Permalink
Regenerate SDK based on typespec-python branch main
Browse files Browse the repository at this point in the history
  • Loading branch information
azure-sdk committed Jul 12, 2024
1 parent fa2bb49 commit d96ac89
Show file tree
Hide file tree
Showing 264 changed files with 55,970 additions and 76,905 deletions.
26 changes: 26 additions & 0 deletions aaaa-regenerate-sdk-result.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"succeed_to_regenerate": [
"azure-ai-contentsafety",
"azure-ai-documentintelligence",
"azure-ai-inference",
"azure-ai-translation-document",
"azure-ai-translation-text",
"azure-ai-vision-face",
"azure-ai-vision-imageanalysis",
"azure-communication-jobrouter",
"azure-eventgrid",
"azure-healthinsights-radiologyinsights",
"azure-mgmt-devopsinfrastructure",
"azure-mgmt-edgezones",
"azure-mgmt-mongocluster",
"azure-purview-datamap",
"azure-schemaregistry",
"azure_ai_assets_v2024_04_01"
],
"fail_to_regenerate": [
"azure-communication-messages",
"azure-developer-devcenter",
"azure-mgmt-informaticadatamanagement"
],
"time_to_regenerate": "2024-07-12 19:59:41.735193"
}
128 changes: 24 additions & 104 deletions eng/emitter-package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions eng/emitter-package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"main": "dist/src/index.js",
"dependencies": {
"@azure-tools/typespec-python": "0.25.0"
"@azure-tools/typespec-python": "/mnt/vss/_work/1/s/autorest.python/packages/typespec-python/azure-tools-typespec-python-0.25.0.tgz"
},
"devDependencies": {
"@azure-tools/typespec-autorest": "~0.43.0",
Expand All @@ -16,4 +16,4 @@
"@typespec/versioning": "~0.57.0",
"@typespec/xml": "~0.57.0"
}
}
}
16 changes: 9 additions & 7 deletions sdk/ai/azure-ai-inference/azure/ai/inference/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,25 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._patch import ChatCompletionsClient
from ._patch import EmbeddingsClient
from ._patch import ImageEmbeddingsClient
from ._client import ChatCompletionsClient
from ._client import EmbeddingsClient
from ._client import ImageEmbeddingsClient
from ._version import VERSION

__version__ = VERSION


from ._patch import load_client
try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"load_client",
"ChatCompletionsClient",
"EmbeddingsClient",
"ImageEmbeddingsClient",
]

__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
234 changes: 79 additions & 155 deletions sdk/ai/azure-ai-inference/azure/ai/inference/_operations/_operations.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/ai/azure-ai-inference/azure/ai/inference/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def load_client(
# TODO: Remove "completions" and "embedding" once Mistral Large and Cohere fixes their model type
if model_info.model_type in (_models.ModelType.CHAT, "completion"):
chat_completion_client = ChatCompletionsClient(endpoint, credential, **kwargs)
chat_completion_client._model_info = ( # pylint: disable=protected-access,attribute-defined-outside-init
chat_completion_client._model_info = ( # pylint: disable=protected-access,attribute-defined-outside-init
model_info
)
return chat_completion_client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ def _json_attemp(data):
# context otherwise.
_LOGGER.critical("Wasn't XML not JSON, failing")
raise DeserializationError("XML is invalid") from err
elif content_type.startswith("text/"):
return data_as_str
raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))

@classmethod
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.0b3"
VERSION = "1.0.0b1"
16 changes: 9 additions & 7 deletions sdk/ai/azure-ai-inference/azure/ai/inference/aio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._patch import ChatCompletionsClient
from ._patch import EmbeddingsClient
from ._patch import ImageEmbeddingsClient
from ._client import ChatCompletionsClient
from ._client import EmbeddingsClient
from ._client import ImageEmbeddingsClient


from ._patch import load_client
try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"load_client",
"ChatCompletionsClient",
"EmbeddingsClient",
"ImageEmbeddingsClient",
]

__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
Loading

0 comments on commit d96ac89

Please sign in to comment.