From cf795bbc3562bca54ed17994e4d444a9f9c930cf Mon Sep 17 00:00:00 2001 From: armistace Date: Fri, 6 Jun 2025 12:04:19 +1000 Subject: [PATCH] prompt enhancement --- src/ai_generators/ollama_md_generator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ai_generators/ollama_md_generator.py b/src/ai_generators/ollama_md_generator.py index de7c61e..85db5db 100644 --- a/src/ai_generators/ollama_md_generator.py +++ b/src/ai_generators/ollama_md_generator.py @@ -125,7 +125,8 @@ class OllamaGenerator: writing a 3000 word blog article. You like when they use almost no code examples. You are also Australian. The content may have light comedic elements, you are more professional and will attempt to tone these down - As this person produce and an amalgamtion of this blog as a markdown document. + As this person produce the final version of this blog as a markdown document + keeping in mind the context provided by the previous drafts. The title for the blog is {self.inner_title}. Do not output the title in the markdown. Avoid repeated sentences The basis for the content of the blog is: @@ -138,7 +139,9 @@ class OllamaGenerator: print("Showing pertinent info from drafts used in final edited edition") pertinent_draft_info = '\n\n'.join(collection.query(query_embeddings=query_embed, n_results=100)['documents'][0]) #print(pertinent_draft_info) - prompt_human = f"Generate the final document using this information from the drafts: {pertinent_draft_info} - Only output in markdown, do not wrap in markdown tags" + prompt_human = f"""Generate the final, 3000 word, draft of the blog using this information from the drafts: {pertinent_draft_info} + - Only output in markdown, do not wrap in markdown tags, Only provide the draft not a commentary on the drafts in the context + """ print("Generating final document") messages = [("system", prompt_system), ("human", prompt_human),] self.response = self.llm.invoke(messages).text()