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 23:19:58 +02:00
committed by GitHub
Unverified
parent 647db9635a
commit b4ebafa9b1
56 changed files with 3881 additions and 1735 deletions
@@ -340,8 +340,8 @@ class RedisChatMessageStore:
Returns:
JSON string representation of the message.
"""
# Convert ChatMessage to dictionary using Pydantic serialization
message_dict = message.model_dump()
# Convert ChatMessage to dictionary using custom serialization
message_dict = message.to_dict()
# Serialize to compact JSON (no extra whitespace for Redis efficiency)
return json.dumps(message_dict, separators=(",", ":"))
@@ -356,8 +356,8 @@ class RedisChatMessageStore:
"""
# Parse JSON string back to dictionary
message_dict = json.loads(serialized_message)
# Reconstruct ChatMessage using Pydantic validation
return ChatMessage.model_validate(message_dict)
# Reconstruct ChatMessage using custom deserialization
return ChatMessage.from_dict(message_dict)
# ============================================================================
# List-like Convenience Methods (Redis-optimized async versions)
+2 -6
View File
@@ -86,10 +86,6 @@ include = "../../shared_tasks.toml"
mypy = "mypy --config-file $POE_ROOT/pyproject.toml agent_framework_redis"
test = "pytest --cov=agent_framework_redis --cov-report=term-missing:skip-covered tests"
[tool.uv.build-backend]
module-name = "agent_framework_redis"
module-root = ""
[build-system]
requires = ["uv_build>=0.8.2,<0.9.0"]
build-backend = "uv_build"
requires = ["flit-core >= 3.11,<4.0"]
build-backend = "flit_core.buildapi"