Skip to content

Commit

Permalink
Adapt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
homanp committed Jun 25, 2023
1 parent 9544982 commit 51929be
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 1 addition & 3 deletions src/superagent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 5 additions & 9 deletions src/superagent.js
Original file line number Diff line number Diff line change
@@ -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;
}

Expand Down Expand Up @@ -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`, {
Expand Down
4 changes: 2 additions & 2 deletions test/sdk.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
});

Expand All @@ -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,
});

Expand Down

0 comments on commit 51929be

Please sign in to comment.