Download the PHP package amohamed/jsconnector without Composer
On this page you can find all versions of the php package amohamed/jsconnector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amohamed/jsconnector
More information about amohamed/jsconnector
Files in amohamed/jsconnector
Package jsconnector
Short Description JSConnector Laravel Package provides an easy way to integrate the JSConnector JavaScript library into your Laravel application. This package offers a simple facade to interact with the JSConnector library, enabling developers to leverage the power of OpenAI's language models in their Laravel projects without the hassle of directly managing communication between PHP and JavaScript.
License MIT
Informations about the package jsconnector
Laravel JS Connector
The Laravel JS Connector package provides an easy way to integrate the JSConnector JavaScript library into your Laravel application. This package offers a simple facade to interact with the JSConnector library, enabling developers to leverage the power of OpenAI's language models in their Laravel projects without the hassle of directly managing communication between PHP and JavaScript.
Installation
You can install the package via composer:
Configuration
Publish the config file with:
This is the contents of the config file:
You can customize the values in the .env file like so:
Starting and Stopping the Node.js Server
Before you can start making requests with JSConnector, you need to ensure that the Node.js server is running. You can start the server with the provided artisan command:
To stop the running server, you can use:
Usage
Here is a basic example of how to use the JS Connector:
Usage with LangChain JS
To use JSConnector with LangChain JS in your Laravel application, you need to install LangChain JS first. You can do this by running:
Then, on your Node.js server, you can create a JavaScript file where you import and initialize LangChain:
In your Laravel application, you can use the JSConnector to send data to the LangChain JS service:
Route::post('/chat', 'App\Http\Controllers\LangChainController@chat');
This will send the response from the LangChain JS service back to the client.
Testing
Run the tests with:
License
The Laravel JS Connector is open-sourced software licensed under the MIT license.
Authors
Abdallah Mohamed ([email protected])
All versions of jsconnector with dependencies
doctrine/dbal Version >=2.10
guzzlehttp/guzzle Version >=7.0.1
laravel/framework Version >=8.0
illuminate/support Version >=8.0