File tree Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 44
44
- name : pre-commit checks
45
45
run : pre-commit run -a
46
46
- name : run tests
47
- run : py.test -v --capture=tee-sys --ignore=tests/test_examples_run.py --ignore=tests/test_schema.py tests
47
+ run : py.test -v --capture=tee-sys --ignore=tests/test_examples_run.py --ignore=tests/test_optimizer.py --ignore=tests/ test_schema.py tests
48
48
if : matrix.python-version == '3.11'
49
49
- name : run tests
50
- run : py.test -v --capture=tee-sys --ignore=tests/test_examples_run.py tests
50
+ run : py.test -v --capture=tee-sys --ignore=tests/test_examples_run.py --ignore=tests/test_optimizer.py tests
51
51
if : matrix.python-version != '3.11'
52
52
Original file line number Diff line number Diff line change
1
+ defs:
2
+ m1:
3
+ content: Hello
4
+ m2:
5
+ content: Bye
6
+ m3:
7
+ content: Hello again
8
+
9
+ mycontext: ${ (m1 + m2) * m3 }
10
+
11
+ text:
12
+ - model: ollama_chat/granite3.2:2b
13
+ input: ${ mycontext }
14
+ - ${ mycontext }
Original file line number Diff line number Diff line change 4
4
5
5
from .pdl_lazy import PdlApply , PdlDict , PdlLazy , PdlList
6
6
7
+ # def _default(self, obj):
8
+ # return getattr(obj.__class__, "to_json", _default.default)(obj) # pyright: ignore
9
+
10
+ # _default.default = JSONEncoder().default # pyright: ignore
11
+ # JSONEncoder.default = _default # pyright: ignore
12
+
13
+ # TODO:
14
+ # We could make only DependentContext implement Sequence, IndependentContext could implement Set instead. Review how getItem should be implemented.
15
+ # Should single message (result of a block) be flattened in the interpreter?
16
+ # Serialization
17
+
7
18
8
19
class SerializeMode (StrEnum ):
9
20
LITELLM = "litellm"
@@ -27,6 +38,9 @@ def __len__(self):
27
38
def __getitem__ (self , index : int | slice ): # pyright: ignore
28
39
return []
29
40
41
+ # def to_json(self):
42
+ # return json.dumps(self.serialize(SerializeMode.LITELLM))
43
+
30
44
31
45
class SingletonContext (PDLContext ):
32
46
message : PdlLazy [dict [str , Any ]]
You can’t perform that action at this time.
0 commit comments