GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Gmulti/XGen

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
data
data
 
 
src
src
 
 
.gitignore
.gitignore
 
 
.php_cs
.php_cs
 
 
.travis.yml
.travis.yml
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 
composer.lock
composer.lock
 
 

Repository files navigation

XGen SDK PHP

Official PHP SDK of the XGen API.


API Documentation : https://thomas-15.gitbook.io/generator/

Requirements

  • PHP version 7.2 and later
  • XGen API Key, contact me

Installation

You can install the library via Composer. Run the following command:

composer require gmulti/xgen

To use the library, use Composer's autoload:

require_once __DIR__. '/vendor/autoload.php';

Example

Usage with data sample

<?php

require_once __DIR__ . '/vendor/autoload.php';

use XGen\Client;
use XGen\XGen;

try {
    $xgen = new XGen();
    $xgen->addContextFromFile(__DIR__ . '/vendor/gmulti/xgen/data/context-1.json');
    $xgen->addContextFromFile(__DIR__ . '/vendor/gmulti/xgen/data/context-2.json');
    $xgen->addSourceFromFile(__DIR__ . '/vendor/gmulti/xgen/data/source.json');

    $client = new Client('API_KEY');
    $result = $client->getResource('generate')->postGenerateWithXGen($xgen);
    var_dump($result);
    // array (size=1)
    //   'text' => string 'Dans le cadre de la 2ème journée, Angers SCO accueille Olympique Lyonnais' (length=75)
    
} catch (\Exception $e) {
}

Load source from URL

<?php

require_once __DIR__ . '/sdk/vendor/autoload.php';

use XGen\Client;
use XGen\XGen;

try {
    $xgen = new XGen();
    $xgen->addContextFromFile(__DIR__ . '/vendor/gmulti/xgen/data/context-1.json');
    $xgen->addContextFromFile(__DIR__ . '/vendor/gmulti/xgen/data/context-2.json');
    $xgen->addSourceFromUrlJson('https://apigenerator.gmulti.now.sh/v1/example-data/source');

    $client = new Client('API_KEY');
    $text = $client->getResource('generate')->postGenerateWithXGen($xgen);
    var_dump($result);
    // array (size=1)
    //   'text' => string 'Dans le cadre de la 2ème journée, Angers SCO accueille Olympique Lyonnais' (length=75)
} catch (\Exception $e) {
}

About

xgen is guided and supported by Thomas Deneulin.

About

No description or website provided.

Topics

libraryphptext-generation

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.