You see people complaining about LLM ability, and then you see their prompt, and it's the 2006 equivalent of googling "I need to know where I can go for getting the fastest service for car washes in Toronto that does wheel washing too"
This isn’t always the case and depends on what you need.
And do you perhaps also have memory enabled on the LLMs you are thinking of?
"Communication usually fails, except by accident." —Osmo A. Wiio [1]
1. Just jazz up and expand on a simple prompt.
2. A full context deficiency analysis and multiple question interview system to bounds check and restructure your prompt into your ‘goal’.
3. Realizing that what looks like a good human prompt is not the same as what functions as a good ‘next token’ prompt.
If you just want #1:
import dspy
class EnhancePrompt(dspy.Signature):
"""Assemble the final enhanced prompt from all gathered context"""
essential_context: str = dspy.InputField(desc="All essential context and requirements")
original_request: str = dspy.InputField(desc="The user's original request")
enhanced: str = dspy.OutputField(desc="Complete, detailed, unambiguous prompt. Omit politeness markers. You must limit all numbered lists to a maximum of 3 items.")
def enhance_prompt(prompt: str, temperature: float = 0.2) -> str: with dspy.context(lm=dspy.LM("_MODEL_", temperature=temperature)): return dspy.ChainOfThought(EnhancePrompt)(essential_context=f"Direct enhancement request: {prompt}", original_request=prompt).enhanced
res = enhance_prompt("Read bigfile.py and explain the do_math() function.")print(res)
Read the file `bigfile.py` and provide a detailed explanation of the `do_math()` function. Your explanation should cover:
1. The function's purpose and what it accomplishes
2. The input parameters it accepts and the output/return value it produces
3. The step-by-step logic and algorithm used within the function
Include relevant code snippets when explaining key parts of the implementation.