File tree Expand file tree Collapse file tree 2 files changed +2
-32
lines changed
Expand file tree Collapse file tree 2 files changed +2
-32
lines changed Original file line number Diff line number Diff line change @@ -98,38 +98,6 @@ export class ChatResolver {
9898 }
9999 }
100100
101- @Mutation ( ( ) => String )
102- @JWTAuth ( )
103- async triggerAgentChatStream (
104- @Args ( 'input' ) input : ChatInput ,
105- ) : Promise < string > {
106- try {
107- const iterator = this . chatProxyService . streamChat ( input ) ;
108- let accumulatedContent = '' ;
109-
110- for await ( const chunk of iterator ) {
111- if ( chunk ) {
112- // const enhancedChunk = {
113- // ...chunk,
114- // chatId: input.chatId,
115- // };
116- // await this.pubSub.publish(`chat_stream_${input.chatId}`, {
117- // chatStream: enhancedChunk,
118- // });
119-
120- if ( chunk . choices [ 0 ] ?. delta ?. content ) {
121- accumulatedContent += chunk . choices [ 0 ] . delta . content ;
122- }
123- }
124- }
125-
126- return accumulatedContent ;
127- } catch ( error ) {
128- this . logger . error ( 'Error in triggerChatStream:' , error ) ;
129- throw error ;
130- }
131- }
132-
133101 @Query ( ( ) => [ String ] , { nullable : true } )
134102 async getAvailableModelTags ( ) : Promise < string [ ] > {
135103 try {
Original file line number Diff line number Diff line change @@ -137,6 +137,8 @@ export const useChatStream = ({
137137 setMessages ( ( prev ) => [ ...prev , newMessage ] ) ;
138138
139139 if ( ! currentChatId ) {
140+ console . log ( 'currentChatId: ' + currentChatId ) ;
141+ console . log ( 'Creating new chat...' ) ;
140142 try {
141143 await createChat ( {
142144 variables : {
You can’t perform that action at this time.
0 commit comments