File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1212from . import pdl_interpreter
1313from ._version import version
1414from .pdl_ast import (
15+ BlockType ,
1516 PdlBlock ,
1617 PdlLocationType ,
1718 Program ,
@@ -58,6 +59,13 @@ class InterpreterConfig(TypedDict, total=False):
5859 """Event loop to schedule LLM calls."""
5960
6061
62+ class Result (TypedDict ):
63+ result : Any
64+ scope : dict [str , Any ]
65+ trace : BlockType
66+ replay : dict [str , Any ]
67+
68+
6169def exec_program (
6270 prog : Program ,
6371 config : Optional [InterpreterConfig ] = None ,
@@ -92,13 +100,13 @@ def exec_program(
92100 case "result" :
93101 return result
94102 case "all" :
95- scope = future_scope .result ()
96- return {
103+ result_all : Result = {
97104 "result" : result ,
98- "scope" : scope ,
105+ "scope" : future_scope . result () ,
99106 "trace" : trace ,
100107 "replay" : state .replay ,
101108 }
109+ return result_all
102110 case _:
103111 assert False , 'The `output` variable should be "result" or "all"'
104112
You can’t perform that action at this time.
0 commit comments