FluidTalk Characters — Python SDK
Official Python SDK for the FluidTalk Characters API — drive an AI persona across DMs, comments, triggers, and follow-ups from your own bot or connector.
Install
pip install fluidtalk
Quickstart
from fluidtalk import FluidTalk
ft = FluidTalk(token="ftc_live_...") # base_url defaults to production
# A lead DM'd the character — get the reply and send the bubbles yourself.
reply = ft.chat(platform="instagram", handle="mark", message="hey ava")
for bubble in reply.bubbles:
send_dm("mark", bubble.text) # your platform I/O
print("session:", reply.session_id)
Your per-character connector token (ftc_live_…) is sent as X-Connector-Token; get it from the character's platform settings in the dashboard. The token is the character — you name the platform in each call.
API
| Method | Endpoint |
|---|---|
ft.chat(platform, handle, message="", image_url=None, session_id=None, own_username=None) |
POST /chat |
ft.event(platform, handle, external_event_id, event_type="purchase", amount=None, currency=None) |
POST /events |
ft.trigger(platform, handle, event_id, external_event_id, context=None, own_username=None) |
POST /triggers |
ft.followups.list(platform, own_username=None, limit=100) |
GET /followups |
ft.followups.ack(followup_id) |
POST /followups/{id}/ack |
ft.comment(platform, post_ref, caption=None, image_urls=None, author_handle=None) |
POST /comments |
ft.comment_reply(platform, post_ref, replier_handle, reply_text="", parent_comment_ref=None) |
POST /comments/reply |
ft.inbound_media(platform, data, filename=None, content_type=None) |
POST /inbound-media |
inbound_media is for a lead-sent photo you only have the bytes of — a Telegram
file_id you downloaded, or an Instagram CDN URL that is signed and expires. You pass
raw bytes, it returns a permanent url to hand to chat as image_url. Already have a
publicly-fetchable URL? Skip it and pass that straight to chat.
up = ft.inbound_media(platform="instagram", data=raw_bytes, filename="photo.jpg")
ft.chat(platform="instagram", handle="mark", message="what do you think? 😏", image_url=up.url)
Responses are returned as attribute-access objects unwrapped from the {data, request_id} envelope (reply.bubbles[0].text, res.decision); a missing field reads as None. Use .to_dict() for the raw dict.
Errors
Every non-2xx response raises a typed exception (all subclass FluidTalkError / ApiError):
from fluidtalk import FluidTalk, PaymentRequiredError, RateLimitError, ApiError
ft = FluidTalk(token="ftc_live_...")
try:
reply = ft.chat(platform="instagram", handle="mark", message="hi")
except PaymentRequiredError:
top_up_wallet() # 402 — the wallet can't cover the turn
except RateLimitError:
backoff_and_retry() # 429
except ApiError as e:
print(e.status, e.code, e.request_id, e.message)
AuthError (401), PaymentRequiredError (402), PermissionError (403), NotFoundError (404), ConflictError (409), ValidationError (422), RateLimitError (429), and ApiError (anything else).
Configuration
FluidTalk(
token="ftc_live_...",
base_url="https://api-talk.fluidvip.com", # green: https://api-green-talk.fluidvip.com
timeout=60.0,
)
Development
pip install -e ".[dev]"
pytest
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fluidtalk-2.1.0.tar.gz.
File metadata
- Download URL: fluidtalk-2.1.0.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14e3f3be3a6c38f370936e17bbcaa334a32bd13a0ed07627514dec2f37cce664
|
|
| MD5 |
aee828b3635ad8e53bf552b282282ab0
|
|
| BLAKE2b-256 |
6f9629fe16e6652906a66acccab1d6680c2c966f2187d45e1430bda3c7bbe1a7
|
File details
Details for the file fluidtalk-2.1.0-py3-none-any.whl.
File metadata
- Download URL: fluidtalk-2.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
405aaa2e4bd8dbbcb8536c363b90f3b9c04bea0607a0fcd1d06ff76b5e9038d4
|
|
| MD5 |
1885d680348caa10fc7b4b2f3358e947
|
|
| BLAKE2b-256 |
458712da4c9fd93c142607816363fdcde52b5ee5b386e0312ed2b2acdd240cff
|