PHPackages                             adebayo27/wetrocloud-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. adebayo27/wetrocloud-sdk

ActiveLibrary[API Development](/categories/api)

adebayo27/wetrocloud-sdk
========================

A laravel sdk for wetrocloud

v1.0.0(1y ago)11MITPHP

Since Mar 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Adebayo27/wetrocloud-laravel)[ Packagist](https://packagist.org/packages/adebayo27/wetrocloud-sdk)[ RSS](/packages/adebayo27-wetrocloud-sdk/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Wetrocloud Laravel SDK
======================

[](#wetrocloud-laravel-sdk)

A Laravel SDK to interact with Wetrocloud's API for AI-powered features like text generation, data extraction, image-to-text conversion, and collection management.

---

Installation
------------

[](#installation)

### Via Composer

[](#via-composer)

You can install the SDK using Composer:

```
composer require adebayo27/wetrocloud-sdk
```

### Environment Variables

[](#environment-variables)

Ensure you add your Wetrocloud API key to your `.env` file:

```
WETROCLOUD_API_KEY=your_api_key_here
```

---

Usage
-----

[](#usage)

### Initialize the SDK

[](#initialize-the-sdk)

The SDK is automatically injected via Laravel's Service Provider. To use it in a controller or service, inject `WetrocloudClient`:

```
use Wetrocloud\Sdk\WetrocloudClient;

class ExampleController extends Controller
{
    protected WetrocloudClient $wetrocloud;

    public function __construct()
    {
        $this->wetrocloud = new WetrocloudClient(env('WETROCLOUD_API_KEY'), 'v1');
    }
}
```

---

Features
--------

[](#features)

### 1. List Collections

[](#1-list-collections)

Retrieves all available collections.

#### Usage

[](#usage-1)

```
$collections = $wetrocloud->listCollections();
```

#### Response Example

[](#response-example)

```
{
    "count": 10,
    "next": null,
    "previous": null,
    "collections": [ ... ]
}
```

---

### 2. Create a Collection

[](#2-create-a-collection)

Creates a new collection with a unique ID.

#### Usage

[](#usage-2)

```
$collection = $wetrocloud->createCollection();
```

or

```
$collection = $wetrocloud->createCollection('my_unique_collection');
```

#### Response Example

[](#response-example-1)

```
{
    "collection_id": "my_unique_collection",
    "success": true
}
```

---

### 3. Query a Collection

[](#3-query-a-collection)

Retrieves specific data from a collection.

#### Usage

[](#usage-3)

```
$queryResult = $wetrocloud->queryCollection('my_collection', 'Find all users with role admin');
```

#### Response Example

[](#response-example-2)

```
{
    "results": [ ... ]
}
```

---

### 4. Data Categorization

[](#4-data-categorization)

Classifies text into predefined categories.

#### Usage

[](#usage-4)

```
$categorization = $wetrocloud->categorizeText(
    "match review: John Cena vs. The Rock are fighting",
    ["football", "coding", "entertainment", "basketball", "wrestling", "information"]
);
```

#### Response Example

[](#response-example-3)

```
{
    "response": { "label": "wrestling" },
    "tokens": 1746,
    "success": true
}
```

---

### 5. Text Generation

[](#5-text-generation)

Generates AI-powered text responses based on input messages.

#### Usage

[](#usage-5)

```
$response = $wetrocloud->generateText([
    ['role' => 'user', 'content' => 'What is a large language model?']
]);
```

#### Response Example

[](#response-example-4)

```
{
    "response": "A large language model is a type of AI trained on vast datasets..."
}
```

---

### 6. Image-to-Text

[](#6-image-to-text)

Extracts text or answers questions about an image.

#### Usage

[](#usage-6)

```
$response = $wetrocloud->imageToText(
    'https://example.com/sample-image.jpg',
    'What is in this image?'
);
```

#### Response Example

[](#response-example-5)

```
{
    "response": "A golden retriever dog playing in the park."
}
```

---

### 7. Data Extraction from a Website

[](#7-data-extraction-from-a-website)

Extracts structured data from a web page based on a JSON schema.

#### Usage

[](#usage-7)

```
$response = $wetrocloud->extractDataFromWebsite(
    'https://example.com',
    ['title' => '', 'description' => '']
);
```

#### Response Example

[](#response-example-6)

```
{
    "data": { "title": "Example", "description": "This is an example website." }
}
```

---

Error Handling
--------------

[](#error-handling)

All API requests return errors in a standard format.

### Example Error Response

[](#example-error-response)

```
{
    "error": "Client error: 401 Unauthorized",
    "response": {
        "detail": "Invalid token."
    }
}
```

To handle errors, check if `error` is present in the response:

```
if (isset($response['error'])) {
    return response()->json($response, 400);
}
```

---

Support &amp; Contributions
---------------------------

[](#support--contributions)

For issues or feature requests, open an issue on GitHub or contribute via pull requests.

GitHub Repository:

Documentation
-------------

[](#documentation)

For more details, check out the official API documentation: [Wetrocloud Docs](https://docs.wetrocloud.com/introduction)

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance42

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

461d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e73a8dc192d2fbad0f18764d992cfe12d73577210a249966f5e1793dc9507ce?d=identicon)[Adebayo27](/maintainers/Adebayo27)

---

Top Contributors

[![Adebayo27](https://avatars.githubusercontent.com/u/34712645?v=4)](https://github.com/Adebayo27 "Adebayo27 (6 commits)")

### Embed Badge

![Health badge](/badges/adebayo27-wetrocloud-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/adebayo27-wetrocloud-sdk/health.svg)](https://phpackages.com/packages/adebayo27-wetrocloud-sdk)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.5M920](/packages/statamic-cms)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19564.8M1.6k](/packages/drupal-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
