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

Commit cca2a90

Browse files
authored
Merge pull request #29 from SciPhi-AI/Nolan/FixKGSettings
Fix KG settings
2 parents 2959481 + 4620db4 commit cca2a90

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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.33",
3+
"version": "1.0.34",
44
"description": "",
55
"main": "dist/index.js",
66
"browser": "dist/index.browser.js",

src/r2rClient.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,10 @@ export class r2rClient {
275275

276276
const kg_search_settings: KGSearchSettings = {
277277
use_kg_search,
278-
agent_generation_config: use_kg_search
279-
? { ...DEFAULT_GENERATION_CONFIG, ...kg_generation_config }
280-
: undefined,
278+
agent_generation_config: {
279+
...DEFAULT_GENERATION_CONFIG,
280+
...kg_generation_config,
281+
},
281282
};
282283

283284
const request: R2RRAGRequest = {
@@ -304,14 +305,10 @@ export class r2rClient {
304305
}
305306

306307
@feature("streamingRag")
307-
private async streamRag(request: R2RRAGRequest): Promise<any> {
308-
const response = await this.axiosInstance.post(
309-
"/rag",
310-
JSON.stringify(request),
311-
{
312-
responseType: "stream",
313-
},
314-
);
308+
private async streamRag(request: R2RRAGRequest): Promise<ReadableStream> {
309+
const response = await this.axiosInstance.post("/rag", request, {
310+
responseType: "stream",
311+
});
315312
return response.data;
316313
}
317314

0 commit comments

Comments
 (0)