定制 axumoss/hasab-ai 二次开发

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

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

axumoss/hasab-ai

最新稳定版本:v0.1.0

Composer 安装命令:

composer require axumoss/hasab-ai

包简介

a laravel sdk for hasab-ai

README 文档

README

A Laravel SDK for interacting with the Hasab-AI API, providing easy access to Translation, Transcription, and Text-to-Speech (TTS) services.

Installation

You can install the package via composer:

composer require axumoss/hasab-ai

The service provider will automatically register itself.

Configuration

You can publish the config file using:

php artisan vendor:publish --provider="Axumoss\HasabAi\HasabAiServiceProvider" --tag="config"

Then, add your Hasab-AI API token to your .env file:

HASABAI_TOKEN=your_api_token_here

Usage

Using the Facade

The HasabAi facade provides access to all services:

use Axumoss\HasabAi\Facades\HasabAi;

// Transcription
$result = HasabAi::transcribe()->upload('path/to/audio.mp3', 'amh');

// Translation
$result = HasabAi::translate()->translate(['Hello', 'World'], 'eng', 'orm');

// Text-to-Speech
$result = HasabAi::tts()->synthesize('ሰላም', 'amh');

Using Service Injection

You can also inject the specific endpoint classes:

use Axumoss\HasabAi\Endpoints\Transcription;

public function transcribe(Transcription $transcription)
{
    return $transcription->upload('path/to/audio.mp3');
}

Endpoints

Transcription

  • upload($audio, string $language = 'amh', ?string $sourceLanguage = 'amh', bool $translate = false, bool $summarize = false, bool $isMeeting = false)
  • history(int $page = 1)

Translation

  • translate(array $texts, string $sourceLanguage, string $targetLanguage)

Text-to-Speech (TTS)

  • synthesize(string $text, string $language, ?string $speakerName = null)
  • getSpeakers(?string $language = null)
  • getHistory(array $params = [])
  • getAnalytics(array $params = [])
  • getRecord($recordId)
  • deleteRecord($recordId)
  • streamSynthesize(string $text, string $language, ?string $speakerName = null, int $sampleRate = 22050)

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-11