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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a67d6b082c9b1fb9738e18666f8847f3895de0b2f04e77ece9d856219d13296c |
|
MD5 | a4398350f7e328c3f1423de390799e5e |
|
BLAKE2b-256 | 3e2a53d676266af16e46cf54bd7745fa928648723eb24adece8d6359de392f15 |
Close
Hashes for qcentroid_agent_cli-0.3.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9231a6c8fdb32f67d3e226724530f761df57e8b96a7c8d7fafa94877b6715a34 |
|
MD5 | 70241922ab9e28a41d48fc337b8ca13e |
|
BLAKE2b-256 | a957362bc155fec27c2bba63007f166d924c22a4928b33e0191ccf2b8dcb5439 |