Zhenran Xu
2025-02-06 c5b7425e2c239bc63fec6d1213b5b336f2865efd
FilmAgent/main.py
@@ -334,7 +334,9 @@
        suggestions = ""
        for name, suggestion in feedback.items():
            suggestions = suggestions + f"   - **{name}**: {suggestion}\n"
        params = {"{suggestions}": suggestions}
        params = {"{suggestions}": suggestions,
                  "{character_profiles}": profiles,
                  "{draft_script}": scenes}
        result = self.call("director_5", params)
        
        if result[return_most_similar("adopted-suggestions", list(result.keys()))] == "None":
@@ -495,7 +497,8 @@
        all_shots = read_prompt(self.shot_description_path)   
        params = {"{script}": script, "{all_shots}": all_shots}
        result1 = self.call("cinematographer", params)
        result2 = self.call("director_8", params)
        result2 = self.call("cinematographer", params)
        # result2 = self.call("director_8", params)
        for scene_id, scene in result1.items():
            for shot_id, shot in scene.items():
                shot.pop("reasoning")
@@ -567,7 +570,8 @@
                    "{all_shots}": all_shots
                    }
        result = self.call("director_9", params)
        last_shots = current_shot_d if result['better'].lower()=="director" else current_shot_c
        last_shots = current_shot_d if result['better']=="1" else current_shot_c
        # last_shots = current_shot_d if result['better'].lower()=="director" else current_shot_c
        
        assert len(list(last_shots.keys())) == len(scenes)
        for id in range(len(list(last_shots.keys()))):
@@ -707,4 +711,4 @@
    print("Director discusses with cinematographer about the shots >>>")
    f.stage3_verify()
    print("Script cleaning >>>")
    f.clean_script()
    f.clean_script()