cycls 0.0.2.37__py3-none-any.whl → 0.0.2.39__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/__init__.py CHANGED
@@ -1,2 +1,2 @@
1
- from .sdk import Agent
1
+ from .sdk import Agent, function
2
2
  from .runtime import Runtime
cycls/sdk.py CHANGED
@@ -7,6 +7,16 @@ import importlib.resources
7
7
  theme_path = importlib.resources.files('cycls').joinpath('theme')
8
8
  cycls_path = importlib.resources.files('cycls')
9
9
 
10
+ def function(python_version=None, pip=None, apt=None, run_commands=None, copy=None, name=None, base_url=None, api_key=None):
11
+ # """
12
+ # A decorator factory that transforms a Python function into a containerized,
13
+ # remotely executable object.
14
+ def decorator(func):
15
+ Name = name or func.__name__
16
+ copy_dict = {i:i for i in copy or []}
17
+ return Runtime(func, Name.replace('_', '-'), python_version, pip, apt, run_commands, copy_dict, base_url, api_key)
18
+ return decorator
19
+
10
20
  class Agent:
11
21
  def __init__(self, theme=theme_path, org=None, api_token=None, pip=[], apt=[], copy=[], keys=["",""], api_key=None):
12
22
  self.org, self.api_token = org, api_token
@@ -28,7 +38,7 @@ class Agent:
28
38
  return f
29
39
  return decorator
30
40
 
31
- def run(self, port=8080):
41
+ def local(self, port=8080):
32
42
  if not self.registered_functions:
33
43
  print("Error: No @agent decorated function found.")
34
44
  return
@@ -41,7 +51,7 @@ class Agent:
41
51
  uvicorn.run(web(i["func"], *i["config"]), host="0.0.0.0", port=port)
42
52
  return
43
53
 
44
- def cycls(self, prod=False, port=8080):
54
+ def deploy(self, prod=False, port=8080):
45
55
  if not self.registered_functions:
46
56
  print("Error: No @agent decorated function found.")
47
57
  return
@@ -55,7 +65,8 @@ class Agent:
55
65
 
56
66
  i["config"][6] = False
57
67
 
58
- copy={str(cycls_path.joinpath('theme')):"public", str(cycls_path)+"/web.py":"web.py"}
68
+ # copy={str(cycls_path.joinpath('theme')):"public", str(cycls_path)+"/web.py":"web.py"}
69
+ copy={str(self.theme):"public", str(cycls_path)+"/web.py":"web.py"}
59
70
  copy.update({i:i for i in self.copy})
60
71
 
61
72
  new = Runtime(
@@ -69,7 +80,7 @@ class Agent:
69
80
  new.deploy(port=port) if prod else new.run(port=port)
70
81
  return
71
82
 
72
- def push(self, prod=False):
83
+ def modal(self, prod=False):
73
84
  self.client = modal.Client.from_credentials(*self.keys)
74
85
  image = (modal.Image.debian_slim()
75
86
  .pip_install("fastapi[standard]", "pyjwt", "cryptography", *self.pip)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cycls
3
- Version: 0.0.2.37
3
+ Version: 0.0.2.39
4
4
  Summary: Cycls SDK
5
5
  Author: Mohammed J. AlRujayi
6
6
  Author-email: mj@cycls.com
@@ -1,9 +1,9 @@
1
- cycls/__init__.py,sha256=ysfA4R_r_INokmpZGK2S8wf2ypLCqwyj0WdfX-hx0bs,51
1
+ cycls/__init__.py,sha256=bVT0dYTXLdSC3ZURgtm-DEOj-VO6RUM6zGsJB0zuj6Y,61
2
2
  cycls/runtime.py,sha256=GoRfyPn2uKTIMb4FSowjfo02DsL0VrunDuybdeZxsvM,18221
3
- cycls/sdk.py,sha256=unZA9v-4YKbuzpsQuQI1A2Xj2PywpS-43S2MtZXUoAM,4601
3
+ cycls/sdk.py,sha256=fUGRlOsj9PaWLOi1GyypfQ-bgAVFRQQAdBViHalJ5JY,5187
4
4
  cycls/theme/assets/index-D0-uI8sw.js,sha256=aUsqm9HZtEJz38o-0MW12ZVeOlSeKigwc_fYJBntiyI,1068551
5
5
  cycls/theme/index.html,sha256=epB4cgSjC7xJOXpVuCwt9r7ivoGvLiXSrxsoOgINw58,895
6
6
  cycls/web.py,sha256=nSEJMUQoPaz8qjgVmsC1JiDRv9Y1UKVzTH4_pRHp_VE,4260
7
- cycls-0.0.2.37.dist-info/METADATA,sha256=bqiLU5K3egK78iGN6v9E0CodfvFQQlgkzKBpYJvsX3M,5666
8
- cycls-0.0.2.37.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
9
- cycls-0.0.2.37.dist-info/RECORD,,
7
+ cycls-0.0.2.39.dist-info/METADATA,sha256=xntqJdoG-uH36saCwj7lgR5SdNUIooZqJ3e7ksPi4Jc,5666
8
+ cycls-0.0.2.39.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
9
+ cycls-0.0.2.39.dist-info/RECORD,,