diff --git a/examples/thinker/critique_answer.llm b/examples/thinker/critique_answer.llm new file mode 100644 index 0000000..502ee35 --- /dev/null +++ b/examples/thinker/critique_answer.llm @@ -0,0 +1,8 @@ +Create a Gendo subroutine called critique_answer that accepts one string +parameter named candidate and returns a critique string. Inside use prompt with +model gpt-4 and temperature 0.0 asking the LLM to act as a strict logician who +inspects the supplied candidate for logical, factual or reasoning errors. If +the candidate is flawless the LLM must reply exactly with No issues found. +Otherwise it must list the problems it detects in plain text sentences. The +subroutine simply outputs whatever the LLM returns so later stages can decide +whether refinement is required. diff --git a/examples/thinker/generate_candidates.llm b/examples/thinker/generate_candidates.llm new file mode 100644 index 0000000..37ff9ad --- /dev/null +++ b/examples/thinker/generate_candidates.llm @@ -0,0 +1,9 @@ +Create a Gendo subroutine named generate_candidates that takes a single string +parameter called question and returns an array of three candidate answers. +Inside the subroutine call prompt with model gpt-4, temperature 0.7 and n set +to 3. The prompt must instruct the LLM to think step by step, label its +reasoning with the exact tag THOUGHT and its conclusion with the exact tag +ANSWER, and to follow that format without any extra text. Each of the three +completions should be collected into a list so the caller receives +candidates[0], candidates[1] and candidates[2] as separate strings in +THOUGHT / ANSWER format. diff --git a/examples/thinker/judge_best.llm b/examples/thinker/judge_best.llm new file mode 100644 index 0000000..8a5ae22 --- /dev/null +++ b/examples/thinker/judge_best.llm @@ -0,0 +1,9 @@ +Create a Gendo subroutine named judge_best that receives an array called +candidates containing three candidate strings and returns the best candidate’s +ANSWER text. Call prompt with model gpt-4 and temperature 0.0, giving the LLM +the three numbered candidates and asking it to choose which is most correct and +logically sound. Instruct it to respond in two lines where the first begins +with BEST_ANSWER: followed by the full THOUGHT / ANSWER content of the chosen +candidate and the second begins with REASON: followed by a brief justification. +After the prompt call extract only the text after BEST_ANSWER: and return that +as the final answer. diff --git a/examples/thinker/reasoning_loop.llm b/examples/thinker/reasoning_loop.llm new file mode 100644 index 0000000..90ff8ce --- /dev/null +++ b/examples/thinker/reasoning_loop.llm @@ -0,0 +1,9 @@ +Create a top-level Gendo routine called reasoning_loop that accepts the user’s +question string and produces a final answer string. The routine must call +generate_candidates to obtain an array of candidates, map critique_answer +across that array to gather critiques, iterate through the indexes 0 to 2 and +for each position either keep the original candidate if its critique is No +issues found. or call refine_answer to replace it with a corrected version, +collect the resulting candidates into a new array and pass that array to +judge_best, then output the string returned by judge_best. The routine ends by +printing the final answer so users see only the selected, vetted ANSWER. diff --git a/examples/thinker/refine_answer.llm b/examples/thinker/refine_answer.llm new file mode 100644 index 0000000..7a97a22 --- /dev/null +++ b/examples/thinker/refine_answer.llm @@ -0,0 +1,9 @@ +Create a Gendo subroutine called refine_answer that takes two string +parameters, candidate and critique, and returns a revised candidate. If the +critique text equals No issues found. the subroutine should bypass any LLM call +and return the original candidate unchanged. Otherwise call prompt with model +gpt-4, temperature 0.5 and include both the original candidate and the critique +in the prompt. Instruct the LLM to rewrite the answer fixing every listed issue +while preserving as much correct reasoning as possible, and to output the +result in the exact THOUGHT / ANSWER template. The revised text becomes the +return value.