Python: Add context_providers and description to workflow.as_agent()#4651
Python: Add context_providers and description to workflow.as_agent()#4651cecheta wants to merge 4 commits intomicrosoft:mainfrom
workflow.as_agent()#4651Conversation
workflow.as_agent()workflow.as_agent()
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
Expands the Python Workflow.as_agent() convenience API to support more WorkflowAgent/BaseAgent configuration so callers don’t need to instantiate WorkflowAgent directly (addresses #4650).
Changes:
- Extend
Workflow.as_agent()to acceptdescription,context_providers, and passthrough**kwargstoWorkflowAgent/BaseAgent. - Add a unit test ensuring
descriptionandcontext_providersare forwarded correctly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/packages/core/agent_framework/_workflows/_workflow.py | Extends Workflow.as_agent() signature and forwards new options into WorkflowAgent. |
| python/packages/core/tests/workflow/test_workflow_agent.py | Adds coverage for forwarding description and context_providers through Workflow.as_agent(). |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
You can also share your feedback on Copilot code review. Take the survey.
| from typing import Any, Literal, overload | ||
|
|
||
| from .._sessions import BaseContextProvider | ||
| from .._types import ResponseStream | ||
| from ..observability import OtelAttr, capture_exception, create_workflow_span | ||
| from ._agent import WorkflowAgent |
There was a problem hiding this comment.
@cecheta LGTM. Could you please address this little comment from Copilot. simply add the following to right above logger = logging.getLogger(__name__):
if TYPE_CHECKING:
from ._agent import WorkflowAgent|
@cecheta, friendly reminder — this issue is waiting on your response. Please share any updates when you get a chance. (This is an automated message.) |
|
Pull request is awaiting review |
Motivation and Context
Closes #4650 #4652
Description
Allow passing more options to
workflow.as_agent(), including context providers and description.Agent name and description now default to the workflow's.
Contribution Checklist