Typed Python client for the TibaBot Healthcare AI API
Project description
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")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tibabot_client-1.0.0.tar.gz
(9.4 kB
view details)
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 tibabot_client-1.0.0.tar.gz.
File metadata
- Download URL: tibabot_client-1.0.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f8ed69dda18e264df2b44dd1324d10f16e6ebb47b93cac1ba91f84e3f40c94a
|
|
| MD5 |
cb0d952f5b2d9c2e180f010bbcd37b71
|
|
| BLAKE2b-256 |
57100c447926b795c3d1a47035e22adfafdeb812455c4fba3e2bdae73b8ec37a
|
File details
Details for the file tibabot_client-1.0.0-py3-none-any.whl.
File metadata
- Download URL: tibabot_client-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f93a8ede1b43045a10c9b00712f856e94833a02a99a803e8682e96e453df4fbd
|
|
| MD5 |
b70a0e8e4c3ee69ddde454cd50017103
|
|
| BLAKE2b-256 |
669f3e9f60212925e925cd906b35c9909bb0393db9bca082d93aff5d37c0e71e
|