TibaBot Python Client
Typed Python SDK for the TibaBot Healthcare AI API.
Installation
pip install tibabot-client
Quick Start
from tibabot import TibaBotClient, ChatRequest, TriageRequest, ClinicalAssistRequest
client = TibaBotClient(
base_url="https://tibabot.vitora.nexora.africa",
api_key="sk-your-api-key",
)
# Health check
print(client.health())
# Chat with the AI assistant
resp = client.chat(ChatRequest(message="I have a headache for 3 days"))
print(resp.reply)
# Triage symptoms
triage = client.triage(TriageRequest(symptoms=["headache", "fever", "neck stiffness"]))
print(f"Triage level: {triage.triage_level}")
print(f"Red flags: {triage.red_flags_detected}")
# Clinical decision support (provider)
assist = client.clinical_assist(
ClinicalAssistRequest(query="Treat malaria in pregnancy 2nd trimester")
)
print(assist.recommendation)
# ICD-10 coding
codes = client.icd10_code({"text": "Type 2 diabetes with hypertension"})
print(codes.codes)
client.close()
Authentication
# API key (default)
client = TibaBotClient(base_url="...", api_key="sk-...")
# Bearer token
client = TibaBotClient(base_url="...", bearer_token="eyJ...")
Error Handling
from tibabot import (
AuthenticationError,
RateLimitError,
ValidationError,
ServerError,
)
try:
resp = client.chat(ChatRequest(message="Hello"))
except AuthenticationError:
print("Check your API key")
except RateLimitError as e:
print(f"Slow down! Retry after {e.retry_after}s")
except ValidationError as e:
print(f"Invalid request: {e.details}")
except ServerError:
print("Something went wrong on the server")
Release files for tibabot-client 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tibabot_client-1.0.0.tar.gz | 9.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tibabot_client-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:19.0 kB
Release files / tibabot_client-1.0.0.tar.gz
| Download URL | tibabot_client-1.0.0.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f8ed69dda18e264df2b44dd1324d10f16e6ebb47b93cac1ba91f84e3f40c94a
|
|
BLAKE2b-256 checksum How to use checksums |
57100c447926b795c3d1a47035e22adfafdeb812455c4fba3e2bdae73b8ec37a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / tibabot_client-1.0.0-py3-none-any.whl
| Download URL | tibabot_client-1.0.0-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f93a8ede1b43045a10c9b00712f856e94833a02a99a803e8682e96e453df4fbd
|
|
BLAKE2b-256 checksum How to use checksums |
669f3e9f60212925e925cd906b35c9909bb0393db9bca082d93aff5d37c0e71e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|