diff --git a/python/packages/declarative/agent_framework_declarative/_workflows/__init__.py b/python/packages/declarative/agent_framework_declarative/_workflows/__init__.py index a1d098a014..c199e4551b 100644 --- a/python/packages/declarative/agent_framework_declarative/_workflows/__init__.py +++ b/python/packages/declarative/agent_framework_declarative/_workflows/__init__.py @@ -25,6 +25,7 @@ from ._declarative_base import ( LoopIterationResult, ) from ._declarative_builder import ALL_ACTION_EXECUTORS, DeclarativeWorkflowBuilder +from ._errors import DeclarativeActionError, DeclarativeWorkflowError from ._executors_agents import ( AGENT_ACTION_EXECUTORS, AGENT_REGISTRY_KEY, @@ -82,7 +83,7 @@ from ._executors_tools import ( ToolApprovalState, ToolInvocationResult, ) -from ._factory import DeclarativeActionError, DeclarativeWorkflowError, WorkflowFactory +from ._factory import WorkflowFactory from ._http_handler import ( DefaultHttpRequestHandler, HttpRequestHandler, diff --git a/python/packages/declarative/agent_framework_declarative/_workflows/_errors.py b/python/packages/declarative/agent_framework_declarative/_workflows/_errors.py index 452203268f..e3372ebf06 100644 --- a/python/packages/declarative/agent_framework_declarative/_workflows/_errors.py +++ b/python/packages/declarative/agent_framework_declarative/_workflows/_errors.py @@ -6,12 +6,8 @@ This module exists so that executor modules and the builder (e.g. ``_executors_http``, ``_declarative_builder``) can raise declarative-specific exceptions without importing from ``_factory``. ``_factory`` imports ``_declarative_builder`` which imports the executor modules; pulling -``DeclarativeWorkflowError`` from ``_factory`` into an executor or builder -module would therefore introduce a circular import. - -``_factory`` re-exports :class:`DeclarativeWorkflowError` (and -:class:`DeclarativeActionError`) for convenience so existing import paths keep -working. +:class:`DeclarativeWorkflowError` from ``_factory`` into an executor or +builder module would therefore introduce a circular import. """ from __future__ import annotations diff --git a/python/packages/declarative/agent_framework_declarative/_workflows/_factory.py b/python/packages/declarative/agent_framework_declarative/_workflows/_factory.py index 36f088b05f..d1e21d76e9 100644 --- a/python/packages/declarative/agent_framework_declarative/_workflows/_factory.py +++ b/python/packages/declarative/agent_framework_declarative/_workflows/_factory.py @@ -27,15 +27,13 @@ from agent_framework import ( from .._loader import AgentFactory from ._declarative_builder import DeclarativeWorkflowBuilder -from ._errors import DeclarativeActionError, DeclarativeWorkflowError +from ._errors import DeclarativeWorkflowError from ._http_handler import HttpRequestHandler logger = logging.getLogger("agent_framework.declarative") -# Re-export DeclarativeWorkflowError (now defined in _errors) so existing -# import paths (`from .._factory import DeclarativeWorkflowError`) keep working. -__all__ = ["DeclarativeActionError", "DeclarativeWorkflowError", "WorkflowFactory"] +__all__ = ["WorkflowFactory"] class WorkflowFactory: diff --git a/python/packages/declarative/tests/test_workflow_factory.py b/python/packages/declarative/tests/test_workflow_factory.py index e313f78799..720bca3498 100644 --- a/python/packages/declarative/tests/test_workflow_factory.py +++ b/python/packages/declarative/tests/test_workflow_factory.py @@ -4,10 +4,8 @@ import pytest -from agent_framework_declarative._workflows._factory import ( - DeclarativeWorkflowError, - WorkflowFactory, -) +from agent_framework_declarative._workflows._errors import DeclarativeWorkflowError +from agent_framework_declarative._workflows._factory import WorkflowFactory try: import powerfx # noqa: F401