kalebalebachew/hasab-laravel
最新稳定版本:v1.0.0
Composer 安装命令:
composer require kalebalebachew/hasab-laravel
包简介
A Laravel SDK for Hasab AI
README 文档
README
Hasab AI Laravel SDK
A simple Laravel SDK for integrating with Hasab AI.
It gives you a clean way to access Hasab's core features — transcription, translation, text-to-speech (TTS), and chat — without writing repetitive HTTP logic.
This package is intentionally small and follows normal Laravel patterns.
You get config publishing, a service provider, a facade, and a few service classes. No extra layers just straightforward code that works.
Why this exists
Hasab provides powerful AI endpoints, but using them directly from Laravel requires setting up headers, base URLs, and file uploads each time.
This SDK wraps those calls with a consistent interface so you can work like this:
Hasab::tts()->synthesize('Hello world', 'eng');
instead of manually handling authentication or request payloads.
Requirements
- PHP 8.0 or higher
- A valid Hasab API key from Hasab AI
Installation
Install with Composer:
composer require kalebalebachew/hasab-laravel
Configuration
You can publish the config file (optional):
php artisan vendor:publish --tag=hasab-config
Then add these to your .env:
HASAB_API_KEY=your_api_key_here HASAB_BASE_URL=https://hasab.co/api HASAB_API_VERSION=v1
Quick Start
use Hasab\Facades\Hasab; // Chat $response = Hasab::chat()->complete([ 'message' => 'Hello, how are you?', 'model' => 'hasab-1-lite', ]); // Text-to-Speech $audio = Hasab::tts()->synthesize([ 'text' => 'Hello, world!', 'language' => 'eng', ]); // Transcription (⚠️ Ongoing Implementation) $transcription = Hasab::transcription()->upload([ 'file' => storage_path('app/audio/recording.mp3'), ]); // Translation (⚠️ Ongoing Implementation) $translation = Hasab::translation()->translate([ 'text' => 'Hello, how are you?', 'source_language' => 'eng', 'target_language' => 'amh', ]);
Documentation
For detailed examples and advanced usage, check out the Usage Guide.
Contributing
Want to contribute? Check out the Contributing Guide for guidelines on how to get started.
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-13