env vars and starting work on repo_manager

This commit is contained in:
armistace 2025-05-23 15:47:25 +10:00
parent 67070df04b
commit a3db1ae993
4 changed files with 53 additions and 41 deletions

7
.gitignore vendored
View File

@ -3,13 +3,6 @@ __pycache__
.venv .venv
.aider* .aider*
.vscode .vscode
<<<<<<< HEAD
<<<<<<< HEAD
.zed .zed
pyproject.toml pyproject.toml
.ropeproject .ropeproject
=======
generated_files/*
>>>>>>> d45f0be (env set up for remote)
=======
>>>>>>> f24bd5b (cleanup directory)

View File

@ -0,0 +1,53 @@
# When Should You Use AI?
Right off the bat? Well, lets talk about when *not* using an LLM is actually pretty much like trying to build that perfect pavlova with a robot: Sure, they might have all these instructions and ingredients laid out for them (or so it seems), but can you really trust this machine to understand those subtle nuances of temperature or timing? No. And lets be real here if were talking about tasks requiring precise logic like financial calculations or scientific modeling - well, that sounds more suited to the human brain.
But where does AI actually shine bright and come in handy?
* **Pattern Recognition:** Spotting trends within data is one of those areas LLMs are pretty darn good at. Whether its identifying patterns across a dataset for insights (or even generating creative ideas based on existing information), they can do that with speed, efficiency - not to mention accuracy.
**And when shouldnt you use AI?**
* **Tasks Requiring Precise Logic:** If your job is something needing absolute precision like crunching numbers or modeling scientific data where a miscalculation could mean millions in losses for the company. Well… maybe hold off on letting an LLM take over.
* **Situations Demanding Critical Thinking**: Lets be honest, if you need to make judgment calls based upon complex factors that even humans can struggle with then it might not just do a good job; but rather fall short.
LMLs are great at mimicking intelligence. But they dont actually understand things the way we human beings (or I should say: non-humans) comprehend them.
* **Processes Where Errors Have Serious Consequences:** If your work involves tasks where errors can have serious consequences, then you probably want to keep it in human hands.
**The Bottom Line**
AI is a powerful tool. But like any good chef knows even the best kitchen appliances can't replace their own skills and experience when making that perfect pavlova (or for us humans: delivering results). Its about finding balance between leveraging AI capabilities, while also relying on our critical thinking - and human intuition.
Dont get me wrong here; Im not anti-AI. But lets be sensible use it where it's truly helpful but don't forget to keep those tasks in the hands of your fellow humans (or at least their non-humans).
---
**Note for Editors:** This draft is designed with ease-of-editing and clarity as a priority, so feel free to adjust any sections that might need further refinement or expansion. I aimed this piece towards an audience who appreciates both humor-infused insights into the world of AI while also acknowledging its limitations in certain scenarios.
```markdown
# When Should You Use AI?
Right off the bat? Well, lets talk about when *not* using LLM is actually pretty much like trying to build that perfect pavlova with a robot: Sure, they might have all these instructions and ingredients laid out for them (or so it seems), but can you really trust this machine to understand those subtle nuances of temperature or timing? No. And lets be real here if were talking about tasks requiring precise logic like financial calculations or scientific modeling - well, that sounds more suited to the human brain.
But where does AI actually shine bright and come in handy?
* **Pattern Recognition:** Spotting trends within data is one of those areas LLMs are pretty darn good at. Whether its identifying patterns across a dataset for insights (or even generating creative ideas based on existing information), they can do that with speed, efficiency - not to mention accuracy.
**And when shouldnt you use AI?**
* **Tasks Requiring Precise Logic:** If your job is something needing absolute precision like crunching numbers or modeling scientific data where a miscalculation could mean millions in losses for the company. Well… maybe hold off on letting an LLM take over.
* **Situations Demanding Critical Thinking**: Lets be honest, if you need to make judgment calls based upon complex factors that even humans can struggle with then it might not just do a good job; but rather fall short.
LMLs are great at mimicking intelligence. But they dont actually understand things the way we human beings (or I should say: non-humans) comprehend them.
* **Processes Where Errors Have Serious Consequences:** If your work involves tasks where errors can have serious consequences, then you probably want to keep it in human hands.
**The Bottom Line**
AI is a powerful tool. But like any good chef knows even the best kitchen appliances can't replace their own skills and experience when making that perfect pavlova (or for us humans: delivering results). Its about finding balance between leveraging AI capabilities, while also relying on our critical thinking - and human intuition.
Dont get me wrong here; Im not anti-AI. But lets be sensible use it where it's truly helpful but don't forget to keep those tasks in the hands of your fellow humans (or at least their non-humans).
---
**Note for Editors:** This draft is designed with ease-of-editing and clarity as a priority, so feel free to adjust any sections that might need further refinement or expansion. I aimed this piece towards an audience who appreciates both humor-infused insights into the world of AI while also acknowledging its limitations in certain scenarios.
```

View File

@ -1,11 +1,7 @@
import ai_generators.ollama_md_generator as omg import ai_generators.ollama_md_generator as omg
import trilium.notes as tn import trilium.notes as tn
<<<<<<< HEAD
import repo_management.repo_manager as git_repo import repo_management.repo_manager as git_repo
import string,os import string,os
=======
import string
>>>>>>> 6313752 (getting gemma3 in the mix)
tril = tn.TrilumNotes() tril = tn.TrilumNotes()
@ -27,7 +23,6 @@ for note in tril_notes:
os_friendly_title = convert_to_lowercase_with_underscores(tril_notes[note]['title']) os_friendly_title = convert_to_lowercase_with_underscores(tril_notes[note]['title'])
ai_gen = omg.OllamaGenerator(os_friendly_title, ai_gen = omg.OllamaGenerator(os_friendly_title,
tril_notes[note]['content'], tril_notes[note]['content'],
<<<<<<< HEAD
tril_notes[note]['title']) tril_notes[note]['title'])
blog_path = f"/blog_creator/generated_files/{os_friendly_title}.md" blog_path = f"/blog_creator/generated_files/{os_friendly_title}.md"
ai_gen.save_to_file(blog_path) ai_gen.save_to_file(blog_path)
@ -37,8 +32,4 @@ for note in tril_notes:
git_pass = os.environ["GIT_PASS"] git_pass = os.environ["GIT_PASS"]
repo_manager = git_repo.GitRepository("blog/", git_user, git_pass) repo_manager = git_repo.GitRepository("blog/", git_user, git_pass)
repo_manager.create_copy_commit_push(blog_path, os_friendly_title, commit_message) repo_manager.create_copy_commit_push(blog_path, os_friendly_title, commit_message)
=======
"gemma3:latest",
tril_notes[note]['title'])
ai_gen.save_to_file(f"/blog_creator/generated_files/{os_friendly_title}.md") ai_gen.save_to_file(f"/blog_creator/generated_files/{os_friendly_title}.md")
>>>>>>> 6313752 (getting gemma3 in the mix)

View File

@ -3,7 +3,6 @@ from urllib.parse import quote
from git import Repo from git import Repo
from git.exc import GitCommandError from git.exc import GitCommandError
<<<<<<< HEAD
class GitRepository: class GitRepository:
# This is designed to be transitory it will desctruvtively create the repo at repo_path # This is designed to be transitory it will desctruvtively create the repo at repo_path
# if you have uncommited changes you can kiss them goodbye! # if you have uncommited changes you can kiss them goodbye!
@ -21,15 +20,7 @@ class GitRepository:
git_user = quote(username) git_user = quote(username)
git_password = quote(password) git_password = quote(password)
remote = f"{git_protocol}://{git_user}:{git_password}@{git_remote}" remote = f"{git_protocol}://{git_user}:{git_password}@{git_remote}"
=======
def try_something(test):
# Set the path to your blog repo here
blog_repo = "/path/to/your/blog/repo"
>>>>>>> d35a456 (set up chroma)
<<<<<<< HEAD
if os.path.exists(repo_path): if os.path.exists(repo_path):
shutil.rmtree(repo_path) shutil.rmtree(repo_path)
self.repo_path = repo_path self.repo_path = repo_path
@ -37,19 +28,6 @@ blog_repo = "/path/to/your/blog/repo"
self.repo = Repo(repo_path) self.repo = Repo(repo_path)
self.username = username self.username = username
self.password = password self.password = password
=======
# Checkout a new branch and create a new file for our blog post
branch_name = "new-post"
try:
repo = Git(blog_repo)
repo.checkout("-b", branch_name, "origin/main")
with open("my-blog-post.md", "w") as f:
f.write(content)
except InvalidGitRepositoryError:
# Handle repository errors gracefully
pass
>>>>>>> 8575918 (latest commits)
def clone(self, remote_url, destination_path): def clone(self, remote_url, destination_path):
"""Clone a Git repository with authentication""" """Clone a Git repository with authentication"""
@ -118,6 +96,3 @@ except InvalidGitRepositoryError:
self.add_and_commit(f"'{commit_messge}'") self.add_and_commit(f"'{commit_messge}'")
self.repo.git.push() self.repo.git.push()
def remove_repo(self):
shutil.rmtree(self.repo_path)