@@ -21,7 +21,7 @@ interface Props {
21
21
22
22
export const Chat = memo ( ( { stopConversationRef } : Props ) => {
23
23
const {
24
- state : { selectedConversation, conversations, models , apiKey, pluginKeys } ,
24
+ state : { selectedConversation, conversations, apiKey } ,
25
25
handleUpdateConversation,
26
26
dispatch : homeDispatch ,
27
27
} = useContext ( HomeContext ) ;
@@ -37,7 +37,7 @@ export const Chat = memo(({ stopConversationRef }: Props) => {
37
37
const textareaRef = useRef < HTMLTextAreaElement > ( null ) ;
38
38
39
39
const handleSend = useCallback (
40
- async ( message : Message , deleteCount = 0 , plugin : Plugin | null = null ) => {
40
+ async ( message : Message , deleteCount = 0 ) => {
41
41
if ( selectedConversation ) {
42
42
let updatedConversation : Conversation ;
43
43
if ( deleteCount ) {
@@ -61,27 +61,6 @@ export const Chat = memo(({ stopConversationRef }: Props) => {
61
61
} ) ;
62
62
homeDispatch ( { field : 'loading' , value : true } ) ;
63
63
homeDispatch ( { field : 'messageIsStreaming' , value : true } ) ;
64
- const chatBody : ChatBody = {
65
- model : updatedConversation . model ,
66
- messages : updatedConversation . messages ,
67
- key : apiKey ,
68
- prompt : updatedConversation . prompt ,
69
- temperature : updatedConversation . temperature ,
70
- } ;
71
- let body ;
72
- if ( ! plugin ) {
73
- body = JSON . stringify ( chatBody ) ;
74
- } else {
75
- body = JSON . stringify ( {
76
- ...chatBody ,
77
- googleAPIKey : pluginKeys
78
- . find ( ( key ) => key . pluginId === 'google-search' )
79
- ?. requiredKeys . find ( ( key ) => key . key === 'GOOGLE_API_KEY' ) ?. value ,
80
- googleCSEId : pluginKeys
81
- . find ( ( key ) => key . pluginId === 'google-search' )
82
- ?. requiredKeys . find ( ( key ) => key . key === 'GOOGLE_CSE_ID' ) ?. value ,
83
- } ) ;
84
- }
85
64
if ( updatedConversation . messages . length === 1 ) {
86
65
const { content } = message ;
87
66
const customName =
@@ -246,7 +225,6 @@ QuickSort is an efficient, in-place sorting algorithm that, in practice, outperf
246
225
[
247
226
apiKey ,
248
227
conversations ,
249
- pluginKeys ,
250
228
selectedConversation ,
251
229
stopConversationRef ,
252
230
] ,
@@ -369,7 +347,7 @@ QuickSort is an efficient, in-place sorting algorithm that, in practice, outperf
369
347
onScrollDownClick = { handleScrollDown }
370
348
onRegenerate = { ( ) => {
371
349
if ( currentMessage ) {
372
- handleSend ( currentMessage , 2 , null ) ;
350
+ handleSend ( currentMessage , 2 ) ;
373
351
}
374
352
} }
375
353
showScrollDownButton = { showScrollDownButton }
0 commit comments