Author SHA1 Message Date
armistace 7fd32b3024 improve notification prompt 2025-06-05 09:22:28 +10:00
armistace a88d233c6b remove tail and improve notification prompt 2025-06-05 09:22:19 +10:00
armistace f430998137 typo 2025-06-05 08:42:45 +10:00
armistace 8dceb79d91 remove repo reference 2025-06-05 08:41:32 +10:00
armistace 6c5b0f778d remove trailing slash 2025-06-05 08:41:32 +10:00
armistace 37ed8fd0f9 fix git for pipeline" 2025-06-05 08:40:59 +10:00
armistace 62b1175aeb do it right 2025-06-05 00:46:45 +10:00
armistace f50d076164 cleanup 2025-06-05 00:45:39 +10:00
armistace fc4f9c5053 dealing with pipeline weirdness 2025-06-05 00:44:57 +10:00
armistace 341f3d8623 weird trailing newline"
"
2025-06-05 00:11:44 +10:00
armistace f0e6a0cb52 load_dotenv work different? 2025-06-04 23:47:53 +10:00
armistace 7f0b0376d1 load_dotenv work different? 2025-06-04 23:47:05 +10:00
armistace a49457094d load_dotenv work different? 2025-06-04 22:54:09 +10:00
armistace bb0d9090f3 tail the .env so we can see it in pipelin 2025-06-04 22:43:53 +10:00
armistace 4b3f00c325 Merge branch 'master' into pipeline_creation 2025-06-04 22:29:42 +10:00
armistace 347ac63f86 Merge pull request 'helps to install virtualenv' (#6) from pipeline_creation into master
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Failing after 8m59s
Reviewed-on: #6
2025-06-04 22:17:46 +10:00
armistace f0572ba9fb Merge pull request 'pipeline_creation' (#5) from pipeline_creation into master
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Failing after 7m5s
Reviewed-on: #5
2025-06-04 22:08:28 +10:00
armistace 9ca7578d28 Merge pull request 'pipeline_creation' (#4) from pipeline_creation into master
Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Failing after 4m28s
Reviewed-on: #4
2025-06-04 22:02:00 +10:00
3 changed files with 26 additions and 18 deletions
+19 -15
View File
@@ -21,29 +21,33 @@ jobs:
source .venv/bin/activate source .venv/bin/activate
pip install --upgrade pip pip install --upgrade pip
pip install -r requirements.txt pip install -r requirements.txt
git config --global user.name "Blog Creator"
git config --global user.email "ridgway.infrastructure@gmail.com"
git config --global push.autoSetupRemote true
- name: Create .env - name: Create .env
shell: bash shell: bash
run: | run: |
echo "TRILIUM_HOST=${{ vars.TRILIUM_HOST }}" > .env echo "TRILIUM_HOST=${{ vars.TRILIUM_HOST }}" > .env
echo "TRILIUM_PORT=${{ vars.TRILIUM_PORT }}" >> .env echo "TRILIUM_PORT='${{ vars.TRILIUM_PORT }}'" >> .env
echo "TRILIUM_PROTOCOL=${{ vars.TRILIUM_PROTOCOL }}" >> .env echo "TRILIUM_PROTOCOL='${{ vars.TRILIUM_PROTOCOL }}'" >> .env
echo "TRILIUM_PASS=${{ secrets.TRILIUM_PASS }}" >> .env echo "TRILIUM_PASS='${{ secrets.TRILIUM_PASS }}'" >> .env
echo "TRILIUM_TOKEN=${{ secrets.TRILIUM_TOKEN }}" >> .env echo "TRILIUM_TOKEN='${{ secrets.TRILIUM_TOKEN }}'" >> .env
echo "OLLAMA_PROTOCOL=${{ vars.OLLAMA_PROTOCOL }}" >> .env echo "OLLAMA_PROTOCOL='${{ vars.OLLAMA_PROTOCOL }}'" >> .env
echo "OLLAMA_HOST=${{ vars.OLLAMA_HOST }}" >> .env echo "OLLAMA_HOST='${{ vars.OLLAMA_HOST }}'" >> .env
echo "OLLAMA_PORT=${{ vars.OLLAMA_PORT }}" >> .env echo "OLLAMA_PORT='${{ vars.OLLAMA_PORT }}'" >> .env
echo "EMBEDDING_MODEL=${{ vars.EMBEDDING_MODEL }}" >> .env echo "EMBEDDING_MODEL='${{ vars.EMBEDDING_MODEL }}'" >> .env
echo "EDITOR_MODEL=${{ vars.EDITOR_MODEL }}" >> .env echo "EDITOR_MODEL='${{ vars.EDITOR_MODEL }}'" >> .env
echo "CONTENT_CREATOR_MODELS='${{ vars.CONTENT_CREATOR_MODELS }}'" >> .env export PURE='["${{ vars.CONTENT_CREATOR_MODELS_1 }}", "${{ vars.CONTENT_CREATOR_MODELS_2 }}", "${{ vars.CONTENT_CREATOR_MODELS_3 }}", "${{ vars.CONTENT_CREATOR_MODELS_4 }}"]'
echo "GIT_PROTOCOL=${{ vars.GIT_PROTOCOL }}" >> .env echo "CONTENT_CREATOR_MODELS='$PURE'" >> .env
echo "GIT_REMOTE=${{ vars.GIT_REMOTE }}" >> .env echo "GIT_PROTOCOL='${{ vars.GIT_PROTOCOL }}'" >> .env
echo "GIT_USER=${{ vars.GIT_USER }}" >> .env echo "GIT_REMOTE='${{ vars.GIT_REMOTE }}'" >> .env
echo "GIT_USER='${{ vars.GIT_USER }}'" >> .env
echo "GIT_PASS='${{ secrets.GIT_PASS }}'" >> .env echo "GIT_PASS='${{ secrets.GIT_PASS }}'" >> .env
echo "N8N_SECRET='${{ secrets.N8N_SECRET }}'" >> .env echo "N8N_SECRET='${{ secrets.N8N_SECRET }}'" >> .env
echo "N8N_WEBHOOK_URL='${{ vars.N8N_WEBHOOK_URL }}'" >> .env echo "N8N_WEBHOOK_URL='${{ vars.N8N_WEBHOOK_URL }}'" >> .env
echo "CHROMA_HOST=${{ vars.CHROMA_HOST }}" >> .env echo "CHROMA_HOST='${{ vars.CHROMA_HOST }}'" >> .env
echo "CHROMA_PORT=${{ vars.CHROMA_PORT }}" >> .env echo "CHROMA_PORT='${{ vars.CHROMA_PORT }}'" >> .env
- name: Create Blogs - name: Create Blogs
shell: bash shell: bash
+2
View File
@@ -11,6 +11,8 @@ class OllamaGenerator:
self.inner_title = inner_title self.inner_title = inner_title
self.content = content self.content = content
self.response = None self.response = None
print("In Class")
print(os.environ["CONTENT_CREATOR_MODELS"])
try: try:
chroma_port = int(os.environ['CHROMA_PORT']) chroma_port = int(os.environ['CHROMA_PORT'])
except ValueError as e: except ValueError as e:
+5 -3
View File
@@ -6,6 +6,7 @@ import string,os
from datetime import datetime from datetime import datetime
from dotenv import load_dotenv from dotenv import load_dotenv
load_dotenv() load_dotenv()
print(os.environ["CONTENT_CREATOR_MODELS"])
tril = tn.TrilumNotes() tril = tn.TrilumNotes()
@@ -29,7 +30,7 @@ for note in tril_notes:
ai_gen = omg.OllamaGenerator(os_friendly_title, ai_gen = omg.OllamaGenerator(os_friendly_title,
tril_notes[note]['content'], tril_notes[note]['content'],
tril_notes[note]['title']) tril_notes[note]['title'])
blog_path = f"/blog_creator/generated_files/{os_friendly_title}.md" blog_path = f"generated_files/{os_friendly_title}.md"
ai_gen.save_to_file(blog_path) ai_gen.save_to_file(blog_path)
@@ -49,9 +50,10 @@ for note in tril_notes:
git_branch_url = f'https://git.aridgwayweb.com/armistace/blog/src/branch/{os_friendly_title}/src/content/{os_friendly_title}.md' git_branch_url = f'https://git.aridgwayweb.com/armistace/blog/src/branch/{os_friendly_title}/src/content/{os_friendly_title}.md'
n8n_system_prompt = f"You are a blog creator notifiying the final editor of the final creation of blog available at {git_branch_url}" n8n_system_prompt = f"You are a blog creator notifiying the final editor of the final creation of blog available at {git_branch_url}"
n8n_prompt_human = f""" n8n_prompt_human = f"""
Generate an informal 150 word Generate an informal 100 word
summary describing {ai_gen.response}. summary describing {ai_gen.response}.
Don't address it or use names. ONLY OUTPUT THE RESPONSE Don't address it or use names. ONLY OUTPUT THE RESPONSE.
ONLY OUTPUT IN PLAINTEXT STRIP ALL MARKDOWN
""" """
notification_message = ai_gen.generate_system_message(n8n_system_prompt, n8n_prompt_human) notification_message = ai_gen.generate_system_message(n8n_system_prompt, n8n_prompt_human)
secret_key = os.environ['N8N_SECRET'] secret_key = os.environ['N8N_SECRET']