Skip to content

Commit a4267d4

Browse files
committed
fix: fixing some bugs
1 parent a93023b commit a4267d4

File tree

2 files changed

+2
-32
lines changed

2 files changed

+2
-32
lines changed

backend/src/chat/chat.resolver.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff 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 {

frontend/src/hooks/useChatStream.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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: {

0 commit comments

Comments
 (0)