Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/components/Bot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
const [feedback, setFeedback] = createSignal('');
const [pendingActionData, setPendingActionData] = createSignal(null);
const [feedbackType, setFeedbackType] = createSignal('');
const [messageRatings, setMessageRatings] = createSignal<Record<string, FeedbackRatingType>>({});

// start input type
const [startInputType, setStartInputType] = createSignal('');
Expand Down Expand Up @@ -579,7 +580,7 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
});
}

scrollToBottom()
scrollToBottom();

let isProgrammaticScroll = false;
const handleScroll = () => {
Expand Down Expand Up @@ -954,7 +955,7 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
if (typeof value === 'object') return Object.keys(value as Record<string, unknown>).length === 0;
return false;
};

const shouldRemoveEmptyApiMessage = (message?: MessageType) => {
if (!message || message.type !== 'apiMessage') return false;
const payload = {
Expand Down Expand Up @@ -2676,6 +2677,8 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
showAvatar={props.botMessage?.showAvatar}
avatarSrc={props.botMessage?.avatarSrc}
chatFeedbackStatus={chatFeedbackStatus()}
messageRatings={messageRatings()}
onMessageRatingChange={(messageId, rating) => setMessageRatings((prev) => ({ ...prev, [messageId]: rating }))}
onRegenerateResponse={() => handleRegenerateResponse(index())}
onMessageRendered={scrollToBottom}
fontSize={props.fontSize}
Expand Down