dspy
dspy copied to clipboard
`MultiChainComparison` only keeps the first sentence of the rationale. My `rationale` is multiline
Hi, I was using the MultiChainComparison
module and noticed by entire rationale was not being added in the prompts. Digging in the module, I saw that:
for c in completions:
rationale = c.rationale.strip().split("\n")[0].strip()
answer = c[self.last_key].strip().split("\n")[0].strip()
attempts.append(
f"«I'm trying to {rationale} I'm not sure but my prediction is {answer}»",
)
This assumption that rationale and answer can be at max one line seems inaccurate, and at the very least is not intuitive behavior. Wonder if there is a reason it needs to be this way? If not, I can put a quick PR which maintains the more intuitive behavior. Thanks!