tqtqtqtq/welm

WeLM的API客户端 - PHP(非官方)

v1.1.0 2023-03-14 11:41 UTC

This package is auto-updated.

Last update: 2025-08-14 17:52:54 UTC


README

A fully open-source third-partied (non-official) PHP SDK for accessing the WeLM API.

Installation

To install the package, simply run the following command:

composer require tqtqtqtq/welm

Usage

Create your sampling index.php file with following codes:

<?php
require __DIR__ . '/vendor/autoload.php'; 
use tqtqtqtq\WeLM\WeLM;

$welm_api_key = getenv('YOUR_WELM_API_KEY_IN_ENVIRONMENT_VARS');
$welm = new WeLM($welm_api_key);

$completions = $welm->completion([
   'model' => 'xl',
   'prompt' => '测试',
   'temperature' => 0.95,
   'max_tokens' => 512,
]);

var_dump($completions);

Contributing

Contributions not available yet...

Credits

License

This package is licensed under the MIT License - see the LICENSE file for details.