Skip to content

Commit ef1541a

Browse files
committed
Clarify update analyzer base analyzer guidance
1 parent 0dc8bb3 commit ef1541a

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

sdk/contentunderstanding/azure-ai-contentunderstanding/samples/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ Lists all available analyzers in your Microsoft Foundry resource. Shows how to d
119119
### Sample 08: Update Analyzer
120120

121121
#### `sample_update_analyzer.py` / `sample_update_analyzer_async.py`
122-
Updates an existing custom analyzer's description and tags. Only `description` and `tags` can be updated with `update_analyzer`; use `begin_create_analyzer` with `allow_replace=True` to change create-only properties such as `models`, `field_schema`, `config`, `base_analyzer_id`, `dynamic_field_schema`, `processing_location`, or `knowledge_sources`.
122+
Updates an existing custom analyzer's description and tags. Only `description` and `tags` can be updated
123+
with `update_analyzer`. Use `begin_create_analyzer` with `allow_replace=True` to change create-only
124+
properties such as `models`, `field_schema`, `config`, `dynamic_field_schema`, `processing_location`, or
125+
`knowledge_sources`. If `base_analyzer_id` is included in an update request, it must match the existing
126+
analyzer.
123127

124128
**Key concepts:**
125129
- Updating analyzer description

sdk/contentunderstanding/azure-ai-contentunderstanding/samples/async_samples/sample_update_analyzer_async.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
- Description: Update the analyzer's description
1616
- Tags: Add or update tags
1717
18-
To change create-only properties such as models, field_schema, config, base_analyzer_id,
18+
To change create-only properties such as models, field_schema, config,
1919
dynamic_field_schema, processing_location, or knowledge_sources, use begin_create_analyzer
20-
with allow_replace=True.
20+
with allow_replace=True. If base_analyzer_id is included in an update request, it must
21+
match the existing analyzer.
2122
2223
USAGE:
2324
python sample_update_analyzer_async.py
@@ -98,7 +99,8 @@ async def main() -> None:
9899
print(f" Tags: {tags_str}")
99100

100101
# Create an updated analyzer with the properties supported by update_analyzer.
101-
# Other analyzer properties are create-only and require begin_create_analyzer(..., allow_replace=True).
102+
# Keep base_analyzer_id unchanged; other create-only properties require
103+
# begin_create_analyzer(..., allow_replace=True).
102104
updated_analyzer = ContentAnalyzer(
103105
base_analyzer_id=current_analyzer.base_analyzer_id,
104106
description="Updated description",

sdk/contentunderstanding/azure-ai-contentunderstanding/samples/sample_update_analyzer.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
- Description: Update the analyzer's description
1616
- Tags: Add or update tags
1717
18-
To change create-only properties such as models, field_schema, config, base_analyzer_id,
18+
To change create-only properties such as models, field_schema, config,
1919
dynamic_field_schema, processing_location, or knowledge_sources, use begin_create_analyzer
20-
with allow_replace=True.
20+
with allow_replace=True. If base_analyzer_id is included in an update request, it must
21+
match the existing analyzer.
2122
2223
USAGE:
2324
python sample_update_analyzer.py
@@ -96,7 +97,8 @@ def main() -> None:
9697
print(f" Tags: {tags_str}")
9798

9899
# Create an updated analyzer with the properties supported by update_analyzer.
99-
# Other analyzer properties are create-only and require begin_create_analyzer(..., allow_replace=True).
100+
# Keep base_analyzer_id unchanged; other create-only properties require
101+
# begin_create_analyzer(..., allow_replace=True).
100102
updated_analyzer = ContentAnalyzer(
101103
base_analyzer_id=current_analyzer.base_analyzer_id,
102104
description="Updated description",

0 commit comments

Comments
 (0)