mirror of
https://github.com/ianarawjo/ChainForge.git
synced 2025-03-14 16:26:45 +00:00
addedmore logic
This commit is contained in:
parent
4c59c8f257
commit
fbc77e0b61
@ -29,7 +29,7 @@ const ScriptNode = ({ data, id }) => {
|
||||
useEffect(() => {
|
||||
if (!data.scriptFiles)
|
||||
setDataPropsForNode(id, { scriptFiles: { f0: '' } });
|
||||
}, []);
|
||||
}, [data.scriptFiles, id, setDataPropsForNode]);
|
||||
|
||||
// Whenever 'data' changes, update the input fields to reflect the current state.
|
||||
useEffect(() => {
|
||||
@ -42,7 +42,7 @@ const ScriptNode = ({ data, id }) => {
|
||||
</div>
|
||||
)
|
||||
}));
|
||||
}, [data.scriptFiles]);
|
||||
}, [data.scriptFiles, handleInputChange]);
|
||||
|
||||
// Add a field
|
||||
const handleAddField = useCallback(() => {
|
||||
|
@ -270,6 +270,12 @@ def execute():
|
||||
for script_path in data['script_paths']:
|
||||
# get the folder of the script_path:
|
||||
script_folder = os.path.dirname(script_path)
|
||||
# check that the script_folder is valid, and it contains __init__.py
|
||||
if not os.path.exists(script_folder):
|
||||
print(script_folder, 'is not a valid script path.')
|
||||
print(os.path.exists(script_folder))
|
||||
continue
|
||||
|
||||
# add it to the path:
|
||||
sys.path.append(script_folder)
|
||||
print(f'added {script_folder} to sys.path')
|
||||
|
@ -8,8 +8,6 @@ DALAI_RESPONSE = None
|
||||
|
||||
openai.api_key = os.environ.get("OPENAI_API_KEY")
|
||||
|
||||
|
||||
|
||||
""" Supported LLM coding assistants """
|
||||
class LLM(Enum):
|
||||
ChatGPT = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user