{"_id":"@agentxin-ai/plugin-fastgpt","_rev":"2-de48fb7513b27d97bf196263facdc0a3","name":"@agentxin-ai/plugin-fastgpt","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.3":{"name":"@agentxin-ai/plugin-fastgpt","version":"0.0.3","_id":"@agentxin-ai/plugin-fastgpt@0.0.3","maintainers":[{"name":"agentxin-ai","email":"1304040880@qq.com"}],"homepage":"https://github.com/agentxin-ai/agentxin-plugins#readme","bugs":{"url":"https://github.com/agentxin-ai/agentxin-plugins/issues"},"dist":{"shasum":"55e7dd285ef1917b1acb830d840446474ab5ec36","tarball":"https://registry.npmjs.org/@agentxin-ai/plugin-fastgpt/-/plugin-fastgpt-0.0.3.tgz","fileCount":2,"integrity":"sha512-qrgcCtbCVJOeGUuL4otqCAplhCQ7oBHPwHPOtXtxIWNYN2ScNiOlFZ81A2BdKr5/zDk1l8e//mClU+lKtwH7PQ==","signatures":[{"sig":"MEYCIQCnhD3G2utAuRqb4CnaupTyUK8l9j5+NY8GappPdOE96wIhALKLNMZbiycwOpFn2MrvPkADoQ4P97DktwY4iKfpj9zW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4686},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","@agentxin-plugins-starter/source":"./src/index.ts"},"./package.json":"./package.json"},"_npmUser":{"name":"agentxin-ai","email":"1304040880@qq.com"},"repository":{"url":"git+https://github.com/agentxin-ai/agentxin-plugins.git","type":"git"},"_npmVersion":"10.9.4","description":"`@agentxin-ai/plugin-fastgpt` connects [FastGPT](https://doc.fastgpt.io/) to the AgentXin plugin ecosystem. It registers a NestJS module that exposes a connection test endpoint and wires up both integration and knowledge strategies so FastGPT datasets can","directories":{},"_nodeVersion":"22.22.0","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3.25.67","axios":"^1.4.0","chalk":"^4.1.2","lodash-es":"^4.17.21","@nestjs/common":"^11.1.6","@langchain/core":"^0.3.72","@metad/contracts":"^3.6.0","@agentxin-ai/plugin-sdk":"^3.6.0"},"_npmOperationalInternal":{"tmp":"tmp/plugin-fastgpt_0.0.3_1773917146274_0.7609888252288894","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@agentxin-ai/plugin-fastgpt","version":"0.0.4","repository":{"type":"git","url":"git+https://github.com/agentxin-ai/agentxin-plugins.git"},"bugs":{"url":"https://github.com/agentxin-ai/agentxin-plugins/issues"},"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{"./package.json":"./package.json",".":{"@agentxin-plugins-starter/source":"./src/index.ts","types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"dependencies":{"tslib":"^2.3.0"},"peerDependencies":{"@langchain/core":"^0.3.72","@metad/contracts":"^3.6.0-beta.10","@nestjs/common":"^11.1.6","@agentxin-ai/plugin-sdk":"^3.6.0-beta.10","axios":"^1.4.0","chalk":"^4.1.2","lodash-es":"^4.17.21","zod":"^3.25.67"},"_id":"@agentxin-ai/plugin-fastgpt@0.0.4","description":"`@agentxin-ai/plugin-fastgpt` connects [FastGPT](https://doc.fastgpt.io/) to the AgentXin plugin ecosystem. It registers a NestJS module that exposes a connection test endpoint and wires up both integration and knowledge strategies so FastGPT datasets can","homepage":"https://github.com/agentxin-ai/agentxin-plugins#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-2jnk6ZaSYWQ7dfuthEARheY8/xWpzAc8x+/ur8W3RI2SQ68MjmqnE9f7CYs7wrX3dJ1OP8fWDmWBy1VfFF4TNw==","shasum":"3e657e75ffdb664b094536b121185ebf8af2b7d1","tarball":"https://registry.npmjs.org/@agentxin-ai/plugin-fastgpt/-/plugin-fastgpt-0.0.4.tgz","fileCount":23,"unpackedSize":22815,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDHoe11+isaN9MLqtjy/DL92o6955NAWmFkhRKfpBXRIQIgHPKJ3uIlx6P5FHI2YTHcMoGwPdT6zSl1+xDCjF8JswE="}]},"_npmUser":{"name":"agentxin-ai","email":"1304040880@qq.com"},"directories":{},"maintainers":[{"name":"agentxin-ai","email":"1304040880@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-fastgpt_0.0.4_1775181905667_0.5894155843522939"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-19T10:45:46.143Z","modified":"2026-04-03T02:05:05.956Z","0.0.3":"2026-03-19T10:45:46.411Z","0.0.4":"2026-04-03T02:05:05.817Z"},"bugs":{"url":"https://github.com/agentxin-ai/agentxin-plugins/issues"},"homepage":"https://github.com/agentxin-ai/agentxin-plugins#readme","repository":{"type":"git","url":"git+https://github.com/agentxin-ai/agentxin-plugins.git"},"description":"`@agentxin-ai/plugin-fastgpt` connects [FastGPT](https://doc.fastgpt.io/) to the AgentXin plugin ecosystem. It registers a NestJS module that exposes a connection test endpoint and wires up both integration and knowledge strategies so FastGPT datasets can","maintainers":[{"name":"agentxin-ai","email":"1304040880@qq.com"}],"readme":"# AgentXin Plugin: FastGPT\n\n## Overview\n\n`@agentxin-ai/plugin-fastgpt` connects [FastGPT](https://doc.fastgpt.io/) to the AgentXin plugin ecosystem. It registers a NestJS module that exposes a connection test endpoint and wires up both integration and knowledge strategies so FastGPT datasets can be searched from AgentXin workflows.\n\n## Features\n\n- Provides the `IntegrationFastGPTPlugin` NestJS module, mounted under `/fastgpt`, with lifecycle logging on bootstrap and shutdown.\n- Publishes a FastGPT integration strategy that advertises metadata (labels, help URL, config schema) to the AgentXin integration catalogue and validates credentials via the service layer.\n- Implements a knowledge strategy that calls FastGPT’s `/api/core/dataset/searchTest` endpoint and returns LangChain `Document` chunks with embedding scores.\n- Exposes a `POST /fastgpt/test` endpoint that normalises the FastGPT base URL (trimming trailing `/` or `/api`) and issues a connectivity check against `/api/v1/chat/completions`.\n\n## Installation\n\n```bash\nnpm install @agentxin-ai/plugin-fastgpt\n```\n\n> **Peer dependencies:** your host must provide `@agentxin-ai/plugin-sdk`, `@nestjs/common`, `@metad/contracts`, `@langchain/core`, `axios`, `chalk`, `lodash`, and `zod` (see `package.json` for exact versions).\n\nIn an Nx workspace place the package inside `packages/` (or update your workspace layout accordingly).\n\n## Usage\n\nSet the `PLUGINS` environment variable when starting the AgentXin server so the package is loaded:\n\n```bash\nPLUGINS=@agentxin-ai/plugin-fastgpt\n```\n\nAfter registration the plugin contributes:\n\n- an integration provider named `fastgpt` with configurable `url` and `apiKey` fields (accessible through the AgentXin UI or API); and\n- a knowledge strategy keyed as `fastgpt` that can answer embedding search requests against a FastGPT dataset.\n\nWhen configuring an integration:\n\n| Field | Description |\n| --- | --- |\n| `url` | Base URL of your FastGPT instance. Trailing `/` or `/api` segments are automatically stripped. |\n| `apiKey` | FastGPT API key with permission to access the dataset search and chat APIs. |\n\n## Connection Test Endpoint\n\nThe plugin adds a controller under `/fastgpt`. Use it to verify credentials before saving an integration:\n\n```bash\ncurl -X POST https://<your-host>/fastgpt/test \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"options\": {\n      \"url\": \"https://fastgpt.your-company.com\",\n      \"apiKey\": \"fastgpt_api_key\"\n    }\n  }'\n```\n\nThe service sanitises the URL and sends a `GET` request to `/api/v1/chat/completions`. If mandatory fields are missing or the call fails, a `400 Bad Request` is raised with the error details.\n\n## Knowledge Retrieval Strategy\n\nWhen the knowledge strategy runs it expects the payload to include:\n\n| Field | Description |\n| --- | --- |\n| `query` | The user prompt to search with. |\n| `k` | Maximum number of search results to return. |\n| `options.knowledgebaseId` | Target FastGPT dataset identifier. |\n\nThe strategy performs a POST to `https://<base-url>/api/core/dataset/searchTest` using embedding search. Results are mapped into `[Document, score]` tuples where `Document.pageContent` contains the FastGPT question (`q`) and metadata preserves the remaining fields (`datasetId`, `sourceName`, etc.). Scores are pulled from the returned `embedding` distance.\n\n## Development\n\nFrom the monorepo root you can leverage the Nx helpers:\n\n```bash\nnpx nx build @agentxin-ai/plugin-fastgpt\nnpx nx test @agentxin-ai/plugin-fastgpt\n```\n\n`nx build` emits the compiled artefacts into `dist/`, while `nx test` executes the Jest suite.\n\n## License\n\nThis project follows the [AGPL-3.0 License](../../../LICENSE) located at the repository root.\n","readmeFilename":"README.md"}