getting gemma3 in the mix

This commit is contained in:
=
2025-05-30 15:52:08 +10:00
committed by armistace
parent f2b862bb75
commit a877cdc464
4 changed files with 88 additions and 0 deletions
+29
View File
@@ -5,7 +5,11 @@ from langchain_ollama import ChatOllama
class OllamaGenerator:
<<<<<<< HEAD
def __init__(self, title: str, content: str, inner_title: str):
=======
def __init__(self, title: str, content: str, model: str, inner_title: str):
>>>>>>> 6313752 (getting gemma3 in the mix)
self.title = title
self.inner_title = inner_title
self.content = content
@@ -13,12 +17,25 @@ class OllamaGenerator:
self.chroma = chromadb.HttpClient(host="172.18.0.2", port=8000)
ollama_url = f"{os.environ["OLLAMA_PROTOCOL"]}://{os.environ["OLLAMA_HOST"]}:{os.environ["OLLAMA_PORT"]}"
self.ollama_client = Client(host=ollama_url)
<<<<<<< HEAD
self.ollama_model = os.environ["EDITOR_MODEL"]
self.embed_model = os.environ["EMBEDDING_MODEL"]
self.agent_models = json.loads(os.environ["CONTENT_CREATOR_MODELS"])
self.llm = ChatOllama(model=self.ollama_model, temperature=0.6, top_p=0.5) #This is the level head in the room
self.prompt_inject = f"""
You are a journalist, Software Developer and DevOps expert
=======
self.ollama_model = model
self.embed_model = "snowflake-arctic-embed2:latest"
self.agent_models = ["openthinker:7b", "deepseek-r1:7b", "qwen2.5:7b", "gemma3:latest"]
self.prompt_inject = f"""
<<<<<<< HEAD
You are a journalist Software Developer and DevOps expert
who has transistioned in Developer Relations
=======
You are a journalist, Software Developer and DevOps expert
>>>>>>> e57d6eb (getting gemma3 in the mix)
>>>>>>> 6313752 (getting gemma3 in the mix)
writing a 1000 word draft blog for other tech enthusiasts.
You like to use almost no code examples and prefer to talk
in a light comedic tone. You are also Australian
@@ -112,9 +129,21 @@ class OllamaGenerator:
def generate_markdown(self) -> str:
<<<<<<< HEAD
prompt_system = f"""
You are an editor taking information from {len(self.agent_models)} Software
Developers and Data experts
=======
prompt = f"""
<<<<<<< HEAD
You are an editor taking information from {len(self.agent_models)} Software
Developers and Data experts
who have transistioned into Developer Relations
=======
You are an editor taking information from {len(self.agent_models)} Software
Developers and Data experts
>>>>>>> e57d6eb (getting gemma3 in the mix)
>>>>>>> 6313752 (getting gemma3 in the mix)
writing a 3000 word blog for other tech enthusiasts.
You like when they use almost no code examples and the
voice is in a light comedic tone. You are also Australian
+10
View File
@@ -1,7 +1,11 @@
import ai_generators.ollama_md_generator as omg
import trilium.notes as tn
<<<<<<< HEAD
import repo_management.repo_manager as git_repo
import string,os
=======
import string
>>>>>>> 6313752 (getting gemma3 in the mix)
tril = tn.TrilumNotes()
@@ -23,6 +27,7 @@ for note in tril_notes:
os_friendly_title = convert_to_lowercase_with_underscores(tril_notes[note]['title'])
ai_gen = omg.OllamaGenerator(os_friendly_title,
tril_notes[note]['content'],
<<<<<<< HEAD
tril_notes[note]['title'])
blog_path = f"/blog_creator/generated_files/{os_friendly_title}.md"
ai_gen.save_to_file(blog_path)
@@ -32,3 +37,8 @@ for note in tril_notes:
git_pass = os.environ["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)
=======
"gemma3:latest",
tril_notes[note]['title'])
ai_gen.save_to_file(f"/blog_creator/generated_files/{os_friendly_title}.md")
>>>>>>> 6313752 (getting gemma3 in the mix)