Answer architecture round 1: 0 🔴, 2 🟡; keep stepped_from through the typed answer, name the events HumanTyped and HumanTalked, parse the answer from the prompt's start, and say why the judge decides release_ready
This commit is contained in:
@@ -129,18 +129,18 @@ 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, so typed_answer finds where it ends."""
|
||||
return f"Your question: {question}\n\n{TYPED_HERE}\n\n{answer}\n\nContinue the task.{stepped_to(route, anchor, stepped)}"
|
||||
"""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)}"
|
||||
|
||||
|
||||
# Precedes the answer in typed's prompt.
|
||||
TYPED_HERE = "The human answers it at loop-claude's terminal:"
|
||||
# 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. The last TYPED_HERE is typed's: the one-line answer cannot hold it, and only the sentences on a stepped rung follow."""
|
||||
_, here, after = prompt.rpartition(f"\n\n{TYPED_HERE}\n\n")
|
||||
return after.split("\n", 1)[0] if here and prompt.startswith("Your question: ") else None
|
||||
"""The answer typed put in prompt, so the judge reads it 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
|
||||
|
||||
|
||||
def stepped_to(route: Route, anchor: Rung | None, stepped: bool) -> str:
|
||||
|
||||
Reference in New Issue
Block a user