diff --git a/ldp/alg/optimizer/ape.py b/ldp/alg/optimizer/ape.py index de0529a..5d25a52 100644 --- a/ldp/alg/optimizer/ape.py +++ b/ldp/alg/optimizer/ape.py @@ -196,7 +196,7 @@ def aggregate_trajectory(self, trajectory: Trajectory) -> None: # m is a Message with a result of the LLM. Which completes only strings. # and we checked the result exists above. x = next( - cast(str, m.content) + cast(str, m.content) for m in result.prompt if (isinstance(m, Message) and m.role == "user") )