Skip to content

Instantly share code, notes, and snippets.

@enorms
Created July 13, 2023 22:29
Show Gist options
  • Save enorms/dcc13a5f8a2adf447e15f945065f342f to your computer and use it in GitHub Desktop.
Save enorms/dcc13a5f8a2adf447e15f945065f342f to your computer and use it in GitHub Desktop.
Check LLM output accuracy via reverse query
import pyperclip
def copy_question_rating_to_clipboard(answer: str, question: str) -> None:
rating_prompt = (
f"On a scale of 0 to 100, with 100 being perfect and 0 being completely wrong, "
f"rate how well this response `{answer}` answers this question `{question}`? "
"Give only the number rating."
)
pyperclip.copy(rating_prompt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment