@graphai/serper_agent 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,2 +1,55 @@
1
- # GraphAI Agent
2
- serper agent
1
+
2
+ # @graphai/serper_agent for GraphAI
3
+
4
+ serper agent
5
+
6
+ ### Install
7
+
8
+ ```sh
9
+ yarn add @graphai/serper_agent
10
+ ```
11
+
12
+
13
+ ### Usage
14
+
15
+ ```typescript
16
+ import { GraphAI } from "graphai";
17
+ import { serperAgent } from "@graphai/serper_agent";
18
+
19
+ const agents = { serperAgent };
20
+
21
+ const graph = new GraphAI(graph_data, agents);
22
+ const result = await graph.run();
23
+ ```
24
+
25
+ ### Agents description
26
+ - serperAgent - serper agent
27
+
28
+ ### Input/Output/Params Schema & samples
29
+ - [serperAgent](https://github.com/receptron/graphai-agents/blob/main/docs/agentDocs/net/serperAgent.md)
30
+
31
+ ### Input/Params example
32
+ - serperAgent
33
+
34
+
35
+
36
+ ```typescript
37
+ {
38
+ "inputs": {
39
+ "query": "apple inc"
40
+ },
41
+ "params": {}
42
+ }
43
+ ```
44
+
45
+
46
+ ### Environment Variables
47
+ - serperAgent
48
+ - SERPER_API_KEY
49
+
50
+
51
+
52
+
53
+
54
+
55
+
@@ -26,7 +26,11 @@ const serperAgent = async ({ namedInputs }) => {
26
26
  return response.data;
27
27
  }
28
28
  catch (error) {
29
- console.log(error);
29
+ console.error(error);
30
+ if (error instanceof Error) {
31
+ return { error: error.message };
32
+ }
33
+ return { error: String(error) };
30
34
  }
31
35
  };
32
36
  exports.serperAgent = serperAgent;
@@ -225,7 +229,9 @@ const serperAgentInfo = {
225
229
  description: "serper agent",
226
230
  category: ["net"],
227
231
  author: "isamu arimoto",
228
- repository: "https://github.com/isamu/graphai-agents",
232
+ repository: "https://github.com/receptron/graphai-agents/tree/main/net/serper-agent",
233
+ source: "https://github.com/receptron/graphai-agents/tree/main/net/serper-agent/src/serper_agent.ts",
234
+ package: "@graphai/serper_agent",
229
235
  license: "MIT",
230
236
  environmentVariables: ["SERPER_API_KEY"],
231
237
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphai/serper_agent",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "serper agent",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -8,13 +8,22 @@
8
8
  ],
9
9
  "scripts": {
10
10
  "build": "tsc",
11
+ "typecheck": "tsc --noEmit",
11
12
  "eslint": "eslint src --fix",
12
13
  "format": "prettier --write '{src,tests}/**/*.ts'",
13
14
  "doc": "npx agentdoc",
14
15
  "test_run": "node --test --require ts-node/register ./tests/run_*.ts",
15
- "test": "node --test --require ts-node/register ./tests/test_*.ts",
16
+ "test": "echo nothing",
16
17
  "ci": "yarn run format && yarn run eslint && yarn run test && yarn run build"
17
18
  },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/receptron/graphai-agents.git"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/receptron/graphai-agents/issues"
25
+ },
26
+ "homepage": "https://github.com/receptron/graphai-agents#readme",
18
27
  "author": "isamu arimoto",
19
28
  "license": "MIT",
20
29
  "devDependencies": {},