https://github.com/crazyurus/aigc-detector
Detect if content is generated by AI
https://github.com/crazyurus/aigc-detector
aigc langchain oclif
Last synced: about 2 months ago
JSON representation
Detect if content is generated by AI
- Host: GitHub
- URL: https://github.com/crazyurus/aigc-detector
- Owner: crazyurus
- License: gpl-3.0
- Created: 2024-04-25T17:11:12.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-13T08:27:16.000Z (over 1 year ago)
- Last Synced: 2025-10-20T15:11:30.414Z (7 months ago)
- Topics: aigc, langchain, oclif
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/aigc-detector
- Size: 819 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AIGC Detector

[](LICENSE)
[](https://www.npmjs.com/package/aigc-detector)
[](https://www.npmjs.com/package/aigc-detector?activeTab=dependents)
[](https://www.npmjs.com/package/aigc-detector)
Detect if content is generated by AI. Provides command line tools and use in Node.js.
## Usage
You need to configure the large model platform and its API Key that the tool depends on. Currently, the following platforms are supported:
- [百川智能](https://platform.baichuan-ai.com/)
- [MiniMax](https://www.minimaxi.com/)
- [Moonshot](https://platform.moonshot.cn/)
- [OpenAI](https://platform.openai.com/)
- [通义千问](https://dashscope.console.aliyun.com/)
- [智谱清言](https://open.bigmodel.cn/)
You can log in to the above platform to apply for an API Key.
### Command Line Tools
First, install globally:
```sh
$ npm install aigc-detector -g
```
Then, you need to configure the API Key you have applied for in the tool. For example:
```sh
$ aigc-detector config -p moonshot -k sk-GQz***************************************8UnlrT
```
Finally, tell us the content that needs to be detected and we can proceed.
```sh
$ aigc-detector detect [CONTENT]
```
Also, You can chat with the large model with the following command:
```sh
$ aigc-detector chat
```
For more ways to use `aigc-detector`, please refer to the help command.
```sh
$ aigc-detector help
```
### Using in Node.js
First, install in your project:
```sh
$ npm install aigc-detector
```
Then, you need to configure the API Key you have applied to initialize. For example:
```js
import { AIGC, Platform } from 'aigc-detector';
const detector = new AIGC({
apiKey: 'sk-GQz***************************************8UnlrT',
platform: Platform.Moonshot,
});
```
Finally, call the `detect` method and give the content that needs to be detected.
```js
const { probability, reason } = await detector.detect(content);
```
- `probability` is the probability that the content is generated by AI
- `reason` is the reason why the content is generated by AI
## Develop
You need to execute `npm link` to create a local debugging cli tool, and then you can use `aigc-detector-dev` for debugging. For example:
```sh
$ aigc-detector-dev config
```
## License
[GPL-3.0](./LICENSE)