mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-24 00:52:24 +00:00
fix(python-bridge): allow instance shadowing only for validated config attributes
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
4a0151f77f
commit
d3f2ddba05
2 changed files with 3 additions and 1 deletions
|
|
@ -120,7 +120,7 @@ impl ObjectGuard {
|
|||
if !attributes.get_item(name)?.is(value.bind(py)) {
|
||||
return Ok(false);
|
||||
}
|
||||
if instance.contains(name)? && value.bind(py).is_callable() {
|
||||
if instance.contains(name)? && !self.config_names.contains(&name.as_str()) {
|
||||
return Ok(false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -820,6 +820,8 @@ def test_redis_semantic_configuration_drift_falls_back_to_python(
|
|||
assert resolver.resolve().kind == "python_callback"
|
||||
with rebound(facade.cache, "_index_name", "other-index"):
|
||||
assert resolver.resolve().kind == "python_callback"
|
||||
with rebound(facade.cache, "CACHE_KEY_FIELD_NAME", "other-field"):
|
||||
assert resolver.resolve().kind == "python_callback"
|
||||
|
||||
def patched_embedding(self: object, prompt: str, metadata: object = None) -> list[float]:
|
||||
return _semantic_embedding(prompt)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue