Python: [BREAKING]: removed display_name, renamed context_providers, middleware and AggregateContextProvider (#3139)

* removed display_name, renamed context_providers, middleware and AggregateContextProvider

* fixes

* fixed test

* testfix

* removed mistakenly put back test

* updated new test

* rename middlewares to middleware

* middleware fixes
This commit is contained in:
Eduard van Valkenburg
2026-01-13 03:24:07 +01:00
committed by GitHub
Unverified
parent ef44fb4960
commit 203fb7b1c4
80 changed files with 596 additions and 838 deletions
@@ -182,32 +182,11 @@ class DurableAIAgent(AgentProtocol):
"""
self.context = context
self.agent_name = agent_name
self._id = str(uuid.uuid4())
self._name = agent_name
self._display_name = agent_name
self._description = f"Durable agent proxy for {agent_name}"
self.id = str(uuid.uuid4())
self.name = agent_name
self.description = f"Durable agent proxy for {agent_name}"
logger.debug("[DurableAIAgent] Initialized for agent: %s", agent_name)
@property
def id(self) -> str:
"""Get the unique identifier for this agent."""
return self._id
@property
def name(self) -> str | None:
"""Get the name of the agent."""
return self._name
@property
def display_name(self) -> str:
"""Get the display name of the agent."""
return self._display_name
@property
def description(self) -> str | None:
"""Get the description of the agent."""
return self._description
# We return an AgentTask here which is a TaskBase subclass.
# This is an intentional deviation from AgentProtocol which defines run() as async.
# The AgentTask can be yielded in Durable Functions orchestrations and will provide
@@ -1 +0,0 @@
# Copyright (c) Microsoft. All rights reserved.
@@ -6,13 +6,18 @@ This module provides fixtures and configuration for pytest.
"""
import subprocess
import sys
from collections.abc import Iterator, Mapping
from pathlib import Path
from typing import Any
import pytest
import requests
from .testutils import (
# Add the integration_tests directory to the path so testutils can be imported
sys.path.insert(0, str(Path(__file__).parent))
from testutils import (
FunctionAppStartupError,
build_base_url,
cleanup_function_app,
@@ -15,11 +15,10 @@ Usage:
"""
import pytest
from testutils import SampleTestHelper, skip_if_azure_functions_integration_tests_disabled
from agent_framework_azurefunctions._constants import THREAD_ID_HEADER
from .testutils import SampleTestHelper, skip_if_azure_functions_integration_tests_disabled
# Module-level markers - applied to all tests in this file
pytestmark = [
pytest.mark.sample("01_single_agent"),
@@ -15,8 +15,7 @@ Usage:
"""
import pytest
from .testutils import SampleTestHelper, skip_if_azure_functions_integration_tests_disabled
from testutils import SampleTestHelper, skip_if_azure_functions_integration_tests_disabled
# Module-level markers - applied to all tests in this file
pytestmark = [
@@ -19,8 +19,7 @@ import time
import pytest
import requests
from .testutils import (
from testutils import (
SampleTestHelper,
skip_if_azure_functions_integration_tests_disabled,
)
@@ -19,8 +19,7 @@ Usage:
"""
import pytest
from .testutils import SampleTestHelper, skip_if_azure_functions_integration_tests_disabled
from testutils import SampleTestHelper, skip_if_azure_functions_integration_tests_disabled
# Module-level markers - applied to all tests in this file
pytestmark = [
@@ -19,8 +19,7 @@ Usage:
"""
import pytest
from .testutils import SampleTestHelper, skip_if_azure_functions_integration_tests_disabled
from testutils import SampleTestHelper, skip_if_azure_functions_integration_tests_disabled
# Module-level markers - applied to all tests in this file
pytestmark = [
@@ -19,8 +19,7 @@ Usage:
"""
import pytest
from .testutils import SampleTestHelper, skip_if_azure_functions_integration_tests_disabled
from testutils import SampleTestHelper, skip_if_azure_functions_integration_tests_disabled
# Module-level markers - applied to all tests in this file
pytestmark = [
@@ -21,8 +21,7 @@ Usage:
import time
import pytest
from .testutils import SampleTestHelper, skip_if_azure_functions_integration_tests_disabled
from testutils import SampleTestHelper, skip_if_azure_functions_integration_tests_disabled
# Module-level markers - applied to all tests in this file
pytestmark = [
@@ -218,12 +218,10 @@ class TestDurableAIAgent:
assert hasattr(agent, "id")
assert hasattr(agent, "name")
assert hasattr(agent, "description")
assert hasattr(agent, "display_name")
# Verify values
assert agent.name == "TestAgent"
assert agent.description == "Durable agent proxy for TestAgent"
assert agent.display_name == "TestAgent"
assert agent.id is not None # Auto-generated UUID
def test_get_new_thread(self) -> None: