@@ -52,6 +52,11 @@ class AgentPythonPackageManager(str, Enum):
52
52
pip = "pip"
53
53
54
54
55
+ class AgentUsageType (str , Enum ):
56
+ fastapi = "fastapi"
57
+ python = "python"
58
+
59
+
55
60
@app .command ()
56
61
async def deploy (
57
62
path : Annotated [
@@ -63,6 +68,9 @@ async def deploy(
63
68
package_manager : Annotated [
64
69
AgentPythonPackageManager , typer .Option (case_sensitive = False , prompt = True )
65
70
] = AgentPythonPackageManager .pip .value , # type: ignore
71
+ usage_type : Annotated [
72
+ AgentUsageType , typer .Option (case_sensitive = False , prompt = True )
73
+ ] = AgentUsageType .fastapi .value , # type: ignore
66
74
):
67
75
"""
68
76
Deploy or redeploy an agent
@@ -88,6 +96,7 @@ async def deploy(
88
96
data .add_field ("secret" , libertai_config .secret )
89
97
data .add_field ("python_version" , python_version )
90
98
data .add_field ("package_manager" , package_manager .value )
99
+ data .add_field ("usage_type" , usage_type .value )
91
100
data .add_field ("code" , open (agent_zip_path , "rb" ), filename = "libertai-agent.zip" )
92
101
93
102
async with aiohttp .ClientSession () as session :
@@ -98,6 +107,7 @@ async def deploy(
98
107
) as response :
99
108
if response .status == 200 :
100
109
response_data = UpdateAgentResponse (** json .loads (await response .text ())) # noqa: F821
110
+ # TODO: don't show /docs if deployed in python mode
101
111
rich .print (
102
112
f"[green]Agent successfully deployed on http://[{ response_data .instance_ip } ]:8000/docs"
103
113
)
0 commit comments