mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: [BREAKING] added SerializationMixin and applied to contents, agents, chat client… (#1012)
* added SerializationMixin and applied to contents, agents, chat clients, removed AFBaseModel * fix annotations type * mypy fixes * fix tests * fix serializable subvalues and added large docstring * updated indents in code block * fixed exported urls
This commit is contained in:
committed by
GitHub
Unverified
parent
3eb26632ce
commit
54ad135914
@@ -1,3 +0,0 @@
|
||||
# Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
"""Sample tests package."""
|
||||
@@ -1,3 +0,0 @@
|
||||
# Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
"""Getting started sample tests."""
|
||||
+2
-2
@@ -146,7 +146,6 @@ from samples.getting_started.agents.openai.openai_responses_client_with_thread i
|
||||
from samples.getting_started.agents.openai.openai_responses_client_with_web_search import (
|
||||
main as openai_responses_client_with_web_search,
|
||||
)
|
||||
from tests.sample_utils import retry
|
||||
|
||||
# Environment variable for controlling sample tests
|
||||
RUN_SAMPLES_TESTS = "RUN_SAMPLES_TESTS"
|
||||
@@ -579,6 +578,7 @@ agent_samples = [
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.flaky
|
||||
@mark.parametrize("sample, responses", agent_samples)
|
||||
async def test_agent_samples(sample: Callable[..., Awaitable[Any]], responses: list[str], monkeypatch: MonkeyPatch):
|
||||
"""Test agent samples with input mocking and retry logic."""
|
||||
@@ -592,4 +592,4 @@ async def test_agent_samples(sample: Callable[..., Awaitable[Any]], responses: l
|
||||
return responses.pop(0) if responses else "exit"
|
||||
|
||||
monkeypatch.setattr("builtins.input", mock_input)
|
||||
await retry(sample, retries=3, reset=reset)
|
||||
await sample
|
||||
+1
-2
@@ -32,7 +32,6 @@ from samples.getting_started.chat_client.openai_chat_client import (
|
||||
from samples.getting_started.chat_client.openai_responses_client import (
|
||||
main as openai_responses_client,
|
||||
)
|
||||
from tests.sample_utils import retry
|
||||
|
||||
# Environment variable for controlling sample tests
|
||||
RUN_SAMPLES_TESTS = "RUN_SAMPLES_TESTS"
|
||||
@@ -132,4 +131,4 @@ async def test_chat_client_samples(
|
||||
return responses.pop(0) if responses else "exit"
|
||||
|
||||
monkeypatch.setattr("builtins.input", mock_input)
|
||||
await retry(sample, retries=3, reset=reset)
|
||||
await sample
|
||||
+1
-2
@@ -10,7 +10,6 @@ from pytest import MonkeyPatch, mark, param
|
||||
|
||||
from samples.getting_started.threads.custom_chat_message_store_thread import main as threads_custom_store
|
||||
from samples.getting_started.threads.suspend_resume_thread import main as threads_suspend_resume
|
||||
from tests.sample_utils import retry
|
||||
|
||||
# Environment variable for controlling sample tests
|
||||
RUN_SAMPLES_TESTS = "RUN_SAMPLES_TESTS"
|
||||
@@ -51,4 +50,4 @@ async def test_thread_samples(sample: Callable[..., Awaitable[Any]], responses:
|
||||
return responses.pop(0) if responses else "exit"
|
||||
|
||||
monkeypatch.setattr("builtins.input", mock_input)
|
||||
await retry(sample, retries=3, reset=reset)
|
||||
await sample
|
||||
Reference in New Issue
Block a user