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.
Metadata
Release files for flagqai 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flagqai-0.1.0a1.tar.gz | 9.8 kB | Without provenance | Details for flagqai-0.1.0a1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flagqai-0.1.0a1-py3-none-any.whl | Python 3 | none | any | Details for flagqai-0.1.0a1-py3-none-any.whl |
Total release size: 18.9 kB
Release files / flagqai-0.1.0a1.tar.gz
| Download URL | flagqai-0.1.0a1.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1366a2a6f6a242bc4660525f3680c123154319e2728d6ec7c54d701a75577a9
|
|
BLAKE2b-256 checksum How to use checksums |
bc7f7802dfc60e6cddfdb65af84cae354df9637583487d14e3474931eb56507b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.14
|
Release files / flagqai-0.1.0a1-py3-none-any.whl
| Download URL | flagqai-0.1.0a1-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52bd3fe43193b7a54eff965dc903eb76a37c5b87e64a4ccb95911531bd7e34b7
|
|
BLAKE2b-256 checksum How to use checksums |
2865ff2488dd3ab8a02c092835f048a21410841ce4b980bb5855d4c473e17d34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.14
|
Security for flagqai 0.1.0a1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.