Multinut/tests/explain-test.py
Dominik Krenn 12c078cd72 feat: add Explainable class for AI-powered code explanations and examples in README.md
chore: update version to 0.3.1 and add OpenAI dependency in setup.py
2025-09-24 11:06:22 +02:00

20 lines
455 B
Python

from multinut.explain import Explainable, hello
class MyClass(Explainable):
def my_method(self, x):
"""This method does something."""
return x * 2
def another(self, msg: str):
return msg[::-1]
print("=== Class Explanation ===")
print(MyClass.explain())
print("\n=== Method Explanation: my_method ===")
print(MyClass.my_method.explain())
print("\n=== Method Explanation: another ===")
print(MyClass.another.explain())