cycls 0.0.2.47__py3-none-any.whl → 0.0.2.48__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cycls/sdk.py
CHANGED
|
@@ -30,7 +30,7 @@ class Agent:
|
|
|
30
30
|
def decorator(f):
|
|
31
31
|
self.registered_functions.append({
|
|
32
32
|
"func": f,
|
|
33
|
-
"config": ["
|
|
33
|
+
"config": ["theme", False, self.org, self.api_token, header, intro, title, auth],
|
|
34
34
|
# "name": name,
|
|
35
35
|
"name": name or (f.__name__).replace('_', '-'),
|
|
36
36
|
"domain": domain or f"{name}.cycls.ai",
|
|
@@ -65,9 +65,9 @@ class Agent:
|
|
|
65
65
|
|
|
66
66
|
i["config"][1] = False
|
|
67
67
|
|
|
68
|
-
copy={str(self.theme):"
|
|
68
|
+
copy={str(self.theme):"theme", str(cycls_path)+"/web.py":"web.py"}
|
|
69
69
|
copy.update({i:i for i in self.copy})
|
|
70
|
-
copy.update({i:f"
|
|
70
|
+
copy.update({i:f"public/{i}" for i in self.copy_public})
|
|
71
71
|
|
|
72
72
|
def runner(port):
|
|
73
73
|
import uvicorn, logging
|
|
@@ -93,10 +93,15 @@ class Agent:
|
|
|
93
93
|
image = (modal.Image.debian_slim()
|
|
94
94
|
.pip_install("fastapi[standard]", "pyjwt", "cryptography", *self.pip)
|
|
95
95
|
.apt_install(*self.apt)
|
|
96
|
-
.add_local_dir(self.theme, "/root/
|
|
96
|
+
.add_local_dir(self.theme, "/root/theme")
|
|
97
97
|
.add_local_file(str(cycls_path)+"/web.py", "/root/web.py"))
|
|
98
|
+
|
|
98
99
|
for item in self.copy:
|
|
99
100
|
image = image.add_local_file(item, f"/root/{item}") if "." in item else image.add_local_dir(item, f'/root/{item}')
|
|
101
|
+
|
|
102
|
+
for item in self.copy_public:
|
|
103
|
+
image = image.add_local_file(item, f"/root/public/{item}") if "." in item else image.add_local_dir(item, f'/root/public/{item}')
|
|
104
|
+
|
|
100
105
|
self.app = modal.App("development", image=image)
|
|
101
106
|
|
|
102
107
|
if not self.registered_functions:
|
cycls/web.py
CHANGED
|
@@ -119,8 +119,8 @@ def web(func, public_path="", prod=False, org=None, api_token=None, header="", i
|
|
|
119
119
|
pk_test="pk_test_c2VsZWN0LXNsb3RoLTU4LmNsZXJrLmFjY291bnRzLmRldiQ"
|
|
120
120
|
)
|
|
121
121
|
|
|
122
|
-
if Path("
|
|
123
|
-
app.mount("/
|
|
122
|
+
if Path("public").is_dir():
|
|
123
|
+
app.mount("/public", StaticFiles(directory="public", html=True))
|
|
124
124
|
app.mount("/", StaticFiles(directory=public_path, html=True))
|
|
125
125
|
|
|
126
126
|
return app
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
cycls/__init__.py,sha256=bVT0dYTXLdSC3ZURgtm-DEOj-VO6RUM6zGsJB0zuj6Y,61
|
|
2
2
|
cycls/runtime.py,sha256=GoRfyPn2uKTIMb4FSowjfo02DsL0VrunDuybdeZxsvM,18221
|
|
3
|
-
cycls/sdk.py,sha256=
|
|
3
|
+
cycls/sdk.py,sha256=dGcuOrVdjL0epsxyMUappNUC-cfFW0G1ibT8xtCcFVk,5844
|
|
4
4
|
cycls/theme/assets/index-CJ_4y8Hq.js,sha256=5D1ALXOnkyWH3KkmJ4DeYLzlN4JONL1xg3cCgUVyvLA,1103624
|
|
5
5
|
cycls/theme/index.html,sha256=GGoeZQYDvZpkqby9gxMK7XgCazsmJtJ5M4fDJE8IhwU,664
|
|
6
|
-
cycls/web.py,sha256=
|
|
7
|
-
cycls-0.0.2.
|
|
8
|
-
cycls-0.0.2.
|
|
9
|
-
cycls-0.0.2.
|
|
6
|
+
cycls/web.py,sha256=oc1a-Z3dFy4Ub7u0wF5_wrsvoosT3NgrOw4iWJ5KFns,4979
|
|
7
|
+
cycls-0.0.2.48.dist-info/METADATA,sha256=t8TLrWO0TDs7z-yrQdWXPYlGHVp_S9Qcsv2MYTgvras,5673
|
|
8
|
+
cycls-0.0.2.48.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
9
|
+
cycls-0.0.2.48.dist-info/RECORD,,
|
|
File without changes
|