From 9adba0270c879b5621688706ef2894585f865574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20W=C3=BCstenberg?= Date: Fri, 21 Feb 2025 10:16:59 +0100 Subject: [PATCH] System prompt in Markdown Also, a few TailwindCSS fixes. --- html/common.go | 2 +- html/home.go | 2 +- llm/prompts/{system.txt => system.md} | 4 ++++ llm/translate.go | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) rename llm/prompts/{system.txt => system.md} (98%) diff --git a/html/common.go b/html/common.go index 942efb8..0f8aafd 100644 --- a/html/common.go +++ b/html/common.go @@ -88,7 +88,7 @@ func footer() Node { container(true, false, Div(Class("h-16 flex items-center justify-center space-x-8"), A(Class("hover:text-amber-500"), Href("https://evaehler.dk"), Text("Sprogdesign af Eva Ehler")), - A(Class("hover:text-amber-500"), Href("https://www.maragu.dk"), Text("Software af maragu")), + A(Class("hover:text-amber-500"), Href("https://www.maragu.dev"), Text("Software af maragu")), ), ), ) diff --git a/html/home.go b/html/home.go index 08be28e..f8ce861 100644 --- a/html/home.go +++ b/html/home.go @@ -48,7 +48,7 @@ func TextareaPartial(name, value string) Node { Label(For(name+"-area"), Class("block text-sm/6 font-medium text-gray-900"), Text(name)), Div(Class("mt-2"), Textarea(Rows("10"), Cols("40"), Name(name), ID(name+"-area"), Placeholder(placeholder), - Class("block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-amber-600 sm:text-sm/6 font-sans"), + Class("block w-full rounded-md bg-white px-3 py-1.5 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-amber-600 sm:text-sm/6 font-sans"), Text(value)), ), ), diff --git a/llm/prompts/system.txt b/llm/prompts/system.md similarity index 98% rename from llm/prompts/system.txt rename to llm/prompts/system.md index 92952ad..8242c6a 100644 --- a/llm/prompts/system.txt +++ b/llm/prompts/system.md @@ -2,6 +2,8 @@ Du er en tolk der kan oversætte fra dansk til ildsk og fra ildsk til dansk. Ild Følgende er regler for sproget ildsk. +## Ordbog + Dette dokument er en ordbog fra ildsk til dansk, med ":" som separator: ``` @@ -38,6 +40,8 @@ koraash qu Mira: beskyt min ven Mira tiras ignia: styrkens ild ``` +## Grammatik + For at gøre dragesproget mere autentisk kan vi tilføje nogle grammatiske regler: Navneord og ejerskab: Hvis noget tilhører nogen, kan vi bruge "Qu" før navneordet. Fx: "Qu Nuran" betyder "Min stjerne." diff --git a/llm/translate.go b/llm/translate.go index 2e83e95..74052ed 100644 --- a/llm/translate.go +++ b/llm/translate.go @@ -10,7 +10,7 @@ import ( "app/model" ) -//go:embed prompts/system.txt +//go:embed prompts/system.md var system string func (c *Client) Translate(ctx context.Context, to model.Language, text string) (string, error) {