hiz-grup/ai-email-suggest
最新稳定版本:v1.0
Composer 安装命令:
composer require hiz-grup/ai-email-suggest
包简介
This package helps user to fix typos in email addresses by using openai api to suggest a valid email address.
README 文档
README
Never worry about typos in email addresses in Laravel
This package provides a simple way to suggest email addresses based on a given email address. The typical use case is when a user enters an email address with typos, i.e.: example@gmial.com. This package uses OpenAI to suggest an email addresses that are likely to be correct.
Installation
You can install the package via composer:
composer require sfolador/ai-email-suggest
You can publish the config file with:
php artisan vendor:publish --tag="ai-email-suggest-config"
This is the contents of the published config file:
return [ 'model' => 'text-davinci-003', 'openai_key' => env('OPENAI_KEY'), 'default_route' => 'ai-email-suggest', 'use_cache' => true, // If you want to use the chatgpt API, // you need to set the following value to true: 'use_chatgpt_api' => false, 'throttle' => [ 'enabled' => false, 'max_attempts' => 60, 'prefix' => 'ai-email-suggest', ], ];
Remember to set your OpenAI key in your .env file.
Usage
$aiEmailSuggest = AiEmailSuggest::suggest('test@yaohh.com'); // $aiEmailSuggest = 'test@yahoo.com'
It's possible to use this package from the frontend by invoking the route: "/ai-email-suggest" in POST by passing the email as a parameter. The response will be a JSON with the suggested email, such as:
{
"suggestion": "test@yahoo.com"
}
Cache clear
If you use a Cache driver that supports tags, you can clear the cache by invoking the command:
php artisan ai-email-suggest:clear-cache
ChatGTP
You can use the new ChatGPT API by setting the config value use_chatgpt_api to true.
Testing
composer test
TODO
- Add caching to avoid too many requests to OpenAI
- Add throttling to avoid too many requests to OpenAI
- Add support for cache clear
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
hiz-grup/ai-email-suggest 适用场景与选型建议
hiz-grup/ai-email-suggest 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.02k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 09 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「email」 「laravel」 「openai」 「sfolador」 「ai-email-suggest」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hiz-grup/ai-email-suggest 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hiz-grup/ai-email-suggest 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hiz-grup/ai-email-suggest 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP 8.0+ OpenAI API client with fully typed/documented requests+responses models, guzzle and symfony/http-client support and async/parallel requests.
Estimate AI API costs before making expensive calls
Extensible library for building notifications and sending them via different delivery channels.
Email+ extends Kirby's email capabilities by adding support for multiple email services using the same Kirby email API.
A powerful package that seamlessly integrates OpenAI's advanced AI capabilities into your Laravel applications. This package offers quick setup and intuitive configuration to leverage AI models for chat, embeddings, and more.
Laravel contact us form package to send email and save to database
统计信息
- 总下载量: 2.02k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-16