Skip to content

Consider unformatted answers as final answers

Jan Provaznik requested to merge jp-def-answer into master

What does this MR do and why?

Consider unformatted answers as final answers

It's quite common that AI ignores instructions of responses format and respnds with unformatted answer. Usually this answer is correct but we still return default final answer because we fail to get either Action: or Final answer: from response.

This change treats unformatted answers as final answers for zero shot agent, this doesn't impact tool's response much because most of tools (except documentation tool) don't use final_answer.

Related part of the slack discussion:


Tim Zallmann
  20 hours ago
what if we try for now to start, if there is no thought or action or final answer we send the response 1:1 back instead of the error message (cause the answers i saw were correct but not following the format), wdyt?


jprovaznik
  20 hours ago
that was my thinking too - https://gitlab.slack.com/archives/C051K31F30R/p1688373926056999 - the concern is that there is a solid chance this reponse is hallucination

jprovaznik
  20 hours ago
we could try the idea mentioned in the thread to add "unformatted" response as a "Thought:" and re-run prompt with it

Tim Zallmann
  20 hours ago
hmm if we wouldn’t have any of our action words? I mean we are still experimental so rather have hallucinations (that we get reported) then a lot of fallback responses when the actual answer was given.

jprovaznik
  20 hours ago
Yea, I'm not opposed to it, if we accept the risk that some portion of answers (no idea how big portion) might be hallucinations. 
@Gosia Ksionek
 (as you are more familiar with prompts) - WDYT about it?

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jan Provaznik

Merge request reports