diff options
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | .teagent.sample | 1 | ||||
| -rwxr-xr-x | access.sh | 24 | ||||
| -rw-r--r-- | tea_issue.sh | 3 |
4 files changed, 30 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fe1e140 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env +.teagent diff --git a/.teagent.sample b/.teagent.sample new file mode 100644 index 0000000..c0c72f9 --- /dev/null +++ b/.teagent.sample @@ -0,0 +1 @@ +REPO=cc/TeAgent diff --git a/access.sh b/access.sh new file mode 100755 index 0000000..adf51fc --- /dev/null +++ b/access.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +[ ! -f .env ] || export $(grep -v '^#' .env | xargs) +SERVER="${OLLAMA_HOST:-http://localhost:11434}" +MODEL="${OLLAMA_MODEL:-llama3.2}" +PROMPT=$(cat << EOF +Please clean up the following code, leaving ample documentation: +def test(a: int, b: float) -> int: + return a + b ** 0.5 +EOF +) +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') +echo "${RESPONSE}" +#curl -s "$SERVER/api/generate" \ +# -H "Content-Type: application/json" \ +# -d "{ +# \"model\": \"$MODEL\", +# \"prompt\": \"$PROMPT\", +# \"stream\": false +# }" | jq -r '.response' diff --git a/tea_issue.sh b/tea_issue.sh new file mode 100644 index 0000000..bbcb5dc --- /dev/null +++ b/tea_issue.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[ ! -f .env ] || export $(grep -v '^#' .env | xargs) +echo tea issues --login teagent --repo "${REPO_NAME}" |
