Tinq\Assistant

Official Tinq.ai PHP SDK.

All URIs are relative to https://tinq.ai/api/v2, except if the operation defines another base path.

MethodHTTP requestDescription
generatePOST /assistantGenerate

generate()

generate($accept_charset, $content_type, $accept, $body)

Generate

Generate content with an assistant Sample body parameters: json { \"language\": \"english\", \"tone\": \"encouraging\", \"tool\": \"tweet\", \"number\": \"4\", \"details\": \"how to be rich\" }

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Tinq\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Tinq\Api\Assistant(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$accept_charset = UTF-8; // string
$content_type = application/json; // string
$accept = application/json; // string
$body = array('key' => new \stdClass); // object

try {
    $apiInstance->generate($accept_charset, $content_type, $accept, $body);
} catch (Exception $e) {
    echo 'Exception when calling Assistant->generate: ', $e->getMessage(), PHP_EOL;
}

Parameters

NameTypeDescriptionNotes
accept_charsetstring[optional]
content_typestring[optional]
acceptstring[optional]
bodyobject[optional]

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]