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()
catch BaseException 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
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 qcentroid_agent_cli-0.3.3.tar.gz.
File metadata
- Download URL: qcentroid_agent_cli-0.3.3.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27f31eb84d34e146e5099454c3ea136d38ab966550052bcc1a231fc1bef4d583
|
|
| MD5 |
1ad061e4b639741ce8a47ec448bf1388
|
|
| BLAKE2b-256 |
1875e93a8235d8d569a5f84f5567a02c3963417c81cdb55b1798a7ed8ffa5184
|
File details
Details for the file qcentroid_agent_cli-0.3.3-py3-none-any.whl.
File metadata
- Download URL: qcentroid_agent_cli-0.3.3-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61c9dc4ec167783b3a68478ea594a8442f4a84c1332c756ec524127709d609af
|
|
| MD5 |
4946dfe1434a7bd02b845bb1f6801e10
|
|
| BLAKE2b-256 |
ddab15812e0dd267d2b67f16185a62a6ad46f53634c05f570521af154fbfbcea
|