hit-cxf
2026-04-23 2f48fc1d4c80a4c25a04d5f4e1e6c19fbb3528db
FilmAgent/test_full.py
@@ -7,6 +7,7 @@
# TO DO
ROOT_PATH = "/path/to/FilmAgent"
ID = 15
model = "gpt-4o"
# TO DO
topics=["Reconcilation in a friend reunion", "A quarrel and breakup scene", "Casual meet-up with an old friend", "Emergency meeting after a security breach", "Late night brainstorming for a startup", "Family argument during dinner", "Emotional farewell at the roadside", "Heated debate over investments in the office", "Heated family discussion ending in a heartfelt apology", "Office gossip turning into a major understanding", "Celebratory end of project cheers with team members", "Planning a secret escape from a mundane routine", "Unexpected guest crashes a small house party", "An employee's emotional breakdown after being terminated", "Confession of a long-held secret among close friends"]
@@ -63,7 +64,7 @@
        prompt = read_prompt(os.path.join(ROOT_PATH, f"Prompt\{identity}.txt") )
        prompt = prompt_format(prompt, params)
        log_prompt(self.log_path, prompt)
        result = GPTCall(prompt)
        result = LLMCall(prompt, model)
        if trans2json:
            result = clean_text(result)
            result = GPTResponse2JSON(result)
@@ -341,7 +342,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":
@@ -501,7 +504,7 @@
        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)
        for scene_id, scene in result1.items():
            for shot_id, shot in scene.items():
                shot.pop("reasoning")
@@ -573,7 +576,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()))):
@@ -713,4 +717,4 @@
    print("Director discusses with cinematographer about the shots >>>")
    f.stage3_verify()
    print("Script cleaning >>>")
    f.clean_script()
    f.clean_script()