项目
在 GitHub 查看
rhettlunn/is-odd-ai
关于
既然可以用 ✨AI✨ 判断某个东西是否奇怪,何必简单地检查呢?
人工智能与机器学习实测星标增长
- 24小时
- 0
- 7天
- +1
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文is-odd-ai
Why check if something is odd simply, when you can do it with ✨AI✨
is-odd-ai is a unique package that utilizes OpenAI's GPT-3.5-turbo model to determine if a number is odd or even. Because sometimes you just want to add a little bit of AI magic to your number checking!
Installation
To install is-odd-ai, use npm:
npm install is-odd-ai
Usage
To use is-odd-ai, you'll need an OpenAI API key. You can get one by signing up at OpenAI.
- Create a
.envfile in the root of your project. - Add your OpenAI API key to the
.envfile:
OPENAI_API_KEY=your-api-key
Example
Here's an example of how to use the is-odd-ai package in your project:
const isOdd = require('is-odd-ai');
(async () => {
const number = 5;
const result = await isOdd(number);
console.log(`Is ${number} odd? ${result}`); // Output: Is 5 odd? true
})();
Function
isOdd(number)
- Parameters:
number(Number) - The number to check. - Returns:
Promise<Boolean>- Resolves totrueif the number is odd,falseif even. - Throws: Throws an error if the determination could not be made.
Contributing
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.
License
This project is licensed under the Apache 2.0 license.
探索相关项目
加载中…