mgahed / ai
这是一个我的AI包,收集了来自不同提供者的多个AI模型。
v1.2.0
2024-07-01 11:42 UTC
Requires
- php: ^8.1
- laravel/sanctum: ^4.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^v9.0.0
This package is auto-updated.
Last update: 2024-10-01 00:20:50 UTC
README
简介
此包简单使用一些AI模型来帮助您为您的文本获取最佳AI响应。
使用模型
- Gemini pro
- Gemini 1.5
- 所有不在测试版中的Gemini模型
最低要求
安装
composer require mgahed/ai
php artisan vendor:publish --tag=mgahed-ai-config
配置
查看 config/mgahed-ai.php
中的配置文件
return [ // gemini api key 'gemini' => [ 'api_key' => env('GEMINI_API_KEY'), ], ];
您可以在 .env
文件中添加您的 Gemini API 密钥
使用方法
use Mgahed\ai\Http\Helpers\GeminiModel; ## Gemini pro model $aiResponse = GeminiModel::proModel('What is the release date of first version of php?'); ## Gemini 1.5 model $aiResponse = GeminiModel::onePointFiveModel('What is the release date of first version of php?'); ## Gemini any other model $aiResponse = GeminiModel::generalModel('What is the release date of first version of php?', 'gemini-pro');