matrix notifications and config driven chroma

This commit is contained in:
2025-06-04 21:32:51 +10:00
parent 431e5c63aa
commit c466b04a25
4 changed files with 26 additions and 42 deletions
+16 -4
View File
@@ -32,17 +32,28 @@ for note in tril_notes:
# Generate commit messages and push to repo
commit_message = ai_gen.generate_commit_message()
print("Generating Commit Message")
git_sytem_prompt = "You are a blog creator commiting a piece of content to a central git repo"
git_human_prompt = f"Generate a 5 word git commit message describing {ai_gen.response}. ONLY OUTPUT THE RESPONSE"
commit_message = ai_gen.generate_system_message(git_sytem_prompt, git_human_prompt)
git_user = os.environ["GIT_USER"]
git_pass = os.environ["GIT_PASS"]
repo_manager = git_repo.GitRepository("blog/", git_user, git_pass)
print("Pushing to Repo")
repo_manager.create_copy_commit_push(blog_path, os_friendly_title, commit_message)
# Generate notification for Matrix
notification_message = ai_gen.generate_notification_summary()
print("Generating Notification Message")
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_prompt_human = f"""
Generate an informal 150 word
summary describing {ai_gen.response}.
Don't address it or use names. ONLY OUTPUT THE RESPONSE
"""
notification_message = ai_gen.generate_system_message(n8n_system_prompt, n8n_prompt_human)
secret_key = os.environ['N8N_SECRET']
webhook_url = os.environ['N8N_WEBHOOK_URL']
git_branch_url = f'https://git.aridgwayweb.com/armistace/blog/src/branch/{os_friendly_tile}'
notification_string = f"""
<h2>{tril_notes[note]['title']}</h2>
<h3>Summary</h3>
@@ -59,6 +70,7 @@ for note in tril_notes:
webhook_client = N8NWebhookJwt(secret_key, webhook_url)
print("Notifying")
n8n_result = webhook_client.send_webhook(payload)
print(f"N8N response: {n8n_result}")
print(f"N8N response: {n8n_result['status']}")