orchestratexr/botman-chat-sdk

0.0.20 2025-08-07 20:27 UTC

This package is auto-updated.

Last update: 2025-09-11 13:11:57 UTC


README

Latest Version on Packagist Total Downloads License GitHub Actions

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 of ChatConversation 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.