File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
app/components/realtime-chat Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export function RealtimeChat({
76
76
? { type : "server_vad" }
77
77
: null ;
78
78
clientRef . current . configure ( {
79
- instructions : "Hi " ,
79
+ instructions : "" ,
80
80
input_audio_transcription : { model : "whisper-1" } ,
81
81
turn_detection : turnDetection ,
82
82
tools : [ ] ,
@@ -86,6 +86,19 @@ export function RealtimeChat({
86
86
startResponseListener ( ) ;
87
87
88
88
setIsConnected ( true ) ;
89
+ try {
90
+ const recentMessages = chatStore . getMessagesWithMemory ( ) ;
91
+ for ( const message of recentMessages ) {
92
+ const { role, content } = message ;
93
+ await clientRef . current . sendItem ( {
94
+ type : "message" ,
95
+ role,
96
+ content : [ { type : "input_text" , text : content } ] ,
97
+ } ) ;
98
+ }
99
+ } catch ( error ) {
100
+ console . error ( "Set message failed:" , error ) ;
101
+ }
89
102
} catch ( error ) {
90
103
console . error ( "Connection failed:" , error ) ;
91
104
} finally {
You can’t perform that action at this time.
0 commit comments