-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
fix(agent-insights): Filter empty input messages #93409
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
fix(agent-insights): Filter empty input messages #93409
Conversation
return content | ||
.filter((part: any) => part.type === 'text') | ||
.map((part: any) => part.text) | ||
.join('\n'); |
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.
why is this part not needed anymore?
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.
code de-duplication. renderUserMessage
& renderAssistantMessage
became renderTextMessages
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.
yeah that part I saw, but I mean the filter().map().join()
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.
It is still doing it?
function renderTextMessages(content: any) {
if (!Array.isArray(content)) {
return content;
}
return content
.filter((part: any) => part.type === 'text')
.map((part: any) => part.text)
.join('\n');
}
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.
Oh, sorry, I read that diff wrong - looked like we were just returning content. Thanks for clarifying :)
Sometimes we receive messages with not renderable content. This PR filters those messages.
Sometimes we receive messages with not renderable content. This PR filters those messages.
Sometimes we receive messages with not renderable content.

This PR filters those messages.