borah/knowledge-base-laravel
Composer 安装命令:
composer require borah/knowledge-base-laravel
包简介
Laravel wrapper for the Knowledge-Base API
README 文档
README
This package is a Laravel wrapper for the Knowledge Base API. It will create and maintain a Knowledge Base for all the configured Eloquent models.
Installation
You can install the package via composer:
composer require borah/knowledge-base-laravel
You must publish the migrations:
php artisan vendor:publish --tag="knowledge-base-laravel-migrations"
After the migration has been published you can run them using php artisan migrate.
Also, if you want, you can publish the config file with:
php artisan vendor:publish --tag="knowledge-base-laravel-config"
This is the contents of the published config file:
return [ 'connection' => [ 'host' => env('KNOWLEDGE_BASE_HOST', 'http://localhost:8100'), ], 'models' => [ 'knowledge_base_id' => \Borah\KnowledgeBase\Models\KnowledgeBaseId::class, ], ];
Requirements
This package is a wrapper for Knowledge Base API, so you need to have it running in order to use this package.
Usage
To use it, you need to add the Borah\KnowledgeBase\Traits\HasKnowledgeBase trait to the models you want to add to the Knowledge Base. Also, these models should implement the Borah\KnowledgeBase\Contracts\Embeddable interface.
For example:
<?php namespace App\Models; use Borah\KnowledgeBase\Contracts\Embeddable; use Borah\KnowledgeBase\DTO\KnowledgeEmbeddingText; use Borah\KnowledgeBase\Traits\BelongsToKnowledgeBase; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; class Post extends Model implements Embeddable { use HasFactory; use BelongsToKnowledgeBase; public function getEmbeddingsTexts(): KnowledgeEmbeddingText|array { return [ new KnowledgeEmbeddingText( text: $this->content, entity: class_basename($this), ), ]; } }
Testing
composer test
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.
Borah Digital Labs
Borah Digital Labs crafts web applications, open-source packages, and offers a team of full-stack solvers ready to tackle your next project. We have built a series of projects:
- CodeDocumentation: Automatic code documentation platform
- AutomaticDocs: One-time documentation for your projects
- Talkzy: A tool to summarize meetings
- Compass: An agent-driven tool to help manage companies more efficiently
- Prompt Token Counter: Simple tool to count tokens in prompts
- Sabor en la Oficina: Website + catering management platform
- Prompt Token Counter: Simple free tool to count tokens in prompts
- PDF to Markdown: Simple free tool to convert PDF files into Markdown format
We like to use Laravel for most of our projects and we love to tackle big, complicated problems. Feel free to reach out and we can have a virtual coffee!
License
The MIT License (MIT). Please see License File for more information.
borah/knowledge-base-laravel 适用场景与选型建议
borah/knowledge-base-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.13k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 01 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「Borah」 「knowledge-base-laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 borah/knowledge-base-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 borah/knowledge-base-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 borah/knowledge-base-laravel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Wrapper around the most popular LLMs that allows drop-in replacement of large language models in Laravel.
Advanced LLM monitoring using LLM Port and Filament panel
Alfabank REST API integration
Bypass CORS issues when developing locally with no hassle.
Laravel package for Accurate Online API integration.
Shared RCX Laravel DataTables UI and configuration helpers.
统计信息
- 总下载量: 2.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-02