mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 16:32:38 +00:00
address feedback
This commit is contained in:
parent
208fd33048
commit
04e6998d6f
6 changed files with 105 additions and 64 deletions
|
|
@ -345,18 +345,15 @@ def check_protocol_compliance(obj: Any, protocol: Any) -> None:
|
|||
)
|
||||
missing_methods.append((name, "signature_mismatch"))
|
||||
else:
|
||||
# Check if the method is actually implemented in the class
|
||||
method_owner = next(
|
||||
(cls for cls in mro if name in cls.__dict__), None
|
||||
)
|
||||
proto_method = getattr(protocol, name)
|
||||
if method_owner is None:
|
||||
if (
|
||||
method_owner is None
|
||||
or method_owner.__name__ == protocol.__name__
|
||||
):
|
||||
print(mro)
|
||||
missing_methods.append((name, "not_actually_implemented"))
|
||||
elif method_owner.__name__ == protocol.__name__:
|
||||
# Check if it's just a stub (...) or has real implementation
|
||||
proto_source = inspect.getsource(proto_method)
|
||||
if "..." in proto_source:
|
||||
missing_methods.append((name, "not_actually_implemented"))
|
||||
|
||||
if missing_methods:
|
||||
raise ValueError(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue