Skip to content

Commit 3da7a81

Browse files
committed
Fixes
1 parent fd514d0 commit 3da7a81

5 files changed

Lines changed: 30 additions & 24 deletions

File tree

sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8933,6 +8933,14 @@ def list_memories(
89338933
304: ResourceNotModifiedError,
89348934
}
89358935
error_map.update(kwargs.pop("error_map", {}) or {})
8936+
8937+
# BUG? These lines were inside the prepare_request() method. Moved here instead.
8938+
if body is _Unset:
8939+
if scope is _Unset:
8940+
raise TypeError("missing required argument: scope")
8941+
body = {"scope": scope}
8942+
body = {k: v for k, v in body.items() if v is not None}
8943+
89368944
content_type = content_type or "application/json"
89378945
_content = None
89388946
if isinstance(body, (IOBase, bytes)):
@@ -8941,12 +8949,6 @@ def list_memories(
89418949
_content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore
89428950

89438951
def prepare_request(_continuation_token=None):
8944-
if body is _Unset:
8945-
if scope is _Unset:
8946-
raise TypeError("missing required argument: scope")
8947-
body = {"scope": scope}
8948-
body = {k: v for k, v in body.items() if v is not None}
8949-
89508952
_request = build_beta_memory_stores_list_memories_request(
89518953
name=name,
89528954
kind=kind,

sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12322,6 +12322,14 @@ def list_memories(
1232212322
304: ResourceNotModifiedError,
1232312323
}
1232412324
error_map.update(kwargs.pop("error_map", {}) or {})
12325+
12326+
# BUG? These lines were inside the prepare_request() method. Moved here instead.
12327+
if body is _Unset:
12328+
if scope is _Unset:
12329+
raise TypeError("missing required argument: scope")
12330+
body = {"scope": scope}
12331+
body = {k: v for k, v in body.items() if v is not None}
12332+
1232512333
content_type = content_type or "application/json"
1232612334
_content = None
1232712335
if isinstance(body, (IOBase, bytes)):
@@ -12330,12 +12338,6 @@ def list_memories(
1233012338
_content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore
1233112339

1233212340
def prepare_request(_continuation_token=None):
12333-
if body is _Unset:
12334-
if scope is _Unset:
12335-
raise TypeError("missing required argument: scope")
12336-
body = {"scope": scope}
12337-
body = {k: v for k, v in body.items() if v is not None}
12338-
1233912341
_request = build_beta_memory_stores_list_memories_request(
1234012342
name=name,
1234112343
kind=kind,

sdk/ai/azure-ai-projects/pyproject.toml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ name = "azure-ai-projects"
1414
authors = [
1515
{ name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" },
1616
]
17-
description = "Microsoft Corporation Azure Ai Projects Client Library for Python"
17+
description = "Microsoft Corporation Azure AI Projects Client Library for Python"
1818
license = "MIT"
1919
classifiers = [
20-
"Development Status :: 4 - Beta",
20+
"Development Status :: 5 - Production/Stable",
2121
"Programming Language :: Python",
2222
"Programming Language :: Python :: 3 :: Only",
2323
"Programming Language :: Python :: 3",
@@ -26,6 +26,7 @@ classifiers = [
2626
"Programming Language :: Python :: 3.11",
2727
"Programming Language :: Python :: 3.12",
2828
"Programming Language :: Python :: 3.13",
29+
"Programming Language :: Python :: 3.14",
2930
]
3031
requires-python = ">=3.9"
3132
keywords = ["azure", "azure sdk"]
@@ -43,21 +44,21 @@ dynamic = [
4344
]
4445

4546
[project.urls]
46-
repository = "https://github.com/Azure/azure-sdk-for-python"
47+
repository = "https://aka.ms/azsdk/azure-ai-projects-v2/python/code"
4748

4849
[tool.setuptools.dynamic]
4950
version = {attr = "azure.ai.projects._version.VERSION"}
5051
readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"}
5152

5253
[tool.setuptools.packages.find]
5354
exclude = [
54-
"tests*",
55+
"azure.ai",
56+
"azure",
57+
"doc*",
58+
"generated_samples*",
5559
"generated_tests*",
5660
"samples*",
57-
"generated_samples*",
58-
"doc*",
59-
"azure",
60-
"azure.ai",
61+
"tests*",
6162
]
6263

6364
[tool.setuptools.package-data]
@@ -68,3 +69,4 @@ verifytypes = false
6869

6970
[tool.azure-sdk-conda]
7071
in_bundle = false
72+

sdk/ai/azure-ai-projects/samples/hosted_agents/sample_create_hosted_agent_from_code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
code=(zip_filename, code_zip_bytes, "application/zip"),
9191
)
9292

93-
created = project_client.beta.agents.create_agent_version_from_code(
93+
created = project_client.beta.agents.create_version_from_code(
9494
agent_name=agent_name,
9595
content=content,
9696
code_zip_sha256=code_zip_sha256,
@@ -114,7 +114,7 @@
114114
version_zip_path = Path(tempfile.gettempdir()) / f"{agent_name}-{created.version}.zip"
115115
sha = hashlib.sha256()
116116
with open(version_zip_path, "wb") as f:
117-
for chunk in project_client.beta.agents.download_agent_version_code(
117+
for chunk in project_client.beta.agents.download_agent_code(
118118
agent_name=agent_name,
119119
agent_version=created.version,
120120
):

sdk/ai/azure-ai-projects/samples/hosted_agents/sample_create_hosted_agent_from_code_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async def main() -> None:
9494
code=(zip_filename, code_zip_bytes, "application/zip"),
9595
)
9696

97-
created = await project_client.beta.agents.create_agent_version_from_code(
97+
created = await project_client.beta.agents.create_version_from_code(
9898
agent_name=agent_name,
9999
content=content,
100100
code_zip_sha256=code_zip_sha256,
@@ -119,7 +119,7 @@ async def main() -> None:
119119
# Download the zip for the version we just created, streaming to a temp file.
120120
version_zip_path = Path(tempfile.gettempdir()) / f"{agent_name}-{created.version}.zip"
121121
sha = hashlib.sha256()
122-
version_stream = await project_client.beta.agents.download_agent_version_code(
122+
version_stream = await project_client.beta.agents.download_agent_code(
123123
agent_name=agent_name,
124124
agent_version=created.version,
125125
)

0 commit comments

Comments
 (0)