From 67e3c2e184ee61023ed0e17d21e3c0720312d4c4 Mon Sep 17 00:00:00 2001 From: jdkessinger Date: Thu, 26 Mar 2026 13:21:39 -0700 Subject: [PATCH 1/2] Silence warning about model_identity conflicting with the protected model_ namespace. ``` .venv/lib/python3.12/site-packages/pydantic/_internal/_fields.py:132 /home/jkessinger/repos/yolo/.venv/lib/python3.12/site-packages/pydantic/_internal/_fields.py:132: UserWarning: Field "model_identity" in SystemContent has conflict with protected namespace "model_". You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`. warnings.warn( ``` --- python/openai_harmony/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/openai_harmony/__init__.py b/python/openai_harmony/__init__.py index c8bce8f..e827688 100644 --- a/python/openai_harmony/__init__.py +++ b/python/openai_harmony/__init__.py @@ -29,7 +29,7 @@ ) import re -from pydantic import BaseModel, Field +from pydantic import BaseModel, DictConfig, Field # Re-export the low-level Rust bindings under a private name so that we can # keep the *public* namespace clean and purely Pythonic. @@ -179,6 +179,7 @@ def python() -> "ToolNamespaceConfig": class SystemContent(Content): + model_config = ConfigDict(protected_namespaces=("model_validate", "model_dump")) model_identity: Optional[str] = ( "You are ChatGPT, a large language model trained by OpenAI." ) From 432710a6a6945669b16978a3f1e034d7e510e693 Mon Sep 17 00:00:00 2001 From: jdkessinger Date: Thu, 26 Mar 2026 13:29:19 -0700 Subject: [PATCH 2/2] Fix the import of ConfigDict It's not DictConfig. That's omegaconf. --- python/openai_harmony/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/openai_harmony/__init__.py b/python/openai_harmony/__init__.py index e827688..7a9a079 100644 --- a/python/openai_harmony/__init__.py +++ b/python/openai_harmony/__init__.py @@ -29,7 +29,7 @@ ) import re -from pydantic import BaseModel, DictConfig, Field +from pydantic import BaseModel, ConfigDict, Field # Re-export the low-level Rust bindings under a private name so that we can # keep the *public* namespace clean and purely Pythonic.