Compare commits

..

2 Commits

Author SHA1 Message Date
bce439921f Generate tags around context
All checks were successful
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Successful in 27m22s
2025-06-16 10:35:21 +10:00
2de2d0fe3a Merge pull request 'prompt enhancement' (#16) from prompt_fix into master
All checks were successful
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Successful in 11m44s
Reviewed-on: #16
2025-06-06 12:04:44 +10:00

View File

@ -33,7 +33,7 @@ class OllamaGenerator:
The title for the blog is {self.inner_title}. The title for the blog is {self.inner_title}.
Do not output the title in the markdown. Do not output the title in the markdown.
The basis for the content of the blog is: The basis for the content of the blog is:
{self.content} <blog>{self.content}</blog>
""" """
def split_into_chunks(self, text, chunk_size=100): def split_into_chunks(self, text, chunk_size=100):
@ -130,7 +130,7 @@ class OllamaGenerator:
The title for the blog is {self.inner_title}. The title for the blog is {self.inner_title}.
Do not output the title in the markdown. Avoid repeated sentences Do not output the title in the markdown. Avoid repeated sentences
The basis for the content of the blog is: The basis for the content of the blog is:
{self.content} <blog>{self.content}</blog>
""" """
try: try:
query_embed = self.ollama_client.embed(model=self.embed_model, input=prompt_system)['embeddings'] query_embed = self.ollama_client.embed(model=self.embed_model, input=prompt_system)['embeddings']
@ -139,7 +139,7 @@ class OllamaGenerator:
print("Showing pertinent info from drafts used in final edited edition") 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]) pertinent_draft_info = '\n\n'.join(collection.query(query_embeddings=query_embed, n_results=100)['documents'][0])
#print(pertinent_draft_info) #print(pertinent_draft_info)
prompt_human = f"""Generate the final, 3000 word, draft of the blog using this information from the drafts: {pertinent_draft_info} prompt_human = f"""Generate the final, 3000 word, draft of the blog using this information from the drafts: <context>{pertinent_draft_info}</context>
- Only output in markdown, do not wrap in markdown tags, Only provide the draft not a commentary on the drafts in the context - 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") print("Generating final document")