Download the PHP package avocet-shores/laravel-conduit without Composer

On this page you can find all versions of the php package avocet-shores/laravel-conduit. 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 laravel-conduit

Laravel Conduit

Latest Version on Packagist GitHub Tests Action Status Coverage Status GitHub Code Style Action Status Total Downloads

Why Conduit?

Most AI packages today are tightly coupled with a single AI provider, locking you into their ecosystem (and their outages). Conduit offers a flexible, provider-agnostic solution that allows you to switch between providers without changing your code. You can even create custom drivers for your own AI services, all while maintaining a consistent API. Want to add OpenAI as a backup to your on-prem model in case of an outage? Just add a fallback:

Key Features

Installation

  1. You can install the package via composer:

  2. Optionally publish the configuration file:

Basic Usage

Below is a typical usage example with the Conduit facade:

  1. Call the Conduit facade with make('driver', 'model').
  2. Provide optional instructions and messages.
  3. Optionally enable jsonOutput to automatically decode the response.
  4. Call run() to obtain a ConversationResponse.

Setting a Fallback

To ensure your application remains online if your primary provider fails, you can set a fallback driver and model:

When a server or rate limit error occurs, Conduit will automatically switch to the specified fallback provider and model, keeping your AI-driven features running.

Configuration

Conduit's configuration file allows you to set up your provider-specific authentication variables.

OpenAI

To use OpenAI, you must provide your API key in the .env file:

Amazon Bedrock

To use Amazon Bedrock, you'll need to provide your AWS credentials in the .env file. By default, Conduit references the same .env variables as the AWS SDK and other AWS services, but you can always point them to your own custom variables by updating the config/conduit.php file.

Advanced Usage

Structured Outputs

Currently only supported by some of OpenAI's models.

Read more about structured outputs in OpenAI's documentation.

Certain drivers and models support specifying a complete schema that the model is then forced to adhere to. If your chosen driver/model supports it, you can enable structured output by passing a Schema into enableStructuredOutput():

Conduit ensures that the schema request is formatted exactly how OpenAI expects, so your simple Schema definition:

...is automatically converted into the JSON format OpenAI requires:

What if my model doesn't support structured outputs?

You can still enjoy automatic json decoding by adding withJsonOutput() and defining your own schema somewhere within your prompt. It's important to note, however, that this will not enforce the schema on the AI model. You will need to validate the response yourself in a subsequent step:

Middleware and Pipelines

Conduit uses Laravel’s Pipelines to provide you with a powerful extension system via middleware. You can add middleware by providing either a class that implements MiddlewareInterface or a closure:

This can be useful for inspecting or modifying the AI request/response on its way through the pipeline. Or, for example, adding your own logging:

The AIRequestContext Object

The AIRequestContext object is passed through the pipeline to the designated driver, and contains all the data required for Conduit to handle the request. This includes the model, instructions, messages, responseFormat, and more. It also includes a blank slate metadata array for any additional data you wish to pass through the pipeline. You can access and modify this data as needed via its getter and setter methods.

If you're planning on creating your own driver, you'll need to familiarize yourself with the AIRequestContext object, as it's how you'll receive the data you need to make the AI request. Speaking of which...

Adding Your Own Driver

Laravel Conduit is fully extensible to new or custom drivers. You only need to implement the DriverInterface and provide:

Finally, add your driver to the drivers array in the configuration file.

Example:

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-conduit with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
aws/aws-sdk-php Version ^3.337
illuminate/contracts Version ^10.0||^11.0
spatie/laravel-package-tools Version ^1.16
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 avocet-shores/laravel-conduit contains the following files

Loading the files please wait ....