scott/laravel-gemini 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

scott/laravel-gemini

最新稳定版本:v1.0.1

Composer 安装命令:

composer require scott/laravel-gemini

包简介

A php package for Gemini ai

README 文档

README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This package provides a simple way to use the Gemini API in your Laravel applications. The Laravel Gemini package provides a convenient interface for interacting with the Gemini API to generate text based on a given prompt. This documentation outlines how to use the GeminiAi class, its methods, and configuration.

Get Started

Requires PHP 8.1+

First, install GeminiAI via the Composer package manager:

Installation

You can install the package via composer:

composer require scott/laravel-gemini

Configuration

The Laravel Gemini package can be configured using environment variables. The following environment variables are available:

This will create a config/gemini.php configuration file in your project, which you can modify to your needs using environment variables. Blank environment variables for the Google gemini API key and organization id are already appended to your .env file.

GOOGLE_GEMINI_API_KEY=

You can publish the config file with:

php artisan vendor:publish --provider="Scott\LaravelGemini\LaravelGeminiServiceProvider" --tag="laravel-gemini-config"

Usage

To use the Laravel Gemini package for text generation, follow these steps:

  1. Create a new instance of Gemini AI:
use Scott\LaravelGemini\GeminiAi;
$prompt = GeminiAi::models('gemini-pro')
    ->generateText('I am a web developer');
  1. Call the generateText method:
echo $prompt;

Testing

composer test

Security

If you discover any security related issues, please email tresorkasendat@gmail.com instead of using the issue tracker.

Credits

统计信息

  • 总下载量: 35
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-20