Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit e222913

Browse files
authored
Merge pull request #32 from SciPhi-AI/feature/fix-bad-pr
Feature/fix bad pr
2 parents 35bc773 + 682ea01 commit e222913

File tree

2 files changed

+15
-22
lines changed

2 files changed

+15
-22
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "r2r-js",
3-
"version": "1.0.36",
3+
"version": "1.0.37",
44
"description": "",
55
"main": "dist/index.js",
66
"browser": "dist/index.browser.js",

src/r2rClient.ts

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -295,31 +295,24 @@ export class r2rClient {
295295
console.log("Request headers:", this.axiosInstance.defaults.headers);
296296

297297

298-
private async streamRag(
299-
request: R2RRAGRequest
300-
): Promise<ReadableStream<Uint8Array> | null> {
301-
const response = await fetch(`${this.baseUrl}/rag`, {
302-
method: 'POST',
303-
headers: {
304-
'Content-Type': 'application/json',
305-
// Add any other headers you need, like authentication
306-
},
307-
body: JSON.stringify(request),
308-
});
309-
310-
if (!response.ok) {
311-
throw new Error(`HTTP error! status: ${response.status}`);
312-
}
313-
314-
return response.body;
315298
}
316299

317300
@feature("streamingRag")
318-
private async streamRag(request: R2RRAGRequest): Promise<ReadableStream> {
319-
const response = await this.axiosInstance.post("/rag", request, {
320-
responseType: "stream",
301+
private async streamRag(request: R2RRAGRequest): Promise<ReadableStream<Uint8Array> | null> {
302+
const response = await fetch(`${this.baseUrl}/rag`, {
303+
method: 'POST',
304+
headers: {
305+
'Content-Type': 'application/json',
306+
// Add any other headers you need, like authentication
307+
},
308+
body: JSON.stringify(request),
321309
});
322-
return response.data;
310+
311+
if (!response.ok) {
312+
throw new Error(`HTTP error! status: ${response.status}`);
313+
}
314+
315+
return response.body;
323316
}
324317

325318
@feature("delete")

0 commit comments

Comments
 (0)