Python: [Breaking] removed pydantic from types and workflows (#917)

* removed pydantic from types

* fix test

* fix test

* fix tests

* fix assistants client

* Remove Pydantic usage from workflow code.

* updated pydantic removal

* updated lock and test fixes

* fix mypy

* updated build system

* updated chat client parsing

* fix broken test

---------

Co-authored-by: Evan Mattson <evan.mattson@microsoft.com>
This commit is contained in:
Eduard van Valkenburg
2025-09-29 21:19:58 +00:00
committed by GitHub
co-authored by Evan Mattson
parent 647db9635a
commit b4ebafa9b1
56 changed files with 3881 additions and 1735 deletions
@@ -14,7 +14,6 @@ from agent_framework import (
ChatOptions,
ChatResponse,
ChatResponseUpdate,
ChatToolMode,
Contents,
DataContent,
FunctionApprovalRequestContent,
@@ -29,6 +28,7 @@ from agent_framework import (
HostedWebSearchTool,
Role,
TextContent,
ToolMode,
ToolProtocol,
UriContent,
UsageContent,
@@ -483,7 +483,7 @@ class AzureAIAgentClient(BaseChatClient):
raw_representation=event_data,
response_id=response_id,
role=Role.ASSISTANT,
ai_model_id=event_data.model,
model_id=event_data.model,
)
case RunStep():
@@ -628,7 +628,7 @@ class AzureAIAgentClient(BaseChatClient):
if chat_options is not None:
run_options["max_completion_tokens"] = chat_options.max_tokens
run_options["model"] = chat_options.ai_model_id
run_options["model"] = chat_options.model_id
run_options["top_p"] = chat_options.top_p
run_options["temperature"] = chat_options.temperature
run_options["parallel_tool_calls"] = chat_options.allow_multiple_tool_calls
@@ -644,7 +644,7 @@ class AzureAIAgentClient(BaseChatClient):
elif chat_options.tool_choice == "auto":
run_options["tool_choice"] = AgentsToolChoiceOptionMode.AUTO
elif (
isinstance(chat_options.tool_choice, ChatToolMode)
isinstance(chat_options.tool_choice, ToolMode)
and chat_options.tool_choice == "required"
and chat_options.tool_choice.required_function_name is not None
):
@@ -864,7 +864,11 @@ class AzureAIAgentClient(BaseChatClient):
)
results: list[Any] = []
for item in result_contents:
if isinstance(item, BaseModel):
if isinstance(item, Contents):
results.append(
json.dumps(item.to_dict(exclude={"raw_representation", "additional_properties"}))
)
elif isinstance(item, BaseModel):
results.append(item.model_dump_json())
else:
results.append(json.dumps(item))