This release is a pre-release and may not be stable for production use.
FlagQAI Python client
Connect Python workflows to FlagQAI, the scientific discovery agent companion to FlagQuantum. This alpha client uses an existing FlagQAI deployment; it does not install or run the agent backend.
Install
python -m pip install flagqai==0.1.0a1
Python 3.10+; no third-party runtime dependencies. Python 3.12 is the tested baseline for this preview. A compatible FlagQAI service and its login password are required for authenticated operations.
Connect
from getpass import getpass
from flagqai import Client
with Client("https://your-flagqai-service.example") as client:
print(client.health())
client.login(getpass("FlagQAI password: "))
print(client.me())
catalog = client.capabilities()
# manifest = client.task_manifest("your-existing-task-id")
client.logout()
The URL is your deployment's API origin, without an API path. If the service's
allowed web origin differs, pass origin="https://your-web-origin.example".
The server must allow this origin. HTTPS is required except for local loopback
development; production secure session cookies require HTTPS.
Supported operations
| Method | Service operation |
|---|---|
health() |
Read /healthz |
login(password) |
Establish a web session |
me() |
Read authenticated identity and configuration status |
capabilities() |
Read the service capability catalog |
task_manifest(task_id) |
Read an existing task's manifest |
logout() |
Request logout and clear local cookies |
Methods return the server JSON object without rewriting evidence or capability
claims. FlagQAIError.status_code exposes HTTP failures; transport and JSON
errors have no status code. Error messages omit server bodies and credentials.
Cookies stay in memory. The client does not follow redirects, retry requests, or submit compute/QPU jobs. Exiting the context clears local cookies, but does not revoke server-side sessions. Do not share a client instance across threads. The timeout is a per-socket timeout (default 30 seconds), not a total workflow deadline. Responses larger than 8 MiB are rejected.
This preview targets the existing /api/v1/web session API. That API and this
alpha client may change before a stable release. Validation uses a local HTTP
fixture matching the inspected service routes; it is not live-service certification.
Development
python -m pip install -e .
python -m unittest discover -s tests -v
Licensed under Apache-2.0.
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 flagqai-0.1.0a1.tar.gz.
File metadata
- Download URL: flagqai-0.1.0a1.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1366a2a6f6a242bc4660525f3680c123154319e2728d6ec7c54d701a75577a9
|
|
| MD5 |
ef8b7594ae77cc15198bc61ed64bfba3
|
|
| BLAKE2b-256 |
bc7f7802dfc60e6cddfdb65af84cae354df9637583487d14e3474931eb56507b
|
File details
Details for the file flagqai-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: flagqai-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52bd3fe43193b7a54eff965dc903eb76a37c5b87e64a4ccb95911531bd7e34b7
|
|
| MD5 |
91e5f38fe306c0c941712f3fbedc6129
|
|
| BLAKE2b-256 |
2865ff2488dd3ab8a02c092835f048a21410841ce4b980bb5855d4c473e17d34
|