kopia lustrzana https://github.com/biobootloader/wolverine
commit
472e8b5a87
|
@ -23,7 +23,7 @@ _warning!_ By default wolverine uses GPT-4 and may make many repeated calls to t
|
|||
|
||||
To run with gpt-4 (the default, tested option):
|
||||
|
||||
python wolverine.py buggy_script.py "subtract" 20 3
|
||||
python wolverine.py examples/buggy_script.py "subtract" 20 3
|
||||
|
||||
You can also run with other models, but be warned they may not adhere to the edit format as well:
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import sys
|
||||
import fire
|
||||
"""
|
||||
Run With: `wolverine examples/buggy_script.py "subtract" 20 3`
|
||||
Purpose: Show self-regenerating fixing of subtraction operator
|
||||
"""
|
||||
|
||||
def add_numbers(a, b):
|
||||
return a + b
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env python3
|
||||
import fire
|
||||
|
||||
"""
|
||||
Run With: with `python wolverine.py examples/buggy_script_2.py`
|
||||
Purpose: Fix singleton code bug in Python
|
||||
"""
|
||||
|
||||
class SingletonClass(object):
|
||||
def __new__(cls):
|
||||
cls.instance = super(SingletonClass, cls).__new__(cls)
|
||||
return cls.instance
|
||||
|
||||
def check_singleton_works():
|
||||
"""
|
||||
check that singleton pattern is working
|
||||
"""
|
||||
singleton = SingletonClass()
|
||||
new_singleton = SingletonClass()
|
||||
singleton.a = 1
|
||||
new_singleton.a = 2
|
||||
should_be_4 = (singleton.a + new_singleton.a)
|
||||
assert should_be_4 == 4
|
||||
|
||||
if __name__=="__main__":
|
||||
fire.Fire(check_singleton_works)
|
||||
|
Ładowanie…
Reference in New Issue