-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: Extend AnswerBuilder for Agent #9406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Pull Request Test Coverage Report for Build 15186489091Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
@tstadel would you please have a look - is this what you had in mind? |
@vblagoje having all messages in meta is already a big win. Do I get this right, that if I just want to get the last message as answer (and have the others in this message's meta), I still have to put an OutputAdapter after AnswerBuilder? |
No, no @tstadel we added dedicated last_message output in Agent, see this |
So in that sense this PR was all about adding all_messages in meta - and slight accommodation of not checking that each messages has text and raising ValueError in that case. That constraint or prerequisite seems a bit drastic in this day and age of tool calling and multimodality so I removed it. I'm hoping that this slight change won't cause any issues to existing usage of AnswerBuilder - and that's what I would ask you to please think about. 🙏 man |
@vblagoje I think that slight change is fine. But how would I get exactly one Answer (using the last message) having the |
Yeah, I thought I could achieve what you wanted via this minimal change:
I did it this way cause I think it does what you wanted and doesn't cause, hopefully, too many issues to existing pipelines. Update: As last_message in Agent will stay of ChatMessage type - we should figure out how to do the same with connecting [messages] only @tstadel. It seems still ok. Please follow this line of reasoning. In current PR, If we connect Agent's messages output to AB, AB will take the last message from [messages] and assign it to extracted_reply, all_message still being added to the meta as planned. So we seem to be good in that case as well. LMK if I'm overlooking something. |
@tstadel have a look now 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thx a lot 🙏
@vblagoje do you need a review from me as well? |
@anakin87 please do a please focus on 6dd96fd as this unit tests demonstrates nicely what @tstadel asked for. Another thing that I'd love to ask you is if we perhaps need |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some minor comments.
About last_message_only
as run parameter: let's avoid it for the moment, if you agree.
releasenotes/notes/adjust-answer-builder-for-agent-f4428aea59e32809.yaml
Outdated
Show resolved
Hide resolved
Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>
Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Why:
Enhances the AnswerBuilder component to preserve conversation history when processing Agent outputs.
fixes Extend AnswerBuilder to convert only last message for agentic pipelines #9330
Addresses the need to maintain agent message context in GeneratedAnswer objects
Enables seamless integration between Agent components and the AnswerBuilder
What:
How can it be used:
Connect Agent and AnswerBuilder in a pipeline to maintain conversation context:
How did you test it: