jaclang 0.7.22__py3-none-any.whl → 0.7.25__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.
Potentially problematic release.
This version of jaclang might be problematic. Click here for more details.
- jaclang/__init__.py +5 -10
- jaclang/cli/cli.py +50 -30
- jaclang/compiler/__init__.py +2 -2
- jaclang/compiler/absyntree.py +87 -48
- jaclang/compiler/codeloc.py +7 -2
- jaclang/compiler/compile.py +10 -3
- jaclang/compiler/parser.py +26 -23
- jaclang/compiler/passes/ir_pass.py +2 -2
- jaclang/compiler/passes/main/def_impl_match_pass.py +46 -0
- jaclang/compiler/passes/main/fuse_typeinfo_pass.py +146 -123
- jaclang/compiler/passes/main/import_pass.py +6 -2
- jaclang/compiler/passes/main/pyast_load_pass.py +36 -35
- jaclang/compiler/passes/main/pyjac_ast_link_pass.py +7 -7
- jaclang/compiler/passes/main/registry_pass.py +3 -12
- jaclang/compiler/passes/main/tests/fixtures/defn_decl_mismatch.jac +19 -0
- jaclang/compiler/passes/main/tests/fixtures/fstrings.jac +2 -0
- jaclang/compiler/passes/main/tests/test_decl_def_match_pass.py +59 -0
- jaclang/compiler/passes/main/tests/test_registry_pass.py +2 -10
- jaclang/compiler/passes/main/tests/test_type_check_pass.py +1 -1
- jaclang/compiler/passes/main/type_check_pass.py +8 -6
- jaclang/compiler/passes/transform.py +27 -3
- jaclang/compiler/passes/utils/mypy_ast_build.py +246 -26
- jaclang/compiler/symtable.py +6 -0
- jaclang/compiler/tests/test_importer.py +2 -2
- jaclang/langserve/engine.py +14 -12
- jaclang/langserve/server.py +7 -2
- jaclang/langserve/tests/test_server.py +1 -1
- jaclang/langserve/utils.py +17 -3
- jaclang/plugin/builtin.py +3 -3
- jaclang/plugin/default.py +612 -236
- jaclang/plugin/feature.py +274 -99
- jaclang/plugin/plugin.md +471 -0
- jaclang/plugin/spec.py +231 -86
- jaclang/plugin/tests/fixtures/other_root_access.jac +9 -9
- jaclang/plugin/tests/test_features.py +2 -2
- jaclang/runtimelib/architype.py +1 -370
- jaclang/runtimelib/constructs.py +2 -0
- jaclang/runtimelib/context.py +2 -4
- jaclang/runtimelib/importer.py +7 -2
- jaclang/runtimelib/machine.py +78 -6
- jaclang/runtimelib/memory.py +2 -4
- jaclang/settings.py +3 -0
- jaclang/tests/fixtures/arch_create_util.jac +7 -0
- jaclang/tests/fixtures/arch_rel_import_creation.jac +30 -0
- jaclang/tests/fixtures/builtin_dotgen.jac +6 -6
- jaclang/tests/fixtures/create_dynamic_architype.jac +35 -0
- jaclang/tests/fixtures/edge_node_walk.jac +1 -1
- jaclang/tests/fixtures/edges_walk.jac +1 -1
- jaclang/tests/fixtures/enum_inside_archtype.jac +16 -11
- jaclang/tests/fixtures/expr_type.jac +54 -0
- jaclang/tests/fixtures/gendot_bubble_sort.jac +1 -1
- jaclang/tests/fixtures/glob_multivar_statement.jac +15 -0
- jaclang/tests/fixtures/registry.jac +20 -8
- jaclang/tests/fixtures/visit_order.jac +20 -0
- jaclang/tests/foo/__init__.jac +0 -0
- jaclang/tests/main.jac +2 -0
- jaclang/tests/test_cli.py +68 -4
- jaclang/tests/test_language.py +113 -27
- jaclang/utils/helpers.py +92 -14
- jaclang/utils/lang_tools.py +6 -2
- jaclang/utils/treeprinter.py +4 -2
- {jaclang-0.7.22.dist-info → jaclang-0.7.25.dist-info}/METADATA +2 -1
- {jaclang-0.7.22.dist-info → jaclang-0.7.25.dist-info}/RECORD +65 -55
- {jaclang-0.7.22.dist-info → jaclang-0.7.25.dist-info}/WHEEL +1 -1
- {jaclang-0.7.22.dist-info → jaclang-0.7.25.dist-info}/entry_points.txt +0 -0
jaclang/plugin/plugin.md
ADDED
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
# **Override Plugin Implementations**
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## AccessValidation Related Methods
|
|
5
|
+
### **`allow_root`**
|
|
6
|
+
```python
|
|
7
|
+
def allow_root(
|
|
8
|
+
architype: Architype,
|
|
9
|
+
root_id: UUID,
|
|
10
|
+
level: AccessLevel | int | str
|
|
11
|
+
) -> None:
|
|
12
|
+
"""Allow all access from target root graph to current Architype."""
|
|
13
|
+
```
|
|
14
|
+
### **`disallow_root`**
|
|
15
|
+
```python
|
|
16
|
+
def disallow_root(
|
|
17
|
+
architype: Architype,
|
|
18
|
+
root_id: UUID,
|
|
19
|
+
level: AccessLevel | int | str
|
|
20
|
+
) -> None:
|
|
21
|
+
"""Disallow all access from target root graph to current Architype."""
|
|
22
|
+
```
|
|
23
|
+
### **`unrestrict`**
|
|
24
|
+
```python
|
|
25
|
+
def unrestrict(
|
|
26
|
+
architype: Architype,
|
|
27
|
+
level: AccessLevel | int | str
|
|
28
|
+
) -> None:
|
|
29
|
+
"""Allow everyone to access current Architype."""
|
|
30
|
+
```
|
|
31
|
+
### **`restrict`**
|
|
32
|
+
```python
|
|
33
|
+
def restrict(
|
|
34
|
+
architype: Architype
|
|
35
|
+
) -> None:
|
|
36
|
+
"""Disallow others to access current Architype."""
|
|
37
|
+
```
|
|
38
|
+
### **`check_read_access`**
|
|
39
|
+
```python
|
|
40
|
+
def check_read_access(
|
|
41
|
+
to: Anchor
|
|
42
|
+
) -> bool:
|
|
43
|
+
"""Read Access Validation."""
|
|
44
|
+
```
|
|
45
|
+
### **`check_connect_access`**
|
|
46
|
+
```python
|
|
47
|
+
def check_connect_access(
|
|
48
|
+
to: Anchor
|
|
49
|
+
) -> bool:
|
|
50
|
+
"""Connect Access Validation."""
|
|
51
|
+
```
|
|
52
|
+
### **`check_write_access`**
|
|
53
|
+
```python
|
|
54
|
+
def check_write_access(
|
|
55
|
+
to: Anchor
|
|
56
|
+
) -> bool:
|
|
57
|
+
"""Write Access Validation."""
|
|
58
|
+
```
|
|
59
|
+
### **`check_access_level`**
|
|
60
|
+
```python
|
|
61
|
+
def check_access_level(
|
|
62
|
+
to: Anchor
|
|
63
|
+
) -> AccessLevel:
|
|
64
|
+
"""Access validation."""
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## Node Related Methods
|
|
69
|
+
### **`node_dot`**
|
|
70
|
+
```python
|
|
71
|
+
def node_dot(
|
|
72
|
+
node: NodeArchitype,
|
|
73
|
+
dot_file: Optional[str]
|
|
74
|
+
) -> str:
|
|
75
|
+
"""Generate Dot file for visualizing nodes and edges."""
|
|
76
|
+
```
|
|
77
|
+
### **`get_edges`**
|
|
78
|
+
```python
|
|
79
|
+
def get_edges(
|
|
80
|
+
node: NodeAnchor,
|
|
81
|
+
dir: EdgeDir,
|
|
82
|
+
filter_func: Optional[Callable[[list[EdgeArchitype]], list[EdgeArchitype]]],
|
|
83
|
+
target_obj: Optional[list[NodeArchitype]],
|
|
84
|
+
) -> list[EdgeArchitype]:
|
|
85
|
+
"""Get edges connected to this node."""
|
|
86
|
+
```
|
|
87
|
+
### **`edges_to_nodes`**
|
|
88
|
+
```python
|
|
89
|
+
def edges_to_nodes(
|
|
90
|
+
node: NodeAnchor,
|
|
91
|
+
dir: EdgeDir,
|
|
92
|
+
filter_func: Optional[Callable[[list[EdgeArchitype]], list[EdgeArchitype]]],
|
|
93
|
+
target_obj: Optional[list[NodeArchitype]],
|
|
94
|
+
) -> list[NodeArchitype]:
|
|
95
|
+
"""Get set of nodes connected to this node."""
|
|
96
|
+
```
|
|
97
|
+
### **`remove_edge`**
|
|
98
|
+
```python
|
|
99
|
+
def remove_edge(
|
|
100
|
+
node: NodeAnchor,
|
|
101
|
+
edge: EdgeAnchor
|
|
102
|
+
) -> None:
|
|
103
|
+
"""Remove reference without checking sync status."""
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
## Edge Related Methods
|
|
108
|
+
### **`detach`**
|
|
109
|
+
```python
|
|
110
|
+
def detach(
|
|
111
|
+
edge: EdgeAnchor
|
|
112
|
+
) -> None:
|
|
113
|
+
"""Detach edge from nodes."""
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
## Walker Related Methods
|
|
118
|
+
### **`visit_node`**
|
|
119
|
+
```python
|
|
120
|
+
def visit_node(
|
|
121
|
+
walker: WalkerArchitype,
|
|
122
|
+
expr: (
|
|
123
|
+
list[NodeArchitype | EdgeArchitype]
|
|
124
|
+
| list[NodeArchitype]
|
|
125
|
+
| list[EdgeArchitype]
|
|
126
|
+
| NodeArchitype
|
|
127
|
+
| EdgeArchitype
|
|
128
|
+
),
|
|
129
|
+
) -> bool:
|
|
130
|
+
"""Include target node/edge to current walker's visit queue."""
|
|
131
|
+
```
|
|
132
|
+
### **`ignore`**
|
|
133
|
+
```python
|
|
134
|
+
def ignore(
|
|
135
|
+
walker: WalkerArchitype,
|
|
136
|
+
expr: (
|
|
137
|
+
list[NodeArchitype | EdgeArchitype]
|
|
138
|
+
| list[NodeArchitype]
|
|
139
|
+
| list[EdgeArchitype]
|
|
140
|
+
| NodeArchitype
|
|
141
|
+
| EdgeArchitype
|
|
142
|
+
),
|
|
143
|
+
) -> bool:
|
|
144
|
+
"""Include target node/edge to current walker's ignored architype."""
|
|
145
|
+
```
|
|
146
|
+
### **`spawn_call`**
|
|
147
|
+
```python
|
|
148
|
+
def spawn_call(
|
|
149
|
+
op1: Architype,
|
|
150
|
+
op2: Architype
|
|
151
|
+
) -> WalkerArchitype:
|
|
152
|
+
"""Invoke data spatial call."""
|
|
153
|
+
```
|
|
154
|
+
### **`disengage`**
|
|
155
|
+
```python
|
|
156
|
+
def disengage(
|
|
157
|
+
walker: WalkerArchitype
|
|
158
|
+
) -> bool:
|
|
159
|
+
"""Disengaged current walker."""
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
## Builtin Related Methods
|
|
164
|
+
### **`dotgen`**
|
|
165
|
+
```python
|
|
166
|
+
def dotgen(
|
|
167
|
+
node: NodeArchitype,
|
|
168
|
+
depth: int,
|
|
169
|
+
traverse: bool,
|
|
170
|
+
edge_type: Optional[list[str]],
|
|
171
|
+
bfs: bool,
|
|
172
|
+
edge_limit: int,
|
|
173
|
+
node_limit: int,
|
|
174
|
+
dot_file: Optional[str],
|
|
175
|
+
) -> str:
|
|
176
|
+
"""Print the dot graph."""
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
## Cmd Related Methods
|
|
181
|
+
### **`create_cmd`**
|
|
182
|
+
```python
|
|
183
|
+
def create_cmd(
|
|
184
|
+
) -> None:
|
|
185
|
+
"""Create Jac CLI cmds."""
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
## Feature Related Methods
|
|
190
|
+
### **`setup`**
|
|
191
|
+
```python
|
|
192
|
+
def setup(
|
|
193
|
+
) -> None:
|
|
194
|
+
"""Set Class References to Jac."""
|
|
195
|
+
```
|
|
196
|
+
### **`get_context`**
|
|
197
|
+
```python
|
|
198
|
+
def get_context(
|
|
199
|
+
) -> ExecutionContext:
|
|
200
|
+
"""Get current execution context."""
|
|
201
|
+
```
|
|
202
|
+
### **`get_object`**
|
|
203
|
+
```python
|
|
204
|
+
def get_object(
|
|
205
|
+
id: str
|
|
206
|
+
) -> Architype | None:
|
|
207
|
+
"""Get object by id."""
|
|
208
|
+
```
|
|
209
|
+
### **`object_ref`**
|
|
210
|
+
```python
|
|
211
|
+
def object_ref(
|
|
212
|
+
obj: Architype
|
|
213
|
+
) -> str:
|
|
214
|
+
"""Get object's id."""
|
|
215
|
+
```
|
|
216
|
+
### **`make_architype`**
|
|
217
|
+
```python
|
|
218
|
+
def make_architype(
|
|
219
|
+
cls: type,
|
|
220
|
+
arch_base: Type[Architype],
|
|
221
|
+
on_entry: list[DSFunc],
|
|
222
|
+
on_exit: list[DSFunc],
|
|
223
|
+
) -> Type[Architype]:
|
|
224
|
+
"""Create a obj architype."""
|
|
225
|
+
```
|
|
226
|
+
### **`make_obj`**
|
|
227
|
+
```python
|
|
228
|
+
def make_obj(
|
|
229
|
+
on_entry: list[DSFunc],
|
|
230
|
+
on_exit: list[DSFunc]
|
|
231
|
+
) -> Callable[[type], type]:
|
|
232
|
+
"""Create a obj architype."""
|
|
233
|
+
```
|
|
234
|
+
### **`make_node`**
|
|
235
|
+
```python
|
|
236
|
+
def make_node(
|
|
237
|
+
on_entry: list[DSFunc],
|
|
238
|
+
on_exit: list[DSFunc]
|
|
239
|
+
) -> Callable[[type], type]:
|
|
240
|
+
"""Create a node architype."""
|
|
241
|
+
```
|
|
242
|
+
### **`make_edge`**
|
|
243
|
+
```python
|
|
244
|
+
def make_edge(
|
|
245
|
+
on_entry: list[DSFunc],
|
|
246
|
+
on_exit: list[DSFunc]
|
|
247
|
+
) -> Callable[[type], type]:
|
|
248
|
+
"""Create a edge architype."""
|
|
249
|
+
```
|
|
250
|
+
### **`make_walker`**
|
|
251
|
+
```python
|
|
252
|
+
def make_walker(
|
|
253
|
+
on_entry: list[DSFunc],
|
|
254
|
+
on_exit: list[DSFunc]
|
|
255
|
+
) -> Callable[[type], type]:
|
|
256
|
+
"""Create a walker architype."""
|
|
257
|
+
```
|
|
258
|
+
### **`impl_patch_filename`**
|
|
259
|
+
```python
|
|
260
|
+
def impl_patch_filename(
|
|
261
|
+
file_loc: str,
|
|
262
|
+
) -> Callable[[Callable[P, T]], Callable[P, T]]:
|
|
263
|
+
"""Update impl file location."""
|
|
264
|
+
```
|
|
265
|
+
### **`jac_import`**
|
|
266
|
+
```python
|
|
267
|
+
def jac_import(
|
|
268
|
+
target: str,
|
|
269
|
+
base_path: str,
|
|
270
|
+
absorb: bool,
|
|
271
|
+
cachable: bool,
|
|
272
|
+
mdl_alias: Optional[str],
|
|
273
|
+
override_name: Optional[str],
|
|
274
|
+
lng: Optional[str],
|
|
275
|
+
items: Optional[dict[str, Union[str, Optional[str]]]],
|
|
276
|
+
reload_module: Optional[bool],
|
|
277
|
+
) -> tuple[types.ModuleType, ...]:
|
|
278
|
+
"""Core Import Process."""
|
|
279
|
+
```
|
|
280
|
+
### **`create_test`**
|
|
281
|
+
```python
|
|
282
|
+
def create_test(
|
|
283
|
+
test_fun: Callable
|
|
284
|
+
) -> Callable:
|
|
285
|
+
"""Create a new test."""
|
|
286
|
+
```
|
|
287
|
+
### **`run_test`**
|
|
288
|
+
```python
|
|
289
|
+
def run_test(
|
|
290
|
+
filepath: str,
|
|
291
|
+
filter: Optional[str],
|
|
292
|
+
xit: bool,
|
|
293
|
+
maxfail: Optional[int],
|
|
294
|
+
directory: Optional[str],
|
|
295
|
+
verbose: bool,
|
|
296
|
+
) -> int:
|
|
297
|
+
"""Run the test suite in the specified .jac file."""
|
|
298
|
+
```
|
|
299
|
+
### **`elvis`**
|
|
300
|
+
```python
|
|
301
|
+
def elvis(
|
|
302
|
+
op1: Optional[T],
|
|
303
|
+
op2: T
|
|
304
|
+
) -> T:
|
|
305
|
+
"""Jac's elvis operator feature."""
|
|
306
|
+
```
|
|
307
|
+
### **`has_instance_default`**
|
|
308
|
+
```python
|
|
309
|
+
def has_instance_default(
|
|
310
|
+
gen_func: Callable[[], T]
|
|
311
|
+
) -> T:
|
|
312
|
+
"""Jac's has container default feature."""
|
|
313
|
+
```
|
|
314
|
+
### **`report`**
|
|
315
|
+
```python
|
|
316
|
+
def report(
|
|
317
|
+
expr: Any
|
|
318
|
+
) -> Any:
|
|
319
|
+
"""Jac's report stmt feature."""
|
|
320
|
+
```
|
|
321
|
+
### **`edge_ref`**
|
|
322
|
+
```python
|
|
323
|
+
def edge_ref(
|
|
324
|
+
node_obj: NodeArchitype | list[NodeArchitype],
|
|
325
|
+
target_obj: Optional[NodeArchitype | list[NodeArchitype]],
|
|
326
|
+
dir: EdgeDir,
|
|
327
|
+
filter_func: Optional[Callable[[list[EdgeArchitype]], list[EdgeArchitype]]],
|
|
328
|
+
edges_only: bool,
|
|
329
|
+
) -> list[NodeArchitype] | list[EdgeArchitype]:
|
|
330
|
+
"""Jac's apply_dir stmt feature."""
|
|
331
|
+
```
|
|
332
|
+
### **`connect`**
|
|
333
|
+
```python
|
|
334
|
+
def connect(
|
|
335
|
+
left: NodeArchitype | list[NodeArchitype],
|
|
336
|
+
right: NodeArchitype | list[NodeArchitype],
|
|
337
|
+
edge_spec: Callable[[NodeAnchor, NodeAnchor], EdgeArchitype],
|
|
338
|
+
edges_only: bool,
|
|
339
|
+
) -> list[NodeArchitype] | list[EdgeArchitype]:
|
|
340
|
+
"""Jac's connect operator feature.
|
|
341
|
+
|
|
342
|
+
Note: connect needs to call assign compr with tuple in op
|
|
343
|
+
"""
|
|
344
|
+
```
|
|
345
|
+
### **`disconnect`**
|
|
346
|
+
```python
|
|
347
|
+
def disconnect(
|
|
348
|
+
left: NodeArchitype | list[NodeArchitype],
|
|
349
|
+
right: NodeArchitype | list[NodeArchitype],
|
|
350
|
+
dir: EdgeDir,
|
|
351
|
+
filter_func: Optional[Callable[[list[EdgeArchitype]], list[EdgeArchitype]]],
|
|
352
|
+
) -> bool:
|
|
353
|
+
"""Jac's disconnect operator feature."""
|
|
354
|
+
```
|
|
355
|
+
### **`assign_compr`**
|
|
356
|
+
```python
|
|
357
|
+
def assign_compr(
|
|
358
|
+
target: list[T],
|
|
359
|
+
attr_val: tuple[tuple[str], tuple[Any]]
|
|
360
|
+
) -> list[T]:
|
|
361
|
+
"""Jac's assign comprehension feature."""
|
|
362
|
+
```
|
|
363
|
+
### **`get_root`**
|
|
364
|
+
```python
|
|
365
|
+
def get_root(
|
|
366
|
+
) -> Root:
|
|
367
|
+
"""Get current root."""
|
|
368
|
+
```
|
|
369
|
+
### **`get_root_type`**
|
|
370
|
+
```python
|
|
371
|
+
def get_root_type(
|
|
372
|
+
) -> Type[Root]:
|
|
373
|
+
"""Get root type."""
|
|
374
|
+
```
|
|
375
|
+
### **`build_edge`**
|
|
376
|
+
```python
|
|
377
|
+
def build_edge(
|
|
378
|
+
is_undirected: bool,
|
|
379
|
+
conn_type: Optional[Type[EdgeArchitype] | EdgeArchitype],
|
|
380
|
+
conn_assign: Optional[tuple[tuple, tuple]],
|
|
381
|
+
) -> Callable[[NodeAnchor, NodeAnchor], EdgeArchitype]:
|
|
382
|
+
"""Build edge operator."""
|
|
383
|
+
```
|
|
384
|
+
### **`save`**
|
|
385
|
+
```python
|
|
386
|
+
def save(
|
|
387
|
+
obj: Architype | Anchor,
|
|
388
|
+
) -> None:
|
|
389
|
+
"""Save object."""
|
|
390
|
+
```
|
|
391
|
+
### **`destroy`**
|
|
392
|
+
```python
|
|
393
|
+
def destroy(
|
|
394
|
+
obj: Architype | Anchor,
|
|
395
|
+
) -> None:
|
|
396
|
+
"""Destroy object."""
|
|
397
|
+
```
|
|
398
|
+
### **`get_semstr_type`**
|
|
399
|
+
```python
|
|
400
|
+
def get_semstr_type(
|
|
401
|
+
file_loc: str,
|
|
402
|
+
scope: str,
|
|
403
|
+
attr: str,
|
|
404
|
+
return_semstr: bool
|
|
405
|
+
) -> Optional[str]:
|
|
406
|
+
"""Jac's get_semstr_type stmt feature."""
|
|
407
|
+
```
|
|
408
|
+
### **`obj_scope`**
|
|
409
|
+
```python
|
|
410
|
+
def obj_scope(
|
|
411
|
+
file_loc: str,
|
|
412
|
+
attr: str
|
|
413
|
+
) -> str:
|
|
414
|
+
"""Jac's get_semstr_type feature."""
|
|
415
|
+
```
|
|
416
|
+
### **`get_sem_type`**
|
|
417
|
+
```python
|
|
418
|
+
def get_sem_type(
|
|
419
|
+
file_loc: str,
|
|
420
|
+
attr: str
|
|
421
|
+
) -> tuple[str | None, str | None]:
|
|
422
|
+
"""Jac's get_semstr_type feature."""
|
|
423
|
+
```
|
|
424
|
+
### **`with_llm`**
|
|
425
|
+
```python
|
|
426
|
+
def with_llm(
|
|
427
|
+
file_loc: str,
|
|
428
|
+
model: Any,
|
|
429
|
+
model_params: dict[str, Any],
|
|
430
|
+
scope: str,
|
|
431
|
+
incl_info: list[tuple[str, str]],
|
|
432
|
+
excl_info: list[tuple[str, str]],
|
|
433
|
+
inputs: list[tuple[str, str, str, Any]],
|
|
434
|
+
outputs: tuple,
|
|
435
|
+
action: str,
|
|
436
|
+
_globals: dict,
|
|
437
|
+
_locals: Mapping,
|
|
438
|
+
) -> Any:
|
|
439
|
+
"""Jac's with_llm stmt feature."""
|
|
440
|
+
```
|
|
441
|
+
### **`gen_llm_body`**
|
|
442
|
+
```python
|
|
443
|
+
def gen_llm_body(
|
|
444
|
+
_pass: PyastGenPass,
|
|
445
|
+
node: ast.Ability
|
|
446
|
+
) -> list[ast3.AST]:
|
|
447
|
+
"""Generate the by LLM body."""
|
|
448
|
+
```
|
|
449
|
+
### **`by_llm_call`**
|
|
450
|
+
```python
|
|
451
|
+
def by_llm_call(
|
|
452
|
+
_pass: PyastGenPass,
|
|
453
|
+
model: ast3.AST,
|
|
454
|
+
model_params: dict[str, ast.Expr],
|
|
455
|
+
scope: ast3.AST,
|
|
456
|
+
inputs: Sequence[Optional[ast3.AST]],
|
|
457
|
+
outputs: Sequence[Optional[ast3.AST]] | ast3.Call,
|
|
458
|
+
action: Optional[ast3.AST],
|
|
459
|
+
include_info: list[tuple[str, ast3.AST]],
|
|
460
|
+
exclude_info: list[tuple[str, ast3.AST]],
|
|
461
|
+
) -> ast3.Call:
|
|
462
|
+
"""Return the LLM Call, e.g. _Jac.with_llm()."""
|
|
463
|
+
```
|
|
464
|
+
### **`get_by_llm_call_args`**
|
|
465
|
+
```python
|
|
466
|
+
def get_by_llm_call_args(
|
|
467
|
+
_pass: PyastGenPass,
|
|
468
|
+
node: ast.FuncCall
|
|
469
|
+
) -> dict:
|
|
470
|
+
"""Get the by LLM call args."""
|
|
471
|
+
```
|