latest commits
This commit is contained in:
@@ -5,11 +5,7 @@ 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
|
||||
@@ -17,25 +13,12 @@ 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
|
||||
@@ -129,21 +112,9 @@ 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
|
||||
|
||||
@@ -29,6 +29,7 @@ def try_something(test):
|
||||
blog_repo = "/path/to/your/blog/repo"
|
||||
>>>>>>> d35a456 (set up chroma)
|
||||
|
||||
<<<<<<< HEAD
|
||||
if os.path.exists(repo_path):
|
||||
shutil.rmtree(repo_path)
|
||||
self.repo_path = repo_path
|
||||
@@ -36,6 +37,19 @@ blog_repo = "/path/to/your/blog/repo"
|
||||
self.repo = Repo(repo_path)
|
||||
self.username = username
|
||||
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):
|
||||
"""Clone a Git repository with authentication"""
|
||||
|
||||
Reference in New Issue
Block a user