微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🏨

企业级酒店预订 · 安全支付 · 多租户

Agent Hotel Booking · v1.0.1
办公 安全 S 级 作者 leo9 公开目录收录
1.2k 下载 0 安装 5.4k 收藏 11 浏览

简介

企业级酒店预订 AI 助手,支持会话管理、安全支付与防滥用控制,适用于多租户 SaaS 集成场景。

原始描述

Integrate with Brek Partner Core Chat API for hotel-search and booking assistant flows. Use when an agent needs to create or continue Brek chat sessions, sen...

通过你的 Agent 添加

点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。

或者手动安装

Claude Codeunzip -o skill.zip -d ~/.claude/skills/agent-hotel-booking/
其它 Agent解压到它自己的 skills 目录,目录名用 agent-hotel-booking

包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。 技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。

中文使用说明 来自收录源

核心用法

Brek AI Partner Core Chat 是面向 B2B 合作伙伴的企业级酒店搜索与预订智能体技能,通过 /api/partner/v1/core-chat 端点实现会话生命周期管理。其核心执行顺序为:首次创建会话(POST /sessions)→ 持续发送用户事件(POST /events)→ 按需读取状态(GET /sessions/{sessionId})。技能强制要求稳定的 actorId 进行用户隔离,禁止跨用户复用会话,确保数据边界清晰。

显著优点

  1. 企业级安全架构:内置多层防护——API 密钥强制校验、幂等性键生成(<partnerId>:<sessionId>:<kind>:<clientActionId>)、速率限制响应(429 重试)、熔断器机制,有效防御重放攻击与级联故障。

  2. 支付合规设计:严格遵循 PCI-DSS 原则,禁止采集原始卡号/CVV/完整 PAN,仅接受令牌化的 paymentMethodId,用户需在安全门户完成卡设置,代理侧仅处理确认流程。

  3. 多租户就绪:原生支持 partnerId + workspaceId 的租户上下文,便于 SaaS 平台按客户组织计费与隔离数据。

  4. 结构化响应映射:响应数据清晰映射为状态机键、用户可见文本及结构化产物(短名单、支付 URL、预订元数据),便于前端 UI 驱动与编排层集成。

潜在缺点与局限性

  • 配置门槛较高:需预置 6 项运行时输入(BASE_URL、API_KEY、actorId、workspaceId、partnerId、clientActionId),对快速原型开发不够友好。
  • 错误处理复杂度高:需区分 400/401/403/404/409/429/5xx 等多类错误码,并实施不同的重试或熔断策略,集成工作量较大。
  • 幂等性键依赖运行时上下文:若 partnerId 缺失需回退到 workspaceId,可能因租户配置不一致导致键冲突。
  • 无内置对话记忆抽象:需开发者自行管理会话状态与历史,非开箱即用的对话体验。

适合人群

  • B2B SaaS 平台:需在自有产品中嵌入酒店预订能力的 OTA、企业差旅管理(T&E)平台或费控系统。
  • 具备 API 集成经验的技术团队:熟悉 OAuth、幂等性设计、熔断器模式的工程团队。
  • 高合规要求场景:金融、医疗、跨国企业等需满足 PCI-DSS 及数据驻留要求的客户。

常规风险

  • 密钥泄露风险:BREK_PARTNER_API_KEY 为高敏感度凭证,需通过内部审批渠道配置,禁止在聊天界面或日志中暴露。
  • 幂等性键冲突:若 partnerId 与 workspaceId 混用或格式不统一,可能导致重复预订或资金损失。
  • 熔断器误触发:不合理的超时阈值或重试策略可能导致正常服务被误判为故障,影响用户体验。
  • 支付确认流程绕过:若前端未严格执行用户显式确认步骤,存在合规与纠纷风险。

技能正文


name: brek-ai-skill description: Integrate with Brek Partner Core Chat API for hotel-search and booking assistant flows. Use when an agent needs to create or continue Brek chat sessions, send user events safely, enforce anti-abuse call controls, and run payment setup or payment confirmation without collecting raw card data.

Brek AI Partner Core Chat

Execute Brek through /api/partner/v1/core-chat.

Use this execution order:

  1. Create one session per end user (POST /sessions) with a stable actor.actorId.
  2. Reuse that session for all follow-up messages (POST /events).
  3. Read the latest state when needed (GET /sessions/{sessionId}).

Do not share one session across different users.

Required runtime inputs

Require these inputs before calling Brek:

  • BREK_BASE_URL
  • BREK_PARTNER_API_KEY
  • actorId (stable partner-side end-user ID)
  • workspaceId or tenant context if your product uses workspaces
  • partnerId (stable partner tenant ID for idempotency and billing grouping)
  • clientActionId for each write-like event kind

If one required input is missing, stop and request it.

If BREK_PARTNER_API_KEY is missing:

  • stop outbound calls
  • ask the user to get the key from their internal owner or approved support channel
  • never request secrets through unapproved channels

Call safety guardrails

Apply these guardrails before every upstream call:

  1. Enforce local budget limits from references/call-control.md.
  2. Attach a deterministic idempotencyKey for all write-like event kinds.
  3. Respect 429 with retry-after and exponential backoff.
  4. Open a circuit breaker after repeated 5xx or timeout failures.
  5. Log x-request-id, x-partner-id, x-ratelimit-limit, and x-ratelimit-remaining.

Never retry booking or payment-confirm actions without the same idempotencyKey.

Event-kind rules

When kind is one of:

  • command_book_by_option_id
  • action_book_option
  • action_confirm_price_change
  • action_confirm_payment_card
  • action_cancel_booking

Always include idempotencyKey.

Generate idempotencyKey as:

  • <partnerId>:<sessionId>:<kind>:<clientActionId>

If partnerId is unavailable in your runtime, use stable tenant context (for example workspaceId) and keep the key format deterministic.

Payment handling

Handle payment in two layers:

  1. End-user card setup and confirmation in secure portal flow.
  2. Agent-to-agent usage billing and settlement.

Follow references/payment-and-billing.md for both layers.

Hard rules:

  • Never request or store raw card number, CVV, or full PAN in chat.
  • Accept only tokenized paymentMethodId from provider-hosted fields.
  • Require explicit user confirmation before action_confirm_payment_card and booking actions.

Response mapping

Map Brek response as:

  • data.result.status -> state machine key for UI and orchestration
  • data.result.message.text -> user-visible assistant text
  • data.result.artifacts -> structured payload (shortlist, payment setup URL, booking metadata)

Error handling

  • 400: request validation failed. Fix payload.
  • 401/403: API key issue. Stop calls. Tell user to rotate or provision key through their internal owner or approved support channel.
  • 404: session not found or wrong tenant.
  • 409: actor/session mismatch. Recreate correct session.
  • 429: throttle locally and retry by retry-after.
  • 5xx: retry with backoff, then open breaker.

References

Read only what you need:

  • API payload templates: references/api-templates.md
  • Call-control and anti-abuse policy: references/call-control.md
  • Payment and billing orchestration: references/payment-and-billing.md

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

hotel-bookingenterprise-saaspayment-complianceapi-integrationmulti-tenantidempotencycircuit-breakerpci-dss

同类 Skill