mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: [BREAKING] Renamed AgentProtocol to SupportsAgentRun (#3717)
* Renamed AgentProtocol to AgentLike * Resolved comments * Renamed AgentLike to SupportsAgentRun * Resolved comments
This commit is contained in:
committed by
GitHub
Unverified
parent
ac17adb595
commit
15256bb616
@@ -9,7 +9,6 @@ from typing import Any, Generic, Literal, cast, overload
|
||||
|
||||
import pytest
|
||||
from agent_framework import (
|
||||
AgentProtocol,
|
||||
AgentResponse,
|
||||
AgentResponseUpdate,
|
||||
AgentThread,
|
||||
@@ -20,6 +19,7 @@ from agent_framework import (
|
||||
ChatResponse,
|
||||
ChatResponseUpdate,
|
||||
Content,
|
||||
SupportsAgentRun,
|
||||
)
|
||||
from agent_framework._clients import TOptions_co
|
||||
from agent_framework._middleware import ChatMiddlewareLayer
|
||||
@@ -149,8 +149,8 @@ def stream_from_updates(updates: list[ChatResponseUpdate]) -> StreamFn:
|
||||
return _stream
|
||||
|
||||
|
||||
class StubAgent(AgentProtocol):
|
||||
"""Minimal AgentProtocol stub for orchestrator tests."""
|
||||
class StubAgent(SupportsAgentRun):
|
||||
"""Minimal SupportsAgentRun stub for orchestrator tests."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@@ -238,6 +238,6 @@ def stream_from_updates_fixture() -> Callable[[list[ChatResponseUpdate]], Stream
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def stub_agent() -> type[AgentProtocol]:
|
||||
def stub_agent() -> type[SupportsAgentRun]:
|
||||
"""Return the StubAgent class for creating test instances."""
|
||||
return StubAgent # type: ignore[return-value]
|
||||
|
||||
@@ -26,7 +26,7 @@ def build_chat_client(streaming_chat_client_stub, stream_from_updates_fixture):
|
||||
|
||||
|
||||
async def test_add_endpoint_with_agent_protocol(build_chat_client):
|
||||
"""Test adding endpoint with raw AgentProtocol."""
|
||||
"""Test adding endpoint with raw SupportsAgentRun."""
|
||||
app = FastAPI()
|
||||
agent = ChatAgent(name="test", instructions="Test agent", chat_client=build_chat_client())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user