bjserranoweb/ollama-laravel-wizard
Composer 安装命令:
composer require bjserranoweb/ollama-laravel-wizard
包简介
Laravel package for Ollama AI integration.
README 文档
README
Ollama Laravel Wizard is a Laravel package that integrates Ollama to automate queries and generate files using large language models (LLMs). Simplify repetitive tasks and boost your workflows with local AI capabilities.
Features
- Seamless Integration: Easily connect Laravel with Ollama for local AI-powered automation.
- Automated Queries: Execute complex queries with ease.
- File Generation: Automatically create custom files based on your requirements.
- Configurable: Customize behavior through a simple configuration file.
- Extensible: Adapt the package to meet specific project needs.
Requirements
- Laravel 9+
- PHP 8+
- Ollama installed locally
Installation
-
Install Ollama on your system. For example, on macOS, run:
brew install ollama
For other operating systems, follow the instructions on the official Ollama website.
-
Download a model to use with Ollama:
ollama pull openchat
-
Install the package via Composer:
composer require bjserranoweb/ollama-laravel-wizard
-
Publish the configuration file:
php artisan vendor:publish --tag="ollama-laravel-config"
Usage
Here’s an example of how to use the Ollama Laravel Wizard:
use Cloudstudio\Ollama\Facades\Ollama; // Example of generating a response $response = Ollama::agent('You are an assistant that helps with coding tasks...') ->prompt('Generate a Laravel controller for user authentication') ->model('llama2') ->options(['temperature' => 0.7]) ->stream(false) ->ask(); echo $response;
Configuration
The configuration file config/ollama.php allows you to set the default model, API settings, and other options.
Example configuration:
return [ 'model' => 'llama2', 'api_url' => 'http://localhost:11434', 'default_options' => [ 'temperature' => 0.7, 'max_tokens' => 1000, ], ];
Contributing
Contributions are welcome! Please submit a pull request or open an issue if you find a bug or have a feature request.
License
This project is licensed under the MIT License.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-12-27