JARVIS icon indicating copy to clipboard operation
JARVIS copied to clipboard

`<GENERATED>` tag without dep fails

Open emillykkejensen opened this issue 1 year ago • 1 comments

So I might have pulled your code apart, but anyway I found what I believe is a bug. What happens, if the task is returned with a <GENERATED> tag without dep? I presume that would make sense for the first task, as it doesn't rely on anything?

Anyways - I think a simple regex could do:

def fix_dep(tasks):
    for task in tasks:
        args = task["args"]
        task["dep"] = []
        for k, v in args.items():
            if re.match(r'<GENERATED>.+', v): # Do nothing if there is no dependency
                dep_task_id = int(v.split("-")[1])
                if dep_task_id not in task["dep"]:
                    task["dep"].append(dep_task_id)
        if len(task["dep"]) == 0:
            task["dep"] = [-1]
    return tasks

https://github.com/microsoft/JARVIS/blob/8d925aa33ff058375d1c891fffc63a65150d5009/server/awesome_chat.py#L245

emillykkejensen avatar Apr 13 '23 11:04 emillykkejensen

What does "dep=[-1]" mean ?

827648313 avatar Dec 11 '23 03:12 827648313