Skip to content

Commit c41c226

Browse files
committed
🐛 FIX: Thread id null
1 parent 6ed59e6 commit c41c226

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/langbase/src/common/request.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ interface MakeRequestParams {
2828

2929
interface HandleGenerateResponseParams {
3030
response: Response;
31-
isChat: boolean;
3231
threadId: string | null;
3332
rawResponse: boolean;
3433
}
@@ -61,7 +60,6 @@ export class Request {
6160
if (!options.body) {
6261
return this.handleRunResponse({
6362
response,
64-
isChat: false,
6563
threadId: null,
6664
rawResponse: options.body?.rawResponse ?? false,
6765
});
@@ -82,7 +80,6 @@ export class Request {
8280

8381
return this.handleRunResponse({
8482
response,
85-
isChat: options.body?.chat,
8683
threadId,
8784
rawResponse: options.body?.rawResponse ?? false,
8885
});
@@ -182,7 +179,6 @@ export class Request {
182179

183180
private async handleRunResponse({
184181
response,
185-
isChat,
186182
threadId,
187183
rawResponse,
188184
}: HandleGenerateResponseParams): Promise<any> {
@@ -198,7 +194,9 @@ export class Request {
198194
...buildResponse,
199195
};
200196

201-
result.threadId = threadId;
197+
if (threadId) {
198+
result.threadId = threadId;
199+
}
202200

203201
if (rawResponse) {
204202
result.rawResponse = {

0 commit comments

Comments
 (0)