orchestratexr / botman-chat-sdk
Requires
- php: ^8.2
- botman/botman: ^2.8
- botman/driver-web: ^1.5
- illuminate/broadcasting: ^10.0|^11.0|^12.0
- illuminate/contracts: ^10.0|^11.0|^12.0
- illuminate/events: ^10.0|^11.0|^12.0
- illuminate/http: ^10.0|^11.0|^12.0
- illuminate/queue: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
- illuminate/view: ^10.0|^11.0|^12.0
- league/commonmark: ^2.6
- theodo-group/llphant: ^0.11.0
README
BotManChatSDK is a Laravel package designed for supporting the creation of LLM-backed Chat Bots using BotMan, LLPhant, and LLM providers like OpenAI, Anthropic, and Ollama.
About OrchestrateXR
OrchestrateXR is the easiest way to create and deploy XR content. Use your web browser to create for mobile, tablets, PCs and XR devices.
Roadmap
- Full compatability with existing BotMan Drivers, and drop-in replacement for BotMan Web Widget
- Add the Web Widget into any Laravel application, including Laravel Nova, using
@botman
blade directive - Base class
ChatConversation
for building LLM-backed Conversations - Extend Conversations to emulate Agents with Tools that execute PHP functions
- Built-in Tool for crawling URLs which you can bootstrap into any
ChatConversation
with$conversation->withCrawler()
- Custom Cache driver for persisting Conversations between user sessions
- Enhanced Web Driver to provide for real-time message streaming using Laravel event system
- Discord Driver, to enable chat interactions in Discord
- Chat Completion Driver, to enable chat requests and responses to take the form of OpenAI Chat Completions
- Examples of
ChatConversation
implementations, to help you start your journey - Example
BotManChatServerController
for setting up the server-side ofChatConversation
instances - Laravel Livewire Starter Kit bootstrapped with BotManChatSDK, perfect for deploying to Laravel Cloud
Quickstart
To be written:
- Clone the starter kit repo
- Add an environment variable
- Run it locally using
php artisan serve
Installation
Install this Laravel package via composer into an existing Laravel project:
composer require orchestratexr/botman-chat-sdk
Publish front-end assets and configuration
php artisan vendor:publish --provider="OrchestrateXR\BotManChatSDK\BotManChatServiceProvider"
Inject the chat client into your front-end using the @botman
blade directive. For most Laravel applications,
this means adding @botman
to your blade layout.
<html lang="en"> <body> @slot {{!-- somewhere near the bottom --}} @blade </body> </html>
In Laravel Nova applications, you can safely add @botman
to your meta.php
file.
Create a web route for BotMan chat requests:
<?php // in your routes/web.php use OrchestrateXR\BotManChatSDK\Http\Controllers\BotManChatServerController; Route::post(BotManChat::config('chatServer'), [BotManChatServerController::class, 'listen']);
Lastly, if you are using all the defaults outlined above, you will need to create a Laravel environment variable to hold your OpenAI API Key:
OPENAI_API_KEY=sk-proj-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Configuration
You can configure the SDK by modifying your copy of config/botman-chat-sdk.php
. It should
have been generated when you published the assets for this Laravel package. If it does not or
if you need to start over from scratch, just run this command:
php artisan vendor:publish --tag=botman-chat-sdk-config --force
Customization
// Usage description here
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email acollegeman@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.