Skip to main content

AI-ready booking tools for BeTask services.

Project description

BeLinked ADK - AI Booking Tools

BeLinked ADK is a Python toolkit for building AI-powered booking agents.
It provides ready-to-use tools for browsing services, selecting branches, and creating appointments in a structured and testable way.

This package is designed to work with agent frameworks such as Google ADK, enabling developers to build conversational booking experiences quickly.


🚀 Features

  • Retrieve available branches
  • Browse services by branch
  • Create appointments with validation
  • Support chat-driven booking flows
  • Compatible with AI agent frameworks (Google ADK, etc.)

🧠 Use Case

Developers can build AI agents that handle booking workflows end-to-end:

  1. User asks for a service (e.g., haircut)
  2. Agent suggests available branches
  3. Agent lists services for the selected branch
  4. Agent collects date and time
  5. Agent completes the booking

📦 Installation

Create a shop on BeLinked and get your API key

BeLinked

Install Dependency

pip install belinked-adk

Setup Environment

BETASK_SHOP_ID=5156aa9d-e7d9-4042-b19b-9a3f1411e61b

Agent Example

from google.adk.agents import Agent

from belinked_adk.tools.browse_services import browse_services_tool
from belinked_adk.tools.book_appointment import book_appointment_tool
from belinked_adk.tools.get_branches import get_branches_tool
from belinked_adk.utils.date_parser import parse_human_date
from dotenv import load_dotenv
import os

load_dotenv()

BETASK_SHOP_ID = os.getenv("BETASK_SHOP_ID")
LINE_USER_ID = "U71f3509d9af28ba856bac571963c4678"
LINE_DISPLAY_NAME = "un"


def get_branches_wrapper():
    return get_branches_tool(
        line_user_id=LINE_USER_ID,
        line_display_name=LINE_DISPLAY_NAME,
        shop_id=BETASK_SHOP_ID
    )


def browse_services_wrapper(branch_id):
    return browse_services_tool(
        line_user_id=LINE_USER_ID,
        line_display_name=LINE_DISPLAY_NAME,
        shop_id=BETASK_SHOP_ID,
        branch_id=branch_id
    )

def book_appointment_wrapper(
    service_keyword: str,
    date: str,
    time: str,
    remark: str = ""
):
    return book_appointment_tool(
        line_user_id=LINE_USER_ID,
        line_display_name=LINE_DISPLAY_NAME,
        shop_id=BETASK_SHOP_ID,
        service_keyword=service_keyword,
        date=date,
        time=time,
        remark=remark
    )

root_agent = Agent(
    model="gemini-2.5-flash",
    name="booking_agent",
    tools=[
        browse_services_wrapper,
        book_appointment_wrapper,
        get_branches_wrapper,
        parse_human_date
    ],
    instruction="""
คุณคือผู้ช่วยจองคิวร้านบริการ

หน้าที่:
- ช่วย user จองคิว และให้ข้อมูลบริการ

กฎสำคัญ:
- ห้ามเดาข้อมูลเอง
- ต้องใช้ tool เมื่อข้อมูลไม่พอ
- ตอบเป็นภาษาไทย

ลำดับการทำงาน:

1. ถ้า user ถามเกี่ยวกับ "บริการ" แต่ยังไม่มี branch:
   → ต้องเรียก get_branches_tool ก่อน
   → แล้วแสดงรายการสาขาให้ user เลือก

2. ถ้ามี branch แล้ว แต่ยังไม่มี service:
   → ใช้ browse_services_tool

3. ถ้ายังไม่มี date/time:
   → ถาม user

4. ถ้าข้อมูลครบ:
   → ใช้ book_appointment_tool

รูปแบบการตอบ:

- ถ้าแสดงสาขา:
  "มีสาขาให้เลือก:\n- สาขา A\n- สาขา B"

- ถ้าแสดงบริการ:
  "มีบริการ:\n- ..."

- ถ้าไม่มีข้อมูล:
  ให้ถาม user เพิ่ม

- ตอบกลับตามเป็นภาษาที่เป็นมิตรและช่วยเหลือผู้ใช้ในการจองคิว
- ตอบกลับเป็นภาษาตามที่ผู้ใช้ใช้ (ถ้าผู้ใช้ใช้ภาษาไทย ก็ตอบเป็นไทย)
- ห้ามตอบกลับเป็น JSON หรือรูปแบบอื่นที่ไม่ใช่ข้อความธรรมดา
- ห้ามแสดง code หรือ tool call

กฎสำคัญ:
- ผู้ใช้สามารถพูดวันที่แบบธรรมชาติได้ เช่น:
  - วันนี้
  - พรุ่งนี้
  - วันจันทร์หน้า
  - tomorrow

- คุณต้องแปลงวันที่เหล่านี้เป็น format YYYY-MM-DD ด้วย tool parse_human_date ก่อนเรียก tool

"""
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

belinked_adk-1.0.4.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

belinked_adk-1.0.4-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file belinked_adk-1.0.4.tar.gz.

File metadata

  • Download URL: belinked_adk-1.0.4.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for belinked_adk-1.0.4.tar.gz
Algorithm Hash digest
SHA256 693cce7b443ac50ac8b0d155eaf25706b7c35396c86630084306afdbdfd2f24f
MD5 142579c246fe4a2f2a347bf689ea737e
BLAKE2b-256 1d61a5846a1d2462a5b82bbdd6fd715311885c428fff1b2a0f0b69d5ff7ae2e8

See more details on using hashes here.

File details

Details for the file belinked_adk-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: belinked_adk-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for belinked_adk-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7fa46214bd571ff01073f4c71b63b278e2553c84b11e99a1b2385ab79e8f8fbd
MD5 321a0c15db4232c84a9f3bbeb4d357b2
BLAKE2b-256 c3b4f1426bc5dcbd5d2178e290efa086b969390f9af800fcf283ca5f042e5771

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page