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 4444 - name : pre-commit checks
4545 run : pre-commit run -a
4646 - 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
4848 if : matrix.python-version == '3.11'
4949 - 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
5151 if : matrix.python-version != '3.11'
5252
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 44
55from .pdl_lazy import PdlApply , PdlDict , PdlLazy , PdlList
66
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+
718
819class SerializeMode (StrEnum ):
920 LITELLM = "litellm"
@@ -27,6 +38,9 @@ def __len__(self):
2738 def __getitem__ (self , index : int | slice ): # pyright: ignore
2839 return []
2940
41+ # def to_json(self):
42+ # return json.dumps(self.serialize(SerializeMode.LITELLM))
43+
3044
3145class SingletonContext (PDLContext ):
3246 message : PdlLazy [dict [str , Any ]]
You can’t perform that action at this time.
0 commit comments