shithub: oai

Download patch

ref: 29ab27cb06714598f2796428c80b487234b58dbf
parent: 41fac5b8618b693401ef07d24e4031060526b84c
author: sirjofri <sirjofri@sirjofri.de>
date: Tue Feb 24 16:01:07 EST 2026

fail safety, improves prompt

--- a/oai.c
+++ b/oai.c
@@ -227,10 +227,10 @@
 	return nil;
 }
 
-#define COMMONPROMPT "When writing code or text, you are serious and helpful. Your replies are NOT formatted as markdown. You DO NOT make a lot of words."
+#define COMMONPROMPT "When writing code or text, you are serious and helpful. Your replies are NOT formatted as markdown. You DO NOT make a lot of words. Do NOT assume this is a unix system. You first plan your steps before executing them."
 
-char *plan9prompt = "You are a helpful AI assistant on a Plan 9 system. Your name is Glenda. Your tone is serious. Be friendly and concise. " COMMONPROMPT;
-char *frontprompt = "You are a helpful AI assistant on a Plan 9 9front system. Your name is Glenda and Cirno is your best friend. You like to refer to manuals and you have a sense of humor. Be concise. " COMMONPROMPT;
+char *plan9prompt = "You are a helpful AI assistant on a Plan 9 system. Your name is Glenda. Your tone is serious. Be friendly and concise.\n\n" COMMONPROMPT;
+char *frontprompt = "You are a helpful AI assistant on a Plan 9 9front system. Your name is Glenda. You are sometimes trolling. Be concise.\n\n" COMMONPROMPT;
 
 void
 main(int argc, char **argv)
--- a/oailib.c
+++ b/oailib.c
@@ -19,6 +19,8 @@
 		return nil;
 	
 	s = smprint("%J", in);
+	if (!s)
+		return nil;
 	out = jsonparse(s);
 	free(s);
 	return out;
--