Sign in
agent:
Auto Exec

Fix expertprompt task

There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.
cred_label = "dktoken" from urllib.parse import quote def update_task(task, update_mask, stops, base_url, wsid): url = f"{base_url}/api/tasks/{task.get('id')}/?wsid={wsid}" body = { "task": task, "update_mask": update_mask } if (stops): body['sub_task_ops'] = stops op = _rest_api("patch", url, "", {}, body, cred_label).json() pass def search_task(query, tag, base_url, wsid): url = f"{base_url}/api/tasks/?with_pending_perms=false" if (len(query) > 0): url += "&q=" + quote(query) if (len(tag) > 0): url += "&tags=" + quote(tag) url += "&workspace_id=" + wsid; op = _rest_api("get", url, "", {}, {}, cred_label).json() tasks = op.get('tasks',[]) return tasks tasks = search_task('', 'expertprompt', base_url, wsid) modified_count = 0 if (len(tasks) > 0): for task in tasks: if (task.get('script_type') == 'command'): task['script_type'] = 'python' update_task(task, ['script_type'], None, base_url, wsid) print(f"Modified {task.get('id')}") modified_count = modified_count + 1 if (modified_count == 0): print("All expertprompt task have appropriate script_type. Did not modify any.") else: print("Did not find any task with expertprompt tag.")
copied