定制 coodde/eliact 二次开发

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

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

coodde/eliact

Composer 安装命令:

composer require coodde/eliact

包简介

AI-powered structured input parser for PHP. Extract structured data (names, emails, dates, etc) from natural language using LLMs like OpenAI.

README 文档

README

Eliact — AI-powered structured input parser for PHP. Extracts names, emails, dates and more from natural language using LLMs.

✨ Features

  • Support for multiple AI providers (OpenAI, DeepSeek, Claude, Mistral, Ollama)
  • Flexible schema-based extraction (JSON → validated array)
  • DTO hydration (convert to custom objects)
  • Driver fallback with ChainDriver
  • Caching with PSR-16 or in-memory (MemoryCache)

🚀 Basic usage

$driver = DriverFactory::make('openai', 'sk-...');
$eliact = new Eliact($driver);

$data = $eliact->parse("My name is John and my email is john@example.com", [
    'name' => 'string',
    'email' => 'email'
]);

🧱 With DTO

class ContactDto {
    public function __construct(
        public string $name,
        public string $email
    ) {}
}

$dto = $eliact->parseToDto("I'm Alice. My email is alice@mail.com", [
    'name' => 'string',
    'email' => 'email'
], ContactDto::class);

🔁 Chain + Cache example

$chain = new ChainDriver([
    DriverFactory::make('deepseek', 'xxx'),
    DriverFactory::make('openai', 'yyy')
]);

$cached = new CacheWrapper($chain, new MemoryCache());
$eliact = new Eliact($cached);

📦 Installation

composer require coodde/eliact

⌨️ Supported Input Types

  • Text
  • URL / HTML
  • Image
  • Audio

🌐 Supported Providers

  • OpenAI: gpt-4o, gpt-4, gpt-3.5-turbo
  • Anthropic: claude-3-opus, claude-3-sonnet, claude-3-haiku
  • Google: gemini-1.5-pro, gemini-1.5-flash
  • DeepSeek: deepseek-chat, deepseek-vl
  • Mistral: mistral-7b, mixtral-8x7b
  • Ollama: llama3, gemma, llava, bakllava

✅ Supported Data Types

  • bool
  • country-code
  • credit-card
  • date (parsed to Y-m-d)
  • datetime
  • email
  • float
  • int
  • month
  • phone
  • safe-string
  • string
  • time
  • url
  • uuid
  • year
  • zip-code

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2025-07-20