-
Notifications
You must be signed in to change notification settings - Fork 1k
Python: Add kwargs to create_agent method #3265
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds flexibility to the create_agent() method by accepting arbitrary keyword arguments that are passed through to PromptAgentDefinition, enabling users to specify additional parameters like RAI (Responsible AI) policies for content filtering.
Changes:
- Added
**kwargsparameter toAzureAIProjectAgentProvider.create_agent()method with corresponding documentation - Added a new sample demonstrating content filtering using
RaiConfigwith Azure AI agents - Updated the samples README to document the new content filtering example
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
python/packages/azure-ai/agent_framework_azure_ai/_project_provider.py |
Added **kwargs parameter to create_agent() method and merges kwargs into the args dict passed to PromptAgentDefinition |
python/samples/getting_started/agents/azure_ai/azure_ai_with_content_filtering.py |
New sample demonstrating how to use RaiConfig for content filtering with Azure AI agents |
python/samples/getting_started/agents/azure_ai/README.md |
Added documentation entry for the new content filtering sample |
| agent = await provider.create_agent( | ||
| name="ContentFilteredAgent", | ||
| instructions="You are a helpful assistant.", | ||
| rai_config=RaiConfig(rai_policy_name=rai_policy_name), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this just be something we add to this agent's specific Default Options so that all options pass through default_options?
Motivation and Context
Resolves: #1571
**kwargstocreate_agent()method onAzureAIProjectAgentProviderto pass additional parameters toPromptAgentDefinitionwhen creating an agent.RaiConfig) usage.Contribution Checklist