Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
Improve introductory text, and add example code snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
thejamescollins committed Oct 31, 2022
1 parent 80b87dc commit d3d3eda
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,28 @@

The **Tectalic OpenAI REST API Client** is a package that provides a convenient and straightforward way to interact with the **OpenAI API** from your PHP application.

Supports GPT-3 and Codex based models, fully typed Data Transfer Objects (DTOs) for all requests and responses and IDE autocomplete support.

Integrating OpenAI into your **PHP** application is now as simple as:

```php
$openaiClient = Manager::build(new \GuzzleHttp\Client(), new Authentication('OPENAI_API_KEY'));

$response = $openaiClient->completions()->create(
new CreateRequest([
'model' => 'text-davinci-002',
'prompt' => 'Will using a third party package save time?',
])
)->toModel();

echo $response->choices[0]->text;
// Using a third party package can save time because you don't have to write the code yourself.
```

More information is available from [https://tectalic.com/apis/openai](https://tectalic.com/apis/openai).

**This is an unofficial package and has no affiliations with OpenAI.**

## Installation

Need help getting started? See our guide: [how to build an app using the OpenAI API](https://tectalic.com/blog/build-an-app-using-openai-api).
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"type": "library",
"license": "MIT",
"keywords": [
"tectalic",
"openai",
"ai",
"api",
"gpt-3",
"gpt3",
"openai",
"rest",
"api"
"tectalic"
],
"homepage": "https://tectalic.com/apis/openai",
"autoload": {
Expand Down

0 comments on commit d3d3eda

Please sign in to comment.