cyrox/chatbot
Composer 安装命令:
composer require cyrox/chatbot
包简介
Light chatbot that can be embedded in any website via composer
README 文档
README
#composer require cyrox/chatbot:dev-main#
Cyrox Chatbot This is a lightweight chatbot package that can be easily embedded into any website via Composer. It integrates with OpenAI to provide chatbot functionality. Installation and Setup
install as fallow
#composer require cyrox/chatbot:dev-main#
and then publis the vandor
php artisan vendor:publish --tag=chatbot-migrations
php artisan vendor:publish --tag=chatbot-views
php artisan vendor:publish --tag=chatbot-config
php artisan vendor:publish --tag=cyrox-chatbot-assets
then add the tmplate any whare u want @include('vendor.cyrox.chatbot.chatbot')
run migration
php artisan make:migration create_chat_histories_table --path=packages/Cyrox/Chatbot/Database/migrations
and dont forget to add ur open ai key in env varables
ie OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
set up in laravel inertia react
create a compenent Chatbot.jsx
import React, { useState } from "react";
const ChatbotPage = () => { const [isVisible, setIsVisible] = useState(true);
return (
isVisible && (
<iframe
src="/chatbot-blade"
className=" fixed w-96 border-none rounded-lg bottom-5 right-1 h-full z-[1] shadow-lg bg-none rounded-lg"
title="Chatbot"
></iframe>
)
);
};
export default ChatbotPage;
then make a ChatbotControlller
with('content', view('vendor.cyrox.chatbot.chatbot')); } } finally addd these route Route::get('/chatbot-blade', function () { return view('vendor.cyrox.chatbot.chatbot'); });统计信息
- 总下载量: 41
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-25