Download the PHP package blinq/openai without Composer

On this page you can find all versions of the php package blinq/openai. 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 openai

PHP OpenAI API

(Written by ChatGPT)

This is a library for interacting with Language Learning Models (LLMs), built with a focus on AI-driven chat functionalities. The library currently supports OpenAI's GPT-3.5-turbo, but it can be extended to support other LLMs as well.

Features

Getting Started

Firstly, you need to install the library in your PHP project.

Usage

Chat with OpenAI's GPT-3.5-turbo

You need to initialize a client object using ApiClient configuration. The following example demonstrates a chat session with OpenAI's GPT-3.5-turbo.

The client by default holds a history of the chat session. You can retrieve the history using the getHistory() method. The history is an array of ChatMessage objects, which have the following properties:

You can reset the chat history using the resetHistory() method.

Or use the getLastMessageAndClearHistory() method to get the last message and clear the history.

Chat with Stream

If the streaming option is used, the following example shows how to add a handler to deal with the stream of chat messages.

Customization

The ApiClient class is abstract and can be extended to create custom drivers for different APIs.

The current implementation is for OpenAI, but if you'd like to use a different AI provider, you can create a new class that extends ApiClient, and implement the required methods (chat(), completion(), etc.).

For any issues or additional features, feel free to open an issue in the GitHub repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.


All versions of openai with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
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 blinq/openai contains the following files

Loading the files please wait ....