Skip to content

Commit 947ff4a

Browse files
authored
Use the user role by default (#121)
1 parent dbcd463 commit 947ff4a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/pdl/pdl_interpreter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class InterpreterState(BaseModel):
127127
batch: int = 1
128128
# batch=0: streaming
129129
# batch=1: call to generate with `input`
130-
role: RoleType = None
130+
role: RoleType = "user"
131131
cwd: Path = Path.cwd()
132132

133133
def with_yield_result(self: "InterpreterState", b: bool) -> "InterpreterState":

tests/test_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_contribute_context():
4949
state = InterpreterState()
5050
data = Program.model_validate(show_result_data(["context"]))
5151
_, background, _, _ = process_prog(state, empty_scope, data)
52-
assert background == [{"role": None, "content": "How can I help you?: "}]
52+
assert background == [{"role": "user", "content": "How can I help you?: "}]
5353

5454

5555
def test_contribute_false():

tests/test_var.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def test_code_var():
126126
state = InterpreterState()
127127
data = Program.model_validate(code_var_data)
128128
text, _, scope, _ = process_prog(state, empty_scope, data)
129-
assert scope == {"context": [{"role": None, "content": text}], "I": 0}
129+
assert scope == {"context": [{"role": "user", "content": text}], "I": 0}
130130
assert text == "0"
131131

132132

0 commit comments

Comments
 (0)