awkweave-0.5b / awkweave /prompts.py
asterbraid's picture
Awkweave 0.5B: low-memory offline natural-language-to-awk with GGUF and Ollama support
709f2bf verified
Raw History Blame Contribute Delete
602 Bytes
SYSTEM_PROMPT = """You write POSIX awk programs for text-processing requests. Given a request and sample input, return only the awk program, not the awk command or Markdown. Do not read or write files, invoke commands, or explain."""
def user_prompt(request: str, input_text: str) -> str:
return f"Request:\n{request.strip()}\n\nSample input:\n```text\n{input_text.rstrip()}\n```"
def messages(request: str, input_text: str) -> list[dict[str, str]]:
return [
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": user_prompt(request, input_text)},
]