socketteer / loom

Multiversal tree writing interface for human-AI collaboration
1.02k stars 75 forks source link

TypeError: 'str' object does not support item assignment #5

Open markojak opened 1 year ago

markojak commented 1 year ago

This is epic, can't wait to enter the LoomSpace!

I'm experiencing an error where any keyboard input throws a str item assignment error - I suspect this is related to the string being immutable and needing to convert the string into a list.

Can you help me do a workaround for this?

Current Environment:

Full error:

Traceback (most recent call last):
  File "/opt/homebrew/anaconda3/lib/python3.9/tkinter/__init__.py", line 1892, in __call__
    return self.func(*args)
  File "/Users/chiron/workspace/10Weaver/loom/components/modules.py", line 1206, in submit
    self.callbacks["Submit"]["callback"](text=modified_text, auto_response=self.settings().get("auto_response", True))
  File "/Users/chiron/workspace/10Weaver/loom/controller.py", line 49, in <lambda>
    return lambda event=None, *args, _f=f, **kwargs: _f(*args, **kwargs)
  File "/Users/chiron/workspace/10Weaver/loom/util/util.py", line 355, in f
    return func(*args, **kwargs)
  File "/Users/chiron/workspace/10Weaver/loom/controller.py", line 2004, in submit
    new_child = self.create_child(toggle_edit=False)
  File "/Users/chiron/workspace/10Weaver/loom/util/util.py", line 355, in f
    return func(*args, **kwargs)
  File "/Users/chiron/workspace/10Weaver/loom/controller.py", line 563, in create_child
    new_child = self.state.create_child(parent=node)
  File "/Users/chiron/workspace/10Weaver/loom/model.py", line 815, in create_child
    self.rebuild_tree()
  File "/Users/chiron/workspace/10Weaver/loom/model.py", line 36, in wrapper
    output = func(self, *args, **kwargs)
  File "/Users/chiron/workspace/10Weaver/loom/model.py", line 477, in rebuild_tree
    self.tree_node_dict = {d["id"]: d for d in flatten_tree(self.tree_raw_data["root"])}
  File "/Users/chiron/workspace/10Weaver/loom/util/util_tree.py", line 314, in flatten_tree
    child["parent_id"] = d["id"]
TypeError: 'str' object does not support item assignment