Python: [BREAKING] Fix #3613 chat/agent message typing alignment (#3920)

* Fix #3613 message typing across chat and agents

* Address #3613 review feedback and sample input style

* refactor: use shared AgentRunMessages aliases (#3613)

* refactor: rename agent run input aliases for #3613

* samples: inline image content in run calls

* core: export AgentRunInputs from package init

* core: use explicit init re-exports without __all__

* updated logging and inits

* Fix core mypy export and samples XML note

* Remove AgentRunInputsOrNone and dedupe loggers

* Remove prepare_messages helper

* fix integration tests
This commit is contained in:
Eduard van Valkenburg
2026-02-16 15:27:25 +00:00
committed by GitHub
parent 503eb10fdd
commit dc9439a75a
87 changed files with 422 additions and 578 deletions
@@ -9,6 +9,7 @@ with Azure Durable Entities, enabling stateful and durable AI agent execution.
from __future__ import annotations
import json
import logging
import re
import uuid
from collections.abc import Callable, Mapping
@@ -18,7 +19,7 @@ from typing import TYPE_CHECKING, Any, TypeVar, cast
import azure.durable_functions as df
import azure.functions as func
from agent_framework import SupportsAgentRun, get_logger
from agent_framework import SupportsAgentRun
from agent_framework_durabletask import (
DEFAULT_MAX_POLL_RETRIES,
DEFAULT_POLL_INTERVAL_SECONDS,
@@ -42,7 +43,7 @@ from ._entities import create_agent_entity
from ._errors import IncomingRequestError
from ._orchestration import AgentOrchestrationContextType, AgentTask, AzureFunctionsAgentExecutor
logger = get_logger("agent_framework.azurefunctions")
logger = logging.getLogger("agent_framework.azurefunctions")
EntityHandler = Callable[[df.DurableEntityContext], None]
HandlerT = TypeVar("HandlerT", bound=Callable[..., Any])
@@ -10,18 +10,19 @@ allows for long-running agent conversations.
from __future__ import annotations
import asyncio
import logging
from collections.abc import Callable
from typing import Any, cast
import azure.durable_functions as df
from agent_framework import SupportsAgentRun, get_logger
from agent_framework import SupportsAgentRun
from agent_framework_durabletask import (
AgentEntity,
AgentEntityStateProviderMixin,
AgentResponseCallbackProtocol,
)
logger = get_logger("agent_framework.azurefunctions.entities")
logger = logging.getLogger("agent_framework.azurefunctions")
class AzureFunctionEntityStateProvider(AgentEntityStateProviderMixin):
@@ -5,11 +5,12 @@
This module provides support for using agents inside Durable Function orchestrations.
"""
import logging
from collections.abc import Callable
from typing import TYPE_CHECKING, Any, TypeAlias
import azure.durable_functions as df
from agent_framework import AgentSession, get_logger
from agent_framework import AgentSession
from agent_framework_durabletask import (
DurableAgentExecutor,
RunRequest,
@@ -21,7 +22,7 @@ from azure.durable_functions.models.actions.NoOpAction import NoOpAction
from azure.durable_functions.models.Task import CompoundTask, TaskState
from pydantic import BaseModel
logger = get_logger("agent_framework.azurefunctions.orchestration")
logger = logging.getLogger("agent_framework.azurefunctions")
CompoundActionConstructor: TypeAlias = Callable[[list[Any]], Any] | None