sharpapi/laravel-tth-hospitality-product-categories
Composer 安装命令:
composer require sharpapi/laravel-tth-hospitality-product-categories
包简介
AI Hospitality Product Categorization for Laravel powered by SharpAPI.com
关键字:
README 文档
README
This package provides a Laravel integration for the SharpAPI Hospitality Product Categorization service. It allows you to automatically categorize hospitality products with relevance scores, which is perfect for organizing product catalogs, improving search functionality, and enhancing product discovery.
Installation
You can install the package via composer:
composer require sharpapi/laravel-tth-hospitality-product-categories
Configuration
Publish the config file with:
php artisan vendor:publish --tag="sharpapi-tth-hospitality-product-categories"
This is the contents of the published config file:
return [ 'api_key' => env('SHARP_API_KEY'), 'base_url' => env('SHARP_API_BASE_URL', 'https://sharpapi.com/api/v1'), 'api_job_status_polling_wait' => env('SHARP_API_JOB_STATUS_POLLING_WAIT', 180), 'api_job_status_polling_interval' => env('SHARP_API_JOB_STATUS_POLLING_INTERVAL', 10), 'api_job_status_use_polling_interval' => env('SHARP_API_JOB_STATUS_USE_POLLING_INTERVAL', false), ];
Make sure to set your SharpAPI key in your .env file:
SHARP_API_KEY=your-api-key
Usage
use SharpAPI\TthHospitalityProductCategories\TthHospitalityProductCategoriesService; $service = new TthHospitalityProductCategoriesService(); // Categorize a hospitality product $categories = $service->hospitalityProductCategories( 'Luxury Ocean View Suite with Balcony', 'Miami Beach', // optional city 'United States', // optional country 'English', // optional language 5, // optional max quantity of categories 'professional', // optional voice tone 'Spacious suite with king bed, private balcony, ocean views, and complimentary breakfast' // optional context ); // $categories will contain a JSON string with the categorization results
Parameters
productName(string): The name of the product to categorizecity(string|null): The city related to the product (optional)country(string|null): The country related to the product (optional)language(string|null): The language for the response (optional)maxQuantity(int|null): Maximum number of categories to return (optional)voiceTone(string|null): The tone of voice for the response (optional)context(string|null): Additional context for better categorization (optional)
Response Format
The response is a JSON string containing categories with weight scores:
{
"data": {
"type": "api_job_result",
"id": "afb7cc23-23a5-479c-92a9-be983792dabc",
"attributes": {
"status": "success",
"type": "tth_hospitality_product_categories",
"result": [
{
"name": "Adult Only Hotels",
"weight": 10
},
{
"name": "Luxury Hotels",
"weight": 8.5
},
{
"name": "Boutique Hotels",
"weight": 7.5
},
{
"name": "Romantic Getaways",
"weight": 7
},
{
"name": "City Hotels",
"weight": 6.5
},
{
"name": "Couples Retreats",
"weight": 6
}
]
}
}
}
The weight score is a value between 1.0 and 10.0, where 10.0 represents 100% relevance.
Features
- Automatically categorizes hospitality products
- Provides relevance scores for each category
- Supports location-specific categorization with city and country parameters
- Works with multiple languages
- Allows for additional context to improve categorization accuracy
- Helps organize product catalogs and improve search functionality
Credits
License
The MIT License (MIT). Please see License File for more information.
sharpapi/laravel-tth-hospitality-product-categories 适用场景与选型建议
sharpapi/laravel-tth-hospitality-product-categories 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「api」 「laravel」 「categorization」 「artificial intelligence」 「travel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sharpapi/laravel-tth-hospitality-product-categories 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sharpapi/laravel-tth-hospitality-product-categories 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sharpapi/laravel-tth-hospitality-product-categories 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Alfabank REST API integration
Zero-dependency raw PHP DNS resolver, domain-ownership verification, and intoDNS/MxToolbox-style diagnostics. Queries authoritative nameservers directly over sockets — never trusts the recursive cache for ownership checks.
Laravel package for Accurate Online API integration.
A lightweight plain-PHP framework for database-backed CRUD APIs.
bughq error tracking - PHP SDK
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 33
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-09