Remove dead ServiceSettings.to_dict method
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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}}
|
||||
|
||||
Reference in New Issue
Block a user