Complete example
from gjirafatech.truai.serve import TruServeClient, InstanceType
client = TruServeClient()
my_alias = "my_custom_endpoint"
endpoint = client.get(alias=my_alias)
if not endpoint:
client.create(
alias=my_alias,
title="MyEndpoint",
instance_type=InstanceType.Medium,
instance_count=1,
script_path="endpoint_v1.py",
requirements_path="endpoint_requirements.txt",
description="My first custom endpoint",
local_file=False
)
else:
client.update(
alias=my_alias,
script_path="endpoint_v2.py",
local_file=False
)