Skip to content

Commit d5eb28e

Browse files
committed
chore: Update DashboardGrid component to fix rendering issue with bot source
1 parent 7ba152e commit d5eb28e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/ui/src/components/Dashboard/DashboardGrid.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ export const DashboardGrid = () => {
6666
</div>
6767

6868
<div className="px-4 my-3 flex flex-wrap gap-2 text-gray-500 text-xs dark:text-gray-400">
69-
{bot.source.map((source: any) => (
70-
<span title={`${source.type} source`}>
69+
{bot.source.map((source: any, idx: number) => (
70+
<span title={`${source.type} source`} key={idx}>
7171
{sources[source.type as keyof typeof sources]}
7272
</span>
7373
))}

server/src/handlers/api/v1/bot/playground/chat.handler.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const chatRequestHandler = async (
7676
const botResponse = await chain.invoke({
7777
question: sanitizedQuestion,
7878
chat_history: groupMessagesByConversation(
79-
history.map((message) => ({
79+
history.slice(-bot.noOfChatHistoryInContext).map((message) => ({
8080
type: message.type,
8181
content: message.text,
8282
}))
@@ -193,7 +193,7 @@ export const chatRequestStreamHandler = async (
193193
const stream = await chain.stream({
194194
question: sanitizedQuestion,
195195
chat_history: groupMessagesByConversation(
196-
history.map((message) => ({
196+
history.slice(-bot.noOfChatHistoryInContext).map((message) => ({
197197
type: message.type,
198198
content: message.text,
199199
}))

0 commit comments

Comments
 (0)