Remove dead ServiceSettings.to_dict method

This commit is contained in:
Paul Kompfner
2026-02-17 15:15:18 -05:00
parent 1cad4210ce
commit 94a651cee2
2 changed files with 0 additions and 16 deletions

View File

@@ -228,18 +228,6 @@ class ServiceSettings:
instance.extra = extra
return instance
def to_dict(self) -> Dict[str, Any]:
"""Serialize to a flat dictionary, including extra.
Only given (non-``NOT_GIVEN``) values are included. This is the
inverse of ``from_mapping`` and useful for passing settings to APIs
that expect plain dicts.
Returns:
A flat dictionary of all given settings.
"""
return self.given_fields()
def copy(self: _S) -> _S:
"""Return a deep copy of this settings instance.

View File

@@ -75,10 +75,6 @@ class TestServiceSettings:
result = s.given_fields()
assert result == {"model": "gpt-4o", "custom_key": 42}
def test_to_dict(self):
s = ServiceSettings(model="gpt-4o")
assert s.to_dict() == {"model": "gpt-4o"}
def test_copy_is_deep(self):
s = ServiceSettings(model="gpt-4o")
s.extra = {"nested": {"a": 1}}