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

Commit

Permalink
Add server stats command
Browse files Browse the repository at this point in the history
  • Loading branch information
NolanTrem committed Aug 1, 2024
1 parent 40b33c1 commit e430da8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions __tests__/r2rClientIntegrationSuperUser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ describe("r2rClient Integration Tests", () => {
).resolves.not.toThrow();
});

test("Server stats", async () => {
await expect(client.serverStats()).resolves.not.toThrow();
});

test("Ingest file", async () => {
const files = [
{ path: "examples/data/raskolnikov.txt", name: "raskolnikov.txt" },
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "r2r-js",
"version": "1.2.13",
"version": "1.2.14",
"description": "",
"main": "dist/index.js",
"browser": "dist/index.browser.js",
Expand Down
5 changes: 5 additions & 0 deletions src/r2rClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ export class r2rClient {
return await this._makeRequest("GET", "health");
}

async serverStats(): Promise<any> {
this._ensureAuthenticated();
return await this._makeRequest("GET", "server_stats");
}

@feature("updatePrompt")
async updatePrompt(
name: string = "default_system",
Expand Down

0 comments on commit e430da8

Please sign in to comment.