Library to interact with qcentroid agent api
Project description
qcentroid-agent-cli
Client library to interact with qcentroid agent API.
Functions
Functions:
- obtain status, and context
- obtain input data
- send output data
- set status
- send execution logs
Install
pip install qcentroid-agent-cli
Use
As external agent:
from qcentroid_agent_cli import QCentroidSolverClient
base_url="https://api.qcentroid.xyz"
api_key="1234-4567-8910"
solver_id="123"
def main():
print("Hello QCentroid Agent!")
solver = QCentroidSolverClient(base_url, api_key, solver_id)
while True: # put some escape function
agent = solver.obtainJob()
if agent :
execute_job(agent)
# Wait for 1 minute before the next iteration
time.sleep(60)
if __name__ == "__main__":
main()
As agent:
from qcentroid_agent_cli import QCentroidAgentClient
base_url = "https://api.qcentroid.xyz"
# job-id from EXECUTION_ID env var
# token from QCENTROID_TOKEN env var
agent = QCentroidAgentClient(base_url)
data = None
try:
agent.start()
data = agent.obtainData()
#TODO job with data
agent.sendData(data)
agent.end()
except BaseException as be:
agent.error(be)
#end
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
Built Distribution
Close
Hashes for qcentroid_agent_cli-0.3.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d07d3d7068506747f3075d6a40fd8bd8f82d81318e3693fba67cf5ed6ff4b5b0 |
|
MD5 | c035bb096656d2d5c0e4003555ec1d63 |
|
BLAKE2b-256 | d016116d14ec3d758b996554ea480f29e3de0b41a98f7ee2a78267b73feb2aa8 |
Close
Hashes for qcentroid_agent_cli-0.3.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea7bd12e1cf4fc16191282fde15c2cf1c753a757d305a2e272c3635c940c8cc7 |
|
MD5 | efac6457495ef73e21f562618dfa69e9 |
|
BLAKE2b-256 | 267bdeb70c2d269faef523b7b6a111fe157b8007bbe5176295f82fc8d3df165b |