summaryrefslogtreecommitdiff
path: root/cleanup_repo.sh
diff options
context:
space:
mode:
Diffstat (limited to 'cleanup_repo.sh')
-rwxr-xr-xcleanup_repo.sh36
1 files changed, 0 insertions, 36 deletions
diff --git a/cleanup_repo.sh b/cleanup_repo.sh
deleted file mode 100755
index 4352f1a..0000000
--- a/cleanup_repo.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-
-[ ! -f .env ] || export $(grep -v '^#' .env | xargs)
-[ ! -f .teagent ] || export $(grep -v '^#' .teagent | xargs)
-if [ -z "$REPO" ]; then
- exit 1
-fi
-
-SERVER="${OLLAMA_HOST:-http://localhost:11434}"
-MODEL="${OLLAMA_MODEL:-llama3.2}"
-
-SOURCE_FILES=`find . -type f -iname \*.py`
-
-for source_file in $SOURCE_FILES; do
- if [ ! -s "${source_file}" ]; then
- continue
- fi
- SOURCE=$(<"${source_file}")
- PROMPT=$(cat << EOF
-Please clean up the following code, leaving ample documentation.
-If the code seems clean already, simply write: DONE
-EOF
-)
- PROMPT="${PROMPT}
-${SOURCE}"
- RESPONSE=$(curl -s "$SERVER/api/generate" \
- -H "Content-Type: application/json" \
- -d "$(jq -n --arg model "$MODEL" --arg prompt "$PROMPT" \
- '{model:$model, prompt:$prompt, stream:false}')" \
- | jq -r '.response')
- if [[ "$RESPONSE" = 'DONE'* ]]; then
- echo > /dev/null
- else
- tea issues create --title "Cleanup ${source_file} (TeAgent)" --body "${RESPONSE}" --login teagent --repo "${REPO}"
- fi
-done