Skip to content

Commit

Permalink
🪨 fix: Formatting Edge Case Handling for Bedrock Messages (#4016)
Browse files Browse the repository at this point in the history
* refactor: Remove console.log statement in SelectDropDown component

* fix(bedrock): edge case - message.content as string creating message formatting issue
  • Loading branch information
danny-avila authored Sep 12, 2024
1 parent c3dc03b commit 9a393be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions api/app/clients/prompts/formatMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ const formatAgentMessages = (payload) => {
const messages = [];

for (const message of payload) {
if (typeof message.content === 'string') {
message.content = [{ type: ContentTypes.TEXT, [ContentTypes.TEXT]: message.content }];
}
if (message.role !== 'assistant') {
messages.push(formatMessage({ message, langChain: true }));
continue;
Expand Down
1 change: 0 additions & 1 deletion client/src/components/ui/SelectDropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ function SelectDropDown({
const hasSearchRender = searchRender != null;
const options = hasSearchRender ? filteredValues : availableValues;

console.log({ hasSearchRender, options });
const renderIcon = showOptionIcon && value != null && (value as OptionWithIcon).icon != null;

return (
Expand Down

0 comments on commit 9a393be

Please sign in to comment.