Skip to content

Commit

Permalink
Fix PSR-4 conventions + Readme.MD fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonichaos360 committed May 13, 2023
1 parent 6967e4f commit 0aefd90
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 92 deletions.
6 changes: 4 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ A PHP library for interacting with OpenAI's Completions and ChatCompletions API.
- [Chat](#chat)
- [Completion](#completion)
- [Conversations](#conversations)
- [Todo](#todo)
- [Issues](#issues)
- [Contributing](#contributing)
- [License](#license)

Expand All @@ -30,15 +32,15 @@ Initialize the `LuGPT` class with your OpenAI API key:
```php
require_once 'vendor/autoload.php';

use Sonichaos360\LuGPT\LuGPT;
use Sonichaos360\LuGPT\Completions;

$apiKey = 'your_openai_api_key';
$model = 'gpt-3.5-turbo';
$maxTokens = '1500';
$temp = '1';
$conversationsPath = '../conversations'; //Optional, necessary only if you will manage conversation history using createConversation()

$luGPT = new LuGPT($apiKey, $model, $maxTokens, $temp, $conversationsPath);
$luGPT = new Completions($apiKey, $model, $maxTokens, $temp, $conversationsPath);

```

Expand Down
48 changes: 18 additions & 30 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,24 @@
{
"name": "sonichaos360/lugpt",
"description": "A PHP library for interacting with OpenAI's Completions and ChatCompletions API.",
"keywords": ["openai", "gpt", "gpt-3.5-turbo", "chatbot", "ai"],
"license": "MIT",
"authors": [
"name": "sonichaos360/lugpt",
"description": "A PHP library for interacting with OpenAI's Completions and ChatCompletions API.",
"keywords": ["openai", "gpt", "gpt-3.5-turbo", "chatbot", "ai"],
"license": "MIT",
"authors": [
{
"name": "Luciano Joan Vergara",
"email": "[email protected]"
"name": "Luciano Joan Vergara",
"email": "[email protected]"
}
],
"require": {
"php": ">=5.6",
"ext-curl": "*"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
},
"autoload": {
],
"type": "project",
"require": {
"php": ">=5.6"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
"Sonichaos360\\LuGPT\\": "src/"
"Sonichaos360\\LuGPT\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Sonichaos360\\LuGPT\\Tests\\": "tests/"
}
},
"config": {
"platform": {
"php": "7.4"
}
},
"minimum-stability": "stable"
}
}
37 changes: 0 additions & 37 deletions examples/ChatExample.php

This file was deleted.

20 changes: 0 additions & 20 deletions examples/TextCompletions.php

This file was deleted.

6 changes: 3 additions & 3 deletions src/LuGPT/LuGPT.php → src/Completions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @package Sonichaos360/LuGPT
* @author Luciano Joan Vergara
* @license MIT License (https://opensource.org/licenses/MIT)
* @link https://github.com/Sonichaos360/OpenAi
* @link https://github.com/Sonichaos360/LuGPT
*
* MIT License
*
Expand All @@ -28,7 +28,7 @@

namespace Sonichaos360\LuGPT;

class LuGPT
class Completions
{
protected $apiKey;
protected $model;
Expand All @@ -38,7 +38,7 @@ class LuGPT
protected $logPath;

/**
* Constructor for LuGPT class
* Constructor for LuGpt class
*
* @param string $apiKey API key for OpenAI
* @param string $model The model to use for OpenAI
Expand Down

0 comments on commit 0aefd90

Please sign in to comment.