Download the PHP package wetrocloud/wetrocloud-sdk without Composer
On this page you can find all versions of the php package wetrocloud/wetrocloud-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wetrocloud/wetrocloud-sdk
More information about wetrocloud/wetrocloud-sdk
Files in wetrocloud/wetrocloud-sdk
Package wetrocloud-sdk
Short Description An easy-to-use SDK that enables integration with the WetroCloud API
License MIT
Informations about the package wetrocloud-sdk
WetroCloud SDK for PHP
⚠️ Unofficial SDK: This is an unofficial PHP SDK for the WetroCloud API.
Introduction
The WetroCloud SDK for PHP provides an easy way to interact with the WetroCloud API, allowing developers to create collections, insert resources, and query data effortlessly using PHP.
Installation
Quick Start
Available Methods
Collection Management
1. createCollection()
Creates a new collection.
Parameters:
?string $collectionId- (Optional) The unique ID of the collection.
Returns: array<string, mixed>
Example:
2. listAllCollections()
Retrieves a list of available collections.
Returns: array<string, mixed>
Example:
3. deleteCollection()
Deletes an entire collection.
Parameters:
string $collectionId- The ID of the collection.
Returns: array<string, mixed>
Example:
Resource Management
4. insertResource()
Inserts a resource into a collection.
Parameters:
string $collectionId- The ID of the collection.string $resource- The resource to insert.string $type- The type of resource.
Returns: array<string, mixed>
Example:
5. removeResource()
Deletes a resource from a collection.
Parameters:
string $collectionId- The ID of the collection.string $resourceId- The ID of the resource to delete.
Returns: array<string, mixed>
Example:
Querying & Chat
6. queryCollection()
Queries resources from a collection.
Parameters:
string $collectionId- The ID of the collection.string $requestQuery- The query string.?string $jsonSchema- Optional JSON schema.?string $jsonSchemaRules- Optional JSON schema rules.
Returns: array<string, mixed>
Example:
7. chatCollection()
Chat with a collection using message history.
Parameters:
string $collectionId- The ID of the collection.string $message- The message to send.?string $chatHistory- Optional chat history as JSON string.
Returns: array<string, mixed>
Example:
AI & Content Processing
8. categorizeResource()
Categorizes a resource using predefined categories.
Parameters:
string $resource- The resource to categorize.string $type- The type of resource.string $jsonSchema- JSON schema of the resource.string $categories- Comma-separated list of categories.string $prompt- An overall command of your request.
Returns: array<string, mixed>
Example:
9. textGeneration()
Generates text without retrieval-augmented generation (RAG).
Parameters:
array $messages- Array of message objects with role and content.string $model- The model to use.
Returns: array<string, mixed>
Example:
10. imageToText()
Extracts text from an image.
Parameters:
string $imageUrl- The URL of the image.string $requestQuery- The query to process the image.
Returns: array<string, mixed>
Example:
Content Conversion
11. markdownConverter()
Converts a resource (file, web, image) to Markdown.
Parameters:
string $resource- The resource URL (file, web page, or image).string $resourceType- The type of resource: "file", "web", or "image".
Returns: array<string, mixed>
Example:
12. transcript()
Retrieves transcript data from a resource (e.g., YouTube video).
Parameters:
string $link- The URL of the resource (e.g., YouTube video link).string $resourceType- The type of resource (e.g., "youtube").
Returns: array<string, mixed>
Example:
Configuration
Custom Base URL
HTTP Client Configuration
The SDK uses Guzzle HTTP client with the following default configuration:
- Timeout: 30 seconds
- Headers:
Authorization: Token your-api-keyUser-Agent: WetroSDK-PHP/1.0Content-Type: application/jsonAccept: application/json
Requirements
- PHP 8.3 or higher
- Guzzle HTTP Client 7.9 or higher
Testing
Run the test suite using:
The test suite uses Pest PHP testing framework.
Support
For additional support, please contact [email protected] or visit the website WetroCloud Docs.
License
This SDK is licensed under the MIT License.
Disclaimer
This is an unofficial PHP SDK for the WetroCloud API. It is not officially maintained by WetroCloud and is provided as-is for community use. For official support and documentation, please visit the official WetroCloud documentation.