itquelle/open-ai-chatgpt-php

1.0.0 2022-12-18 16:47 UTC

This package is auto-updated.

Last update: 2024-05-12 21:50:16 UTC


README

Use OpenAi.com API

Learn more about Open-AI API

https://beta.openai.com/docs/api-reference/introduction

Installation

This project using composer.

$ composer require itquelle/open-ai-chatgpt-php

Fine tuning

$app->setOptionModel(...);
$app->setOptionTemperature(...);
$app->setOptionMaxTokens(...);
$app->setOptionTopT(...);
$app->setOptionFrequencyPenalty(...);
$app->setOptionPresencePenalty(...);

Get object

var_dump(
    $app->getResponseRaw()
);

Usage

Translate language

<?php

use OpenAiApi\Api;

$app = new Api(...);
$app->setPrompt("Translate this into 1.English, 2.French: Hallo");
$app->get();

echo $app->getResponseText();