定制 codewithngoni/filament-ask-ai 二次开发

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

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

codewithngoni/filament-ask-ai

最新稳定版本:v1.0.0

Composer 安装命令:

composer require codewithngoni/filament-ask-ai

包简介

Adds AI-power on Filament forms fields.

README 文档

README

Filament Ask AI is a Laravel package that adds AI-powered hint actions to Filament form fields. It integrates with AI models (like Mistral, Gemini, and Claude) to provide a "hint action" in your form fields, allowing users to interact with AI directly within your Laravel Filament forms.

Latest Version on Packagist

Total Downloads

Installation

To install the package, run the following command:

composer require codewithngoni/filament-ask-ai

Usage

After installing, run the package installation command:

php artisan vendor:publish --tag=filament-ask-ai-config

This command will:

Publish the configuration file for Filament AI settings.

Publish the configuration file for openai-php/laravel settings.

Create a symbolic link for storage.

We use Gemini and Mistral for API keys. Add the following to your .env file:

MISTRAL_API_KEY=your_mistral_api_key
GEMINI_API_KEY=your_gemini_api_key

Configuration

You can configure the AI keys by modifying the config/filament-ask-ai.php file. Ensure that the correct API keys for Mistral, Gemini, and Claude are set.

Usage for Developers

Adding AI to Built-in Filament Form Fields You can add AI generation capabilities to TextInput, Textarea, and RichEditor fields using the AskMistral(), AskGemini(), or AskClaude() methods:

Without Options

use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\RichEditor;

TextInput::make('title')
    ->AskMistral()

Textarea::make('description')
    ->AskGemini()

With Options

TextInput::make('title')
    ->AskMistral([
        'model' => 'mistral-large-latest',
        'temperature' => 0.7,
    ])

Textarea::make('description')
    ->AskGemini([
        'model' => 'gemini-2.0-flash',
        'max_tokens' => 200,
    ])

RichEditor::make('content')
    ->AskClaude([
        'model' => 'claude-2',
        'temperature' => 0.8,
    ])

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-30