From 51929be086c1df6940b509f8e6eaf801b716000e Mon Sep 17 00:00:00 2001 From: Ismail Pelaseyed Date: Sun, 25 Jun 2023 14:04:44 +0200 Subject: [PATCH] Adapt tests --- package.json | 2 +- src/superagent.d.ts | 4 +--- src/superagent.js | 14 +++++--------- test/sdk.test.js | 4 ++-- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 7abd604..44592f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "superagentai-js", - "version": "0.0.11", + "version": "0.0.12", "types": "src/superagent.d.ts", "description": "Superagent.sh Javascript SDK", "main": "src/superagent.js", diff --git a/src/superagent.d.ts b/src/superagent.d.ts index 1521a35..a2f0211 100644 --- a/src/superagent.d.ts +++ b/src/superagent.d.ts @@ -23,10 +23,8 @@ declare module 'superagentSDK' { name: string; llm: string; type?: string; - has_memory: boolean; - documentId: string; + hasMemory: boolean; promptId: string; - toolId: string; } interface Prediction { diff --git a/src/superagent.js b/src/superagent.js index 7f045db..7c42e67 100644 --- a/src/superagent.js +++ b/src/superagent.js @@ -1,6 +1,6 @@ export default class SuperagentSDK { constructor(authToken) { - this.baseUrl = "https://api.superagent.sh/api/v1"; + this.baseUrl = "http://127.0.0.1:8000/api/v1"; this.authToken = authToken; } @@ -84,19 +84,15 @@ export default class SuperagentSDK { name, llm, type = "REACT", - has_memory, - document_id = null, - prompt_id = null, - tool_id = null, + hasMemory, + promptId = null, }) => await this._request("POST", "/agents", { name, type, llm, - has_memory, - documentId: document_id, - promptId: prompt_id, - toolId: tool_id, + hasMemory, + promptId, }), predict: async ({ id, input, has_streaming }) => await this._request("POST", `/agents/${id}/predict`, { diff --git a/test/sdk.test.js b/test/sdk.test.js index 4906ee8..0a8b3f1 100644 --- a/test/sdk.test.js +++ b/test/sdk.test.js @@ -139,7 +139,7 @@ describe("Agents", () => { const { success, data } = await superagent.agents().create({ name: "Test agent", type: "REACT", - has_memory: true, + hasMemory: true, llm: { provider: "openai-chat", model: "gpt-3.5-turbo" }, }); @@ -166,7 +166,7 @@ describe("Agents", () => { it("should run a single agent", async () => { const { success, data } = await superagent.agents().predict({ id: agent.id, - input: { human_input: "hi" }, + input: { input: "hi" }, has_streaming: false, });