You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python: Add samples syntax checking with pyright (microsoft#3710)
* Add samples syntax checking with pyright
- Add pyrightconfig.samples.json with relaxed type checking but import validation
- Add samples-syntax poe task to check samples for syntax and import errors
- Add samples-syntax to check and pre-commit-check tasks
- Fix 78 sample errors:
- Update workflow builder imports to use agent_framework_orchestrations
- Change content type isinstance checks to content.type comparisons
- Use Content factory methods instead of removed content type classes
- Fix TypedDict access patterns for Annotation
- Fix various API mismatches (normalize_messages, ChatMessage.text, role)
* fixed a bunch of samples and tweaks to pre-commit
* updated lock
* updated lock
* fixes
* added lint to samples
Copy file name to clipboardExpand all lines: python/AGENTS.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,12 @@ from agent_framework.azure import AzureOpenAIChatClient, AzureAIAgentClient
72
72
73
73
When modifying samples, update associated README files in the same or parent folders.
74
74
75
+
### Samples Syntax Checking
76
+
77
+
Run `uv run poe samples-syntax` to check samples for syntax errors and missing imports from `agent_framework`. This uses a relaxed pyright configuration that validates imports without strict type checking.
78
+
79
+
Some samples depend on external packages (e.g., `azure.ai.agentserver.agentframework`, `microsoft_agents`) that are not installed in the dev environment. These are excluded in `pyrightconfig.samples.json`. When adding or modifying these excluded samples, add them to the exclude list and manually verify they have no import errors from `agent_framework` packages by temporarily removing them from the exclude list and running the check.
0 commit comments