-
Notifications
You must be signed in to change notification settings - Fork 322
Add capability and non-hero references for Python skills #382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
d7256f9
Add capability and non-hero references for Python skills
LarryOsterman f503869
Fix create_analyzer to begin_create_analyzer LRO in contentunderstand…
Copilot c70b462
Fix get_supported_languages to use TextTranslationClient in translati…
Copilot 6b02b9e
Clarify TextTranslationClient default endpoint in supported languages…
Copilot be5ac84
Fix instrumentation_options API and supported libraries in azure-moni…
Copilot bccd23e
Apply suggestions from code review
LarryOsterman bc0ee82
Apply suggestions from code review
LarryOsterman 506437c
Apply suggestions from code review
LarryOsterman 480222d
Potential fix for pull request finding
LarryOsterman dab5d2b
Apply remaining changes
Copilot c3a1e63
Fix invalid token acquisition example in m365 capabilities reference
Copilot 0e12867
Potential fix for pull request finding
LarryOsterman 187771d
Replace placeholder non-hero scenario files with actionable content
Copilot c17bc5c
Fix variable naming and list iteration in new non-hero scenarios
Copilot d49e62c
Replace Azure SDK boilerplate checklist with Pydantic-specific checks…
Copilot 90f5441
Refine Pydantic checklist: focus v2 patterns item on new code
Copilot fada13f
Fix fastapi-router-py capabilities checklist: replace Azure SDK boile…
Copilot 512a0e9
Potential fix for pull request finding
LarryOsterman 209e777
Fix remaining open review comments: eventgrid event var, transcriptio…
Copilot bfdb692
Fix Authorization header wording in speech-to-text-rest SKILL.md
Copilot de92acc
Polish wording per code review: fabric None guard, transcription key …
Copilot d7fb53a
Address all open PR review comments
Copilot 9c67af1
Polish m365-agents capabilities: improve variable names and context m…
Copilot 407be44
Fix remaining review comments and CI pipeline failure
Copilot bbe36fb
Move import time to top of transcription timeout example
Copilot 8b9dd9e
Fix transcription acceptance criteria: add DefaultAzureCredential as …
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ns/azure-sdk-python/skills/azure-ai-contentsafety-py/references/capabilities.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # azure-ai-contentsafety-py capability coverage | ||
|
|
||
| **SDK/package**: `azure-ai-contentsafety` | ||
|
|
||
| This index maps hero scenarios in `SKILL.md` and links non-hero scenarios documented in dedicated reference files. | ||
|
|
||
| ## Hero scenarios covered in SKILL.md | ||
|
|
||
| - `Analyze Text` | ||
| - `Analyze Image` | ||
| - `Text Blocklist Management` | ||
| - `Severity Levels` | ||
|
|
||
| ## Non-hero scenarios | ||
|
|
||
| - `Harm Categories`: | Category | Description | | ||
| See: [`non-hero-scenarios.md#harm-categories`](non-hero-scenarios.md#harm-categories) | ||
| - `Severity Scale`: | Level | Text Range | Image Range | Meaning | | ||
| See: [`non-hero-scenarios.md#severity-scale`](non-hero-scenarios.md#severity-scale) | ||
| - `Client Types`: | Client | Purpose | | ||
| See: [`non-hero-scenarios.md#client-types`](non-hero-scenarios.md#client-types) | ||
|
|
||
| ## Related deep-dive references | ||
|
|
||
| - [`non-hero-scenarios.md`](non-hero-scenarios.md): Dedicated non-hero examples and implementation notes. | ||
|
|
||
| ## API breadth checklist | ||
|
|
||
| - Verify client/auth mode for the environment before coding. | ||
| - Confirm operation-group/method names against current Microsoft Learn API reference. | ||
| - For Python SDKs with both sync and async clients, document both forms without a blanket preference. | ||
| - Include cleanup/delete paths for created resources in examples. | ||
| - Prefer idempotent create/update operations where available. | ||
| - Validate paging/LRO/error-handling patterns for production paths. |
29 changes: 29 additions & 0 deletions
29
...re-sdk-python/skills/azure-ai-contentsafety-py/references/non-hero-scenarios.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # azure-ai-contentsafety-py non-hero scenarios | ||
|
|
||
| These scenarios are intentionally separate from hero flows in `SKILL.md`. | ||
| They cover secondary/advanced patterns typically used after the primary end-to-end path is working. | ||
|
|
||
| ## Harm Categories | ||
|
|
||
| | Category | Description | | ||
| |----------|-------------| | ||
| | `Hate` | Attacks based on identity (race, religion, gender, etc.) | | ||
| | `Sexual` | Sexual content, relationships, anatomy | | ||
| | `Violence` | Physical harm, weapons, injury | | ||
| | `SelfHarm` | Self-injury, suicide, eating disorders | | ||
|
|
||
| ## Severity Scale | ||
|
|
||
| | Level | Text Range | Image Range | Meaning | | ||
| |-------|------------|-------------|---------| | ||
| | 0 | Safe | Safe | No harmful content | | ||
| | 2 | Low | Low | Mild references | | ||
| | 4 | Medium | Medium | Moderate content | | ||
| | 6 | High | High | Severe content | | ||
|
|
||
| ## Client Types | ||
|
|
||
| | Client | Purpose | | ||
| |--------|---------| | ||
| | `ContentSafetyClient` | Analyze text and images | | ||
| | `BlocklistClient` | Manage custom blocklists | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...e-sdk-python/skills/azure-ai-contentunderstanding-py/references/capabilities.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # azure-ai-contentunderstanding-py capability coverage | ||
|
|
||
| **SDK/package**: `azure-ai-contentunderstanding` | ||
|
|
||
| This index maps hero scenarios in `SKILL.md` and links non-hero scenarios documented in dedicated reference files. | ||
|
|
||
| ## Hero scenarios covered in SKILL.md | ||
|
|
||
| - `Core Workflow` | ||
| - `Prebuilt Analyzers` | ||
| - `Analyze Document` | ||
| - `Access Document Content Details` | ||
|
|
||
| ## Non-hero scenarios | ||
|
|
||
| - `Analyze Image`: Dedicated example and implementation notes. | ||
| See: [`non-hero-scenarios.md#analyze-image`](non-hero-scenarios.md#analyze-image) | ||
| - `Analyze Video`: Dedicated example and implementation notes. | ||
| See: [`non-hero-scenarios.md#analyze-video`](non-hero-scenarios.md#analyze-video) | ||
| - `Analyze Audio`: Dedicated example and implementation notes. | ||
| See: [`non-hero-scenarios.md#analyze-audio`](non-hero-scenarios.md#analyze-audio) | ||
| - `Custom Analyzers`: Create custom analyzers with field schemas for specialized extraction: | ||
| See: [`non-hero-scenarios.md#custom-analyzers`](non-hero-scenarios.md#custom-analyzers) | ||
| - `Analyzer Management`: Dedicated example and implementation notes. | ||
| See: [`non-hero-scenarios.md#analyzer-management`](non-hero-scenarios.md#analyzer-management) | ||
| - `Async Client`: Dedicated example and implementation notes. | ||
| See: [`non-hero-scenarios.md#async-client`](non-hero-scenarios.md#async-client) | ||
| - `Content Types`: | Class | For | Provides | | ||
| See: [`non-hero-scenarios.md#content-types`](non-hero-scenarios.md#content-types) | ||
| - `Model Imports`: Dedicated example and implementation notes. | ||
| See: [`non-hero-scenarios.md#model-imports`](non-hero-scenarios.md#model-imports) | ||
| - `Client Types`: | Client | Purpose | | ||
| See: [`non-hero-scenarios.md#client-types`](non-hero-scenarios.md#client-types) | ||
|
|
||
| ## Related deep-dive references | ||
|
|
||
| - [`non-hero-scenarios.md`](non-hero-scenarios.md): Dedicated non-hero examples and implementation notes. | ||
|
|
||
| ## API breadth checklist | ||
|
|
||
| - Verify client/auth mode for the environment before coding. | ||
| - Confirm operation-group/method names against current Microsoft Learn API reference. | ||
| - For Python SDKs with both sync and async clients, document both forms without a blanket preference. | ||
| - Include cleanup/delete paths for created resources in examples. | ||
| - Prefer idempotent create/update operations where available. | ||
| - Validate paging/LRO/error-handling patterns for production paths. |
181 changes: 181 additions & 0 deletions
181
...python/skills/azure-ai-contentunderstanding-py/references/non-hero-scenarios.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,181 @@ | ||
| # azure-ai-contentunderstanding-py non-hero scenarios | ||
|
|
||
| These scenarios are intentionally separate from hero flows in `SKILL.md`. | ||
| They cover secondary/advanced patterns typically used after the primary end-to-end path is working. | ||
|
|
||
| ## Analyze Image | ||
|
|
||
| ```python | ||
| from azure.ai.contentunderstanding.models import AnalyzeInput | ||
|
|
||
| poller = client.begin_analyze( | ||
| analyzer_id="prebuilt-imageSearch", | ||
| inputs=[AnalyzeInput(url="https://example.com/image.jpg")] | ||
| ) | ||
| result = poller.result() | ||
| content = result.contents[0] | ||
| print(content.markdown) | ||
| ``` | ||
|
|
||
| ## Analyze Video | ||
|
|
||
| ```python | ||
| from azure.ai.contentunderstanding.models import AnalyzeInput | ||
|
|
||
| poller = client.begin_analyze( | ||
| analyzer_id="prebuilt-videoSearch", | ||
| inputs=[AnalyzeInput(url="https://example.com/video.mp4")] | ||
| ) | ||
|
|
||
| result = poller.result() | ||
|
|
||
| # Access video content (AudioVisualContent) | ||
| content = result.contents[0] | ||
|
|
||
| # Get transcript phrases with timing | ||
| for phrase in content.transcript_phrases: | ||
| print(f"[{phrase.start_time} - {phrase.end_time}]: {phrase.text}") | ||
|
|
||
| # Get key frames (for video) | ||
| for frame in content.key_frames: | ||
| print(f"Frame at {frame.time}: {frame.description}") | ||
| ``` | ||
|
|
||
| ## Analyze Audio | ||
|
|
||
| ```python | ||
| from azure.ai.contentunderstanding.models import AnalyzeInput | ||
|
|
||
| poller = client.begin_analyze( | ||
| analyzer_id="prebuilt-audioSearch", | ||
| inputs=[AnalyzeInput(url="https://example.com/audio.mp3")] | ||
| ) | ||
|
|
||
| result = poller.result() | ||
|
|
||
| # Access audio transcript | ||
| content = result.contents[0] | ||
| for phrase in content.transcript_phrases: | ||
| print(f"[{phrase.start_time}] {phrase.text}") | ||
| ``` | ||
|
|
||
| ## Custom Analyzers | ||
|
|
||
| Create custom analyzers with field schemas for specialized extraction: | ||
|
|
||
| ```python | ||
| from azure.ai.contentunderstanding.models import ( | ||
| AnalyzeInput, | ||
| ContentAnalyzer, | ||
| ContentFieldDefinition, | ||
| ContentFieldSchema, | ||
| ) | ||
|
|
||
| # Create custom analyzer - returns an LRO poller; wait for provisioning to complete | ||
| poller = client.begin_create_analyzer( | ||
| analyzer_id="my-invoice-analyzer", | ||
| resource=ContentAnalyzer( | ||
| description="Custom invoice analyzer", | ||
| base_analyzer_id="prebuilt-documentSearch", | ||
| field_schema=ContentFieldSchema( | ||
| fields={ | ||
| "vendor_name": ContentFieldDefinition(type="string"), | ||
| "invoice_total": ContentFieldDefinition(type="number"), | ||
| "line_items": ContentFieldDefinition( | ||
| type="array", | ||
| item_definition=ContentFieldDefinition( | ||
| type="object", | ||
| properties={ | ||
| "description": ContentFieldDefinition(type="string"), | ||
| "amount": ContentFieldDefinition(type="number"), | ||
| }, | ||
| ), | ||
| ), | ||
| } | ||
| ), | ||
| ), | ||
| ) | ||
| poller.result() # wait until analyzer is ready | ||
|
|
||
| # Use custom analyzer | ||
| analyze_poller = client.begin_analyze( | ||
| analyzer_id="my-invoice-analyzer", | ||
| inputs=[AnalyzeInput(url="https://example.com/invoice.pdf")] | ||
| ) | ||
|
|
||
| result = analyze_poller.result() | ||
|
|
||
| # Access extracted fields from analyzed content | ||
| content = result.contents[0] | ||
| print(content.fields["vendor_name"].value_string) | ||
| print(content.fields["invoice_total"].value_number) | ||
| ``` | ||
|
|
||
| ## Analyzer Management | ||
|
|
||
| ```python | ||
| # List all analyzers | ||
| analyzers = client.list_analyzers() | ||
| for analyzer in analyzers: | ||
| print(f"{analyzer.analyzer_id}: {analyzer.description}") | ||
|
|
||
| # Get specific analyzer | ||
| analyzer = client.get_analyzer("prebuilt-documentSearch") | ||
|
|
||
| # Delete custom analyzer | ||
| client.delete_analyzer("my-custom-analyzer") | ||
| ``` | ||
|
|
||
| ## Async Client | ||
|
|
||
| ```python | ||
| import asyncio | ||
| import os | ||
| from azure.ai.contentunderstanding.aio import ContentUnderstandingClient | ||
| from azure.ai.contentunderstanding.models import AnalyzeInput | ||
| from azure.identity.aio import DefaultAzureCredential | ||
|
|
||
| async def analyze_document(): | ||
| endpoint = os.environ["CONTENTUNDERSTANDING_ENDPOINT"] | ||
| async with DefaultAzureCredential() as credential: | ||
| async with ContentUnderstandingClient( | ||
| endpoint=endpoint, | ||
| credential=credential | ||
| ) as client: | ||
| poller = await client.begin_analyze( | ||
| analyzer_id="prebuilt-documentSearch", | ||
| inputs=[AnalyzeInput(url="https://example.com/doc.pdf")] | ||
| ) | ||
| result = await poller.result() | ||
| content = result.contents[0] | ||
| return content.markdown | ||
|
|
||
| asyncio.run(analyze_document()) | ||
| ``` | ||
|
|
||
| ## Content Types | ||
|
|
||
| | Class | For | Provides | | ||
| |-------|-----|----------| | ||
| | `DocumentContent` | PDF, images, Office docs | Pages, tables, figures, paragraphs | | ||
| | `AudioVisualContent` | Audio, video files | Transcript phrases, timing, key frames | | ||
|
|
||
| Both derive from `AnalysisContent`, which provides basic information and a markdown representation. | ||
|
|
||
| ## Model Imports | ||
|
|
||
| ```python | ||
| from azure.ai.contentunderstanding.models import ( | ||
| AnalyzeInput, | ||
| AnalyzeResult, | ||
| DocumentContent, | ||
| AudioVisualContent, | ||
| ) | ||
| ``` | ||
|
|
||
| ## Client Types | ||
|
|
||
| | Client | Purpose | | ||
| |--------|---------| | ||
| | `ContentUnderstandingClient` | Sync client for all operations | | ||
| | `ContentUnderstandingClient` (aio) | Async client for all operations | | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...sdk-python/skills/azure-ai-language-conversations-py/references/capabilities.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # azure-ai-language-conversations-py capability coverage | ||
|
|
||
| **SDK/package**: `azure-ai-language-conversations` | ||
|
|
||
| This index maps hero scenarios in `SKILL.md` and links non-hero scenarios documented in dedicated reference files. | ||
|
|
||
| ## Hero scenarios covered in SKILL.md | ||
|
|
||
| - `Core workflow` | ||
|
|
||
| ## Non-hero scenarios | ||
|
|
||
| - `Operational hardening`: Use this section for retries, timeouts, pagination, and cleanup patterns specific to this SDK. | ||
| See: [`non-hero-scenarios.md#operational-hardening`](non-hero-scenarios.md#operational-hardening) | ||
|
|
||
| ## Related deep-dive references | ||
|
|
||
| - [`non-hero-scenarios.md`](non-hero-scenarios.md): Dedicated non-hero examples and implementation notes. | ||
|
|
||
| ## API breadth checklist | ||
|
|
||
| - Verify client/auth mode for the environment before coding. | ||
| - Confirm operation-group/method names against current Microsoft Learn API reference. | ||
| - For Python SDKs with both sync and async clients, document both forms without a blanket preference. | ||
| - Include cleanup/delete paths for created resources in examples. | ||
| - Prefer idempotent create/update operations where available. | ||
| - Validate paging/LRO/error-handling patterns for production paths. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.