@dj1029/plugin-smart-sl 0.0.23 → 0.0.26

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/dist/index.js CHANGED
@@ -20,7 +20,7 @@ const plugin = {
20
20
  },
21
21
  displayName: 'SmartBI Plugin',
22
22
  description: 'Integrate SmartBI functionality',
23
- keywords: ['SmartBI', 'feishu', 'document source', 'knowledge', 'integration'],
23
+ keywords: ['SmartBI', 'document source', 'knowledge', 'integration'],
24
24
  author: 'dengjin',
25
25
  },
26
26
  /** 描述插件的配置Schema */
@@ -3,7 +3,7 @@ import { Injectable } from '@nestjs/common';
3
3
  import { ToolsetStrategy } from '@xpert-ai/plugin-sdk';
4
4
  import { SmartBIName, iconImage } from './types.js';
5
5
  import { SmartToolset } from "./toolset.js";
6
- import { buildSmartTool } from "./tool.js";
6
+ import { getSmartBIAuthToken } from "./tool.js";
7
7
  let SmartStrategy = class SmartStrategy {
8
8
  constructor() {
9
9
  this.meta = {
@@ -45,7 +45,7 @@ let SmartStrategy = class SmartStrategy {
45
45
  }
46
46
  createTools() {
47
47
  return [
48
- buildSmartTool()
48
+ getSmartBIAuthToken()
49
49
  ];
50
50
  }
51
51
  };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export declare function buildSmartTool(): import("@langchain/core/tools").DynamicStructuredTool<z.ZodObject<{
2
+ export declare function getSmartBIAuthToken(): import("@langchain/core/tools").DynamicStructuredTool<z.ZodObject<{
3
3
  username: z.ZodString;
4
4
  password: z.ZodString;
5
5
  }, "strip", z.ZodTypeAny, {
@@ -1 +1 @@
1
- {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/lib/tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,wBAAgB,cAAc;;;;;;;;;;;;;;;yDAqC7B"}
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/lib/tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,wBAAgB,mBAAmB;;;;;;;;;;;;;;;yDA6BlC"}
package/dist/lib/tool.js CHANGED
@@ -2,14 +2,9 @@ import { tool } from '@langchain/core/tools';
2
2
  import { getErrorMessage } from '@xpert-ai/plugin-sdk';
3
3
  import { z } from 'zod';
4
4
  import request from "./http-client.service.js";
5
- export function buildSmartTool() {
5
+ export function getSmartBIAuthToken() {
6
6
  return tool(async (input) => {
7
7
  try {
8
- console.log("input ---------- ", input);
9
- // const httpClient = new HttpClientService();
10
- // const res = await httpClient.post('/login', input);
11
- // console.log("res ---------- ", res.data.token)
12
- // return res.data.token;
13
8
  const req = await request({
14
9
  url: '/login',
15
10
  method: 'post',
@@ -26,8 +21,8 @@ export function buildSmartTool() {
26
21
  return "I don't know how to do that because: " + getErrorMessage(error);
27
22
  }
28
23
  }, {
29
- name: 'smart',
30
- description: `Smart Connect`,
24
+ name: 'smart_auth_token',
25
+ description: `获取smartBI系统的认证token`,
31
26
  /** 这里决定了 测试的参数 */
32
27
  schema: z.object({
33
28
  username: z.string().describe('连接用户名'),
@@ -1,11 +1,11 @@
1
1
  import { BuiltinToolset } from '@xpert-ai/plugin-sdk';
2
- import { buildSmartTool } from './tool.js';
2
+ import { getSmartBIAuthToken } from './tool.js';
3
3
  export class SmartToolset extends BuiltinToolset {
4
4
  async _validateCredentials(credentials) {
5
5
  // No credentials needed for calculator toolset
6
6
  }
7
7
  async initTools() {
8
- this.tools = [buildSmartTool()];
8
+ this.tools = [getSmartBIAuthToken()];
9
9
  return this.tools;
10
10
  }
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dj1029/plugin-smart-sl",
3
- "version": "0.0.23",
3
+ "version": "0.0.26",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",