diff --git a/.gitignore b/.gitignore index 24458be..9ede049 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ __pycache__ .venv .aider* .vscode +.zed +pyproject.toml +.ropeproject +generated_files/* diff --git a/Dockerfile b/Dockerfile index a220107..0416791 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,12 @@ ENV PYTHONUNBUFFERED 1 ADD src/ /blog_creator -RUN apt-get update && apt-get install -y rustc cargo python-is-python3 pip python3.12-venv libmagic-dev - +RUN apt-get update && apt-get install -y rustc cargo python-is-python3 pip python3-venv libmagic-dev git +# Need to set up git here or we get funky errors +RUN git config --global user.name "Blog Creator" +RUN git config --global user.email "ridgway.infrastructure@gmail.com" +RUN git config --global push.autoSetupRemote true +#Get a python venv going as well cause safety RUN python -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" diff --git a/README.md b/README.md index 833f393..4f284bb 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,19 @@ This creator requires you to use a working Trilium Instance and create a .env file with the following ``` -TRILIUM_HOST -TRILIUM_PORT -TRILIUM_PROTOCOL -TRILIUM_PASS +TRILIUM_HOST= +TRILIUM_PORT= +TRILIUM_PROTOCOL= +TRILIUM_PASS= +TRILIUM_TOKEN= +OLLAMA_PROTOCOL= +OLLAMA_HOST= +OLLAMA_PORT=11434 +EMBEDDING_MODEL= +EDITOR_MODEL= +# This is expected in python list format example `[phi4-mini:latest, qwen3:1.7b, gemma3:latest]` +CONTENT_CREATOR_MODELS= +CHROMA_SERVER= ``` This container is going to be what I use to trigger a blog creation event @@ -29,7 +38,7 @@ To do this we will 4. cd /src/content -5. take the information from the trillium note and prepare a 500 word blog post, insert the following at the top +5. take the information from the trillium note and prepare a 500 word blog post, insert the following at the top ``` Title: @@ -42,7 +51,7 @@ Authors: <model name>.ai Summary: <have ai write a 10 word summary of the post ``` -6. write it to `<title>.md` +6. write it to `<title>.md` 7. `git checkout -b <title>` diff --git a/docker-compose.yml b/docker-compose.yml index 0e61a87..2642fe8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,44 @@ -services: - blog_creator: - build: - context: . - dockerfile: Dockerfile - container_name: blog_creator - env_file: - - .env - volumes: - - ./generated_files/:/blog_creator/generated_files +networks: + net: + driver: bridge +services: + blog_creator: + build: + context: . + dockerfile: Dockerfile + container_name: blog_creator + env_file: + - .env + volumes: + - ./generated_files/:/blog_creator/generated_files + networks: + - net + + chroma: + image: chromadb/chroma + container_name: chroma + volumes: + # Be aware that indexed data are located in "/chroma/chroma/" + # Default configuration for persist_directory in chromadb/config.py + # Read more about deployments: https://docs.trychroma.com/deployment + - chroma-data:/chroma/chroma + #command: "--host 0.0.0.0 --port 8000 --proxy-headers --log-config chromadb/log_config.yml --timeout-keep-alive 30" + environment: + - IS_PERSISTENT=TRUE + restart: unless-stopped # possible values are: "no", always", "on-failure", "unless-stopped" + ports: + - "8000:8000" + healthcheck: + # Adjust below to match your container port + test: + ["CMD", "curl", "-f", "http://localhost:8000/api/v2/heartbeat"] + interval: 30s + timeout: 10s + retries: 3 + networks: + - net + +volumes: + chroma-data: + driver: local diff --git a/requirements.txt b/requirements.txt index 7ae22b7..116f45e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,5 @@ ollama trilium-py gitpython PyGithub +chromadb +langchain-ollama