File tree 2 files changed +4
-4
lines changed
app/ui/src/components/Dashboard
server/src/handlers/api/v1/bot/playground
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,8 @@ export const DashboardGrid = () => {
66
66
</ div >
67
67
68
68
< 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 } >
71
71
{ sources [ source . type as keyof typeof sources ] }
72
72
</ span >
73
73
) ) }
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export const chatRequestHandler = async (
76
76
const botResponse = await chain . invoke ( {
77
77
question : sanitizedQuestion ,
78
78
chat_history : groupMessagesByConversation (
79
- history . map ( ( message ) => ( {
79
+ history . slice ( - bot . noOfChatHistoryInContext ) . map ( ( message ) => ( {
80
80
type : message . type ,
81
81
content : message . text ,
82
82
} ) )
@@ -193,7 +193,7 @@ export const chatRequestStreamHandler = async (
193
193
const stream = await chain . stream ( {
194
194
question : sanitizedQuestion ,
195
195
chat_history : groupMessagesByConversation (
196
- history . map ( ( message ) => ( {
196
+ history . slice ( - bot . noOfChatHistoryInContext ) . map ( ( message ) => ( {
197
197
type : message . type ,
198
198
content : message . text ,
199
199
} ) )
You can’t perform that action at this time.
0 commit comments