定制 2k11cs12/openai-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

2k11cs12/openai-laravel

最新稳定版本:v1.0.1

Composer 安装命令:

composer require 2k11cs12/openai-laravel

包简介

Streamline OpenAI integration in Laravel for text generation.

README 文档

README

GitHub GitHub release (latest by date) GitHub Workflow Status

Laravel OpenAI Integration simplifies the integration of OpenAI's powerful language models into your Laravel application. This package provides a convenient way to interact with OpenAI for natural language processing and text generation tasks.

Features

  • Easy configuration of OpenAI API credentials.
  • Simplified methods for generating text using OpenAI models.
  • Customizable options for text generation.
  • Seamless integration with your Laravel project.

Installation

You can install this package via Composer. Run the following command in your Laravel project:

composer require Mangrio/laravel-openai

Configuration

OPENAI_API_KEY=your-api-key-here
OPENAI_API=https://api.openai.com/v1/chat/completions
OPENAI_MODEL=gpt-3.5-turbo

Usage

// Import the OpenAI facade at the top of your file
use Mangrio\OpenAiLaravel\Facades\OpenAiLaravel;

$response = OpenAiLaravel::generate('Prompt')
    ->key('your-api-key')
    ->temperature(1.0)
    ->maxTokens(1000)
    ->topP(0.8)
    ->model('custom-model')
    ->frequencyPenalty(0.5)
    ->presencePenalty(0.3)
    ->execute();

Additional Options

Contributing

License

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-14