Answer principles round 1: 0 🔴, 6 🟡; correct the interrupt's definition, show the judge the question beside the typed answer, ask in one call returning Talk, add a Talking state, give the worker its own question past the cap, assert the prompts' facts, and keep stepped_from as the step's one owner
This commit is contained in:
@@ -130,17 +130,20 @@ def answered(question: str, answer: str, route: Route, anchor: Rung | None, step
|
||||
|
||||
def typed(question: str, answer: str, route: Route, anchor: Rung | None, stepped: bool) -> str:
|
||||
"""Resumes the worker with the human's answer to an interrupt. answer is one line, as the terminal reads it."""
|
||||
return f"{TYPED_HERE}\n{answer}\n\nYour question was: {question}\n\nContinue the task.{stepped_to(route, anchor, stepped)}"
|
||||
return f"{TYPED_HERE}\n{answer}\n\nYour question was: {question}\n\nContinue the task. The chunk is finished only once {ANSWERS_RECORDED}.{stepped_to(route, anchor, stepped)}"
|
||||
|
||||
|
||||
# Opens typed's prompt, and the answer is the line after it, so typed_answer reads the answer from the prompt's start alone.
|
||||
TYPED_HERE = "The human answered your question at loop-claude's terminal:"
|
||||
|
||||
|
||||
def typed_answer(prompt: str) -> str | None:
|
||||
"""The answer typed put in prompt, so the judge reads it as the human's; None for any other prompt."""
|
||||
def typed_answer(prompt: str) -> tuple[str, str] | None:
|
||||
"""The rest of the prompt typed made, and the answer it put there, so the judge reads the answer as the human's; None for any other prompt."""
|
||||
opening = f"{TYPED_HERE}\n"
|
||||
return prompt.removeprefix(opening).split("\n", 1)[0] if prompt.startswith(opening) else None
|
||||
if not prompt.startswith(opening):
|
||||
return None
|
||||
answer, _, rest = prompt.removeprefix(opening).partition("\n\n")
|
||||
return rest, answer
|
||||
|
||||
|
||||
def stepped_to(route: Route, anchor: Rung | None, stepped: bool) -> str:
|
||||
|
||||
Reference in New Issue
Block a user