charla/charla-php-sdk

PHP Interface to CharlaAI API

1.0.0 2024-04-04 14:41 UTC

README

Charla

Charla SDK for PHP

CI Latest Stable Version codecov Total Downloads License PHP Version Require

Getting started

Install

Install the SDK using Composer.

composer require charla/charla-php-sdk

Usage

Initialize client

$factory = new \CharlaAI\Charla\Transport\HttpTransportFactory();
$transport = $factory->create(new \CharlaAI\Charla\Options('TOKEN', 'https://charla.pro'))

$client = new \CharlaAI\Charla\Http\Client($transport);

Transcribe audio

use CharlaAI\Charla\Http\Methods\Business\v1\Chat;

$client = new \CharlaAI\Charla\Http\Client($transport);

$audio = fopen('audio.mp3', 'r');

$client->call(Chat::class)->transcribe($audio, $add_language, $diarize, $with_timestamp, $format);

List history

use CharlaAI\Charla\Http\Methods\Business\v1\Chat;

$client = new \CharlaAI\Charla\Http\Client($transport);

$client->call(Chat::class)->list($page, $per_page, $from, $to);

Get history

use CharlaAI\Charla\Http\Methods\Business\v1\Chat;

$client = new \CharlaAI\Charla\Http\Client($transport);

$client->call(Chat::class)->get($id);

Contributing to the SDK

Please refer to CONTRIBUTING.md.

Security

If you discover any security related issues, please email support@charla.pro instead of using the issue tracker.

Getting help/support

If you need help setting up or configuring the PHP SDK please head over to the support@charla.pro.

License

Licensed under the MIT license, see LICENSE