labsllm/llm-wrapper
最新稳定版本:v2.5-alpha1.2
Composer 安装命令:
composer require labsllm/llm-wrapper
包简介
PHP library that integrates different LLM services (ChatGPT, Claude, Gemini) into a single wrapper
README 文档
README
A simple PHP library that provides a unified interface for interacting with various Large Language Models like OpenAI, Anthropic, and Google.
For complete documentation, visit labsllm.geanpedro.com.br
Install
composer require labsllm/llm-wrapper
Basic Usage
$execute = LabsLLM::text() ->using(new OpenAI('SK-***', 'gpt-4o-mini')) ->executePrompt('Your question here'); $response = $execute->getResponseData(); echo $response->response;
Switching Providers
Just change the provider in the using() method:
// Using Google $execute = LabsLLM::text() ->using(new Google('API-KEY', 'gemini-pro')) ->executePrompt('Your question here'); // Using Anthropic $execute = LabsLLM::text() ->using(new Anthropic('API-KEY', 'claude-3-opus')) ->executePrompt('Your question here');
Provider Support Status
Legend:
- ✅ Supported
- 🚧 In Development
- 📅 Planned
- ❌ Not Supported
| Feature | OpenAI | Anthropic | |
|---|---|---|---|
| Text Prompts | ✅ | ✅ | 📅 |
| System Instructions | ✅ | ✅ | 📅 |
| Chat | ✅ | ✅ | 📅 |
| Tools/Functions | ✅ | ✅ | ❌ |
| Structure Output | ✅ | ✅ | ❌ |
| Streaming | ✅ | ✅ | ❌ |
| Embeddings | 📅 | ❌ | ❌ |
| Voice | 📅 | ❌ | ❌ |
| Image Generation | 📅 | ❌ | 📅 |
统计信息
- 总下载量: 379
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-03