Compare commits

...

14 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
cf795bbc35 prompt enhancement 2025-06-06 12:04:19 +10:00
a6ed20451a Merge pull request 'pipeline_creation' (#15) from pipeline_creation into master
All checks were successful
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Successful in 25m13s
Reviewed-on: #15
2025-06-05 09:22:50 +10:00
2abc39e3ac Merge pull request 'pipeline_creation' (#14) from pipeline_creation into master
All checks were successful
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Successful in 30m33s
Reviewed-on: #14
2025-06-05 08:43:23 +10:00
0594ea54aa remove repo reference
Some checks failed
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Failing after 27m5s
2025-06-05 01:02:42 +10:00
60f7473297 remove trailing slash
Some checks failed
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Has been cancelled
2025-06-05 01:00:58 +10:00
ec69e8e4f7 Merge pull request 'do it right' (#13) from pipeline_creation into master
Some checks failed
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Failing after 8m58s
Reviewed-on: #13
2025-06-05 00:47:05 +10:00
41f804a1eb Merge pull request 'pipeline_creation' (#12) from pipeline_creation into master
Some checks failed
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Has been cancelled
Reviewed-on: #12
2025-06-05 00:45:53 +10:00
e3262cd366 Merge pull request 'weird trailing newline"' (#11) from pipeline_creation into master
Some checks failed
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Failing after 10m26s
Reviewed-on: #11
2025-06-05 00:12:04 +10:00
e2c29204fa Merge pull request 'pipeline_creation' (#10) from pipeline_creation into master
Some checks failed
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Has been cancelled
Reviewed-on: #10
2025-06-04 23:48:10 +10:00
44b5ea6a68 Merge pull request 'load_dotenv work different?' (#9) from pipeline_creation into master
Some checks failed
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Failing after 9m17s
Reviewed-on: #9
2025-06-04 22:55:26 +10:00
9296fda390 Merge pull request 'tail the .env so we can see it in pipelin' (#8) from pipeline_creation into master
Some checks failed
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Failing after 9m5s
Reviewed-on: #8
2025-06-04 22:44:14 +10:00
703a2384e7 Merge pull request 'sigh stray U' (#7) from pipeline_creation into master
Some checks failed
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Failing after 9m2s
Reviewed-on: #7
2025-06-04 22:30:36 +10:00

View File

@ -33,7 +33,7 @@ class OllamaGenerator:
The title for the blog is {self.inner_title}.
Do not output the title in the markdown.
The basis for the content of the blog is:
{self.content}
<blog>{self.content}</blog>
"""
def split_into_chunks(self, text, chunk_size=100):
@ -125,11 +125,12 @@ 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:
{self.content}
<blog>{self.content}</blog>
"""
try:
query_embed = self.ollama_client.embed(model=self.embed_model, input=prompt_system)['embeddings']
@ -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: <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
"""
print("Generating final document")
messages = [("system", prompt_system), ("human", prompt_human),]
self.response = self.llm.invoke(messages).text()