import covalent_cloud as cc
ex = cc.CloudExecutor(env="my-basic-env", num_cpus=2, memory="4GB", time_limit="45 minutes")
@cc.service(executor=ex, name="Sample Service", auth=False, tags=["sample", "demo"])
def sample_service(x: int, y: int) -> int:
return {"total": x + y}
@sample_service.endpoint("/add")
def special_addition(total: int, z: int) -> int:
return total + z
@sample_service.endpoint("/mul")
def special_multiplication(total: int, z: int) -> int:
return total * z
client = cc.deploy(sample_service)(x=6, y=7)
client = cc.get_deployment(client, wait=True)
print(client.add(z=1))
print(client.mul(z=-1))