cycls 0.0.2.88__tar.gz → 0.0.2.90__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cycls
3
- Version: 0.0.2.88
3
+ Version: 0.0.2.90
4
4
  Summary: Distribute Intelligence
5
5
  Author-email: "Mohammed J. AlRujayi" <mj@cycls.com>
6
6
  Requires-Python: >=3.9
@@ -19,7 +19,8 @@ Distribute Intelligence
19
19
 
20
20
  <h4 align="center">
21
21
  <a href="https://cycls.com">Website</a> |
22
- <a href="https://docs.cycls.com">Docs</a>
22
+ <a href="https://docs.cycls.com">Docs</a> |
23
+ <a href="docs/tutorial.md">Tutorial</a>
23
24
  </h4>
24
25
 
25
26
  <h4 align="center">
@@ -79,7 +80,7 @@ app.deploy() # Live at https://agent.cycls.ai
79
80
  pip install cycls
80
81
  ```
81
82
 
82
- Requires Docker.
83
+ Requires Docker. See the [full tutorial](docs/tutorial.md) for a comprehensive guide.
83
84
 
84
85
  ## What You Get
85
86
 
@@ -102,6 +103,8 @@ Get an API key at [cycls.com](https://cycls.com).
102
103
 
103
104
  ## Authentication & Analytics
104
105
 
106
+ See the [tutorial](docs/tutorial.md#authentication) for full auth and monetization examples.
107
+
105
108
  ```python
106
109
  @cycls.app(pip=["openai"], auth=True, analytics=True)
107
110
  async def app(context):
@@ -118,7 +121,7 @@ async def app(context):
118
121
 
119
122
  ## Native UI Components
120
123
 
121
- Yield structured objects for rich streaming responses:
124
+ Yield structured objects for rich streaming responses. See the [tutorial](docs/tutorial.md#native-ui-components) for all component types and examples.
122
125
 
123
126
  ```python
124
127
  @cycls.app()
@@ -193,7 +196,7 @@ See [docs/streaming-protocol.md](docs/streaming-protocol.md) for frontend integr
193
196
 
194
197
  ## Declarative Infrastructure
195
198
 
196
- Define your entire runtime in the decorator:
199
+ Define your entire runtime in the decorator. See the [tutorial](docs/tutorial.md#declarative-infrastructure) for more details.
197
200
 
198
201
  ```python
199
202
  @cycls.app(
@@ -264,6 +267,13 @@ Access them at `https://your-app.cycls.ai/public/logo.png`.
264
267
 
265
268
  No YAML. No Dockerfiles. No infrastructure repo. The code is the deployment.
266
269
 
270
+ ## Learn More
271
+
272
+ - [Tutorial](docs/tutorial.md) - Comprehensive guide from basics to advanced
273
+ - [Streaming Protocol](docs/streaming-protocol.md) - Frontend integration
274
+ - [Runtime](docs/runtime.md) - Containerization details
275
+ - [Examples](examples/) - Working code samples
276
+
267
277
  ## License
268
278
 
269
279
  MIT
@@ -4,7 +4,8 @@ Distribute Intelligence
4
4
 
5
5
  <h4 align="center">
6
6
  <a href="https://cycls.com">Website</a> |
7
- <a href="https://docs.cycls.com">Docs</a>
7
+ <a href="https://docs.cycls.com">Docs</a> |
8
+ <a href="docs/tutorial.md">Tutorial</a>
8
9
  </h4>
9
10
 
10
11
  <h4 align="center">
@@ -64,7 +65,7 @@ app.deploy() # Live at https://agent.cycls.ai
64
65
  pip install cycls
65
66
  ```
66
67
 
67
- Requires Docker.
68
+ Requires Docker. See the [full tutorial](docs/tutorial.md) for a comprehensive guide.
68
69
 
69
70
  ## What You Get
70
71
 
@@ -87,6 +88,8 @@ Get an API key at [cycls.com](https://cycls.com).
87
88
 
88
89
  ## Authentication & Analytics
89
90
 
91
+ See the [tutorial](docs/tutorial.md#authentication) for full auth and monetization examples.
92
+
90
93
  ```python
91
94
  @cycls.app(pip=["openai"], auth=True, analytics=True)
92
95
  async def app(context):
@@ -103,7 +106,7 @@ async def app(context):
103
106
 
104
107
  ## Native UI Components
105
108
 
106
- Yield structured objects for rich streaming responses:
109
+ Yield structured objects for rich streaming responses. See the [tutorial](docs/tutorial.md#native-ui-components) for all component types and examples.
107
110
 
108
111
  ```python
109
112
  @cycls.app()
@@ -178,7 +181,7 @@ See [docs/streaming-protocol.md](docs/streaming-protocol.md) for frontend integr
178
181
 
179
182
  ## Declarative Infrastructure
180
183
 
181
- Define your entire runtime in the decorator:
184
+ Define your entire runtime in the decorator. See the [tutorial](docs/tutorial.md#declarative-infrastructure) for more details.
182
185
 
183
186
  ```python
184
187
  @cycls.app(
@@ -249,6 +252,13 @@ Access them at `https://your-app.cycls.ai/public/logo.png`.
249
252
 
250
253
  No YAML. No Dockerfiles. No infrastructure repo. The code is the deployment.
251
254
 
255
+ ## Learn More
256
+
257
+ - [Tutorial](docs/tutorial.md) - Comprehensive guide from basics to advanced
258
+ - [Streaming Protocol](docs/streaming-protocol.md) - Frontend integration
259
+ - [Runtime](docs/runtime.md) - Containerization details
260
+ - [Examples](examples/) - Working code samples
261
+
252
262
  ## License
253
263
 
254
264
  MIT
@@ -51,6 +51,7 @@ class App(Function):
51
51
 
52
52
  def _prepare_func(self, prod):
53
53
  self.config.set_prod(prod)
54
+ self.config.debug = not prod # debug=True in local mode
54
55
  self.config.public_path = f"cycls/themes/{self.theme}"
55
56
  user_func, config, name = self.user_func, self.config, self.name
56
57
  self.func = lambda port: __import__("cycls").web.serve(user_func, config, name, port)
@@ -60,6 +61,7 @@ class App(Function):
60
61
  print(f"Starting local server at localhost:{port}")
61
62
  self.config.public_path = str(CYCLS_PATH.joinpath(f"themes/{self.theme}"))
62
63
  self.config.set_prod(False)
64
+ self.config.debug = True
63
65
  uvicorn.run(web(self.user_func, self.config), host="0.0.0.0", port=port)
64
66
 
65
67
  def local(self, port=8080, watch=True):
@@ -12,14 +12,17 @@ import tarfile
12
12
 
13
13
  os.environ["DOCKER_BUILDKIT"] = "1"
14
14
 
15
- ENTRYPOINT_PY = '''import cloudpickle
15
+ ENTRYPOINT_PY = '''import sys
16
+ sys.path.insert(0, '/app')
17
+ import cloudpickle
16
18
  with open("/app/function.pkl", "rb") as f:
17
19
  func, args, kwargs = cloudpickle.load(f)
18
20
  func(*args, **kwargs)
19
21
  '''
20
22
 
21
- RUNNER_PY = '''import cloudpickle
22
- import sys
23
+ RUNNER_PY = '''import sys
24
+ sys.path.insert(0, '/app')
25
+ import cloudpickle
23
26
  import traceback
24
27
  from pathlib import Path
25
28