Download the PHP package sonichaos360/lugpt without Composer

On this page you can find all versions of the php package sonichaos360/lugpt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lugpt

LuGPT

A PHP library for interacting with OpenAI's Completions and ChatCompletions API.

Table of Contents

Installation

Install the library using Composer:

Usage

Initialization

Initialize the LuGPT class with your OpenAI API key:

In this example, we are using the gpt-3.5-turbo model, which is optimized for chat. The chat-optimized models can be used with the chat() method. If you want to use the completion() method, you will need to use text-davinci-003 or another non-chat-optimized model. A list of all available OpenAI models can be found here.

Chat

Send a message using Chat Completions API:

Conversations

Create and manage conversations:

This example uses a conversationId, which allows the API to remember the context of previous messages and responses. The conversations will be created as separate JSON files stored in the $conversationsPath directory.

Completion

Send a prompt to the text-davinci-003 or other non chat completions optimized model:

TODO

Here are some upcoming features and improvements we have planned for the LuGPT library. We encourage contributors to take on these tasks or suggest new ones by creating issues on GitHub:

  1. Refactor the saveTokens() function, which was deactivated due to strange behavior with non-English language characters.
  2. Improve error handling and provide more informative error messages.
  3. Implement unit tests for the library to ensure code quality and functionality.

Please consider contributing to the development of these features or suggesting new ones by creating an issue or submitting a pull request. Your input and collaboration are greatly appreciated.

Issues

If you encounter any problems or have suggestions for improvements, we welcome you to create an issue on GitHub. To do so, please follow these steps:

  1. Navigate to the Issues section of the LuGPT repository.
  2. Click on the "New issue" button.
  3. Provide a clear and descriptive title for the issue.
  4. In the description, include as much detail as possible, such as:
    • A summary of the problem or suggestion.
    • Steps to reproduce the issue, if applicable.
    • The expected behavior and the actual behavior.
    • Any error messages or logs, if available.
    • The PHP version and operating system you are using.
    • Attach any relevant screenshots or code snippets, if necessary.

When creating an issue, please keep the following recommendations in mind:

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your changes.
  3. Make your changes.
  4. Submit a pull request.

License

This library is released under the MIT License.


All versions of lugpt with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sonichaos360/lugpt contains the following files

Loading the files please wait ....