.
This commit is contained in:
parent
7e2570acbc
commit
92ce0c1d3b
1 changed files with 53 additions and 54 deletions
|
|
@ -27,63 +27,62 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Validate with Ollama
|
- name: Validate with Ollama
|
||||||
if: steps.extract.outputs.content_found == 'true'
|
if: steps.extract.outputs.content_found == 'true'
|
||||||
id: validate
|
id: validate
|
||||||
run: |
|
run: |
|
||||||
RESUME=$(cat /tmp/resume.txt)
|
RESUME=$(cat /tmp/resume.txt)
|
||||||
|
|
||||||
PROMPT="You are a recruiting manager evaluating candidates for a Technical Writing position.
|
PROMPT="You are a recruiting manager evaluating candidates for a Technical Writing position.
|
||||||
|
|
||||||
Assess this resume on:
|
Assess this resume on:
|
||||||
1. Tone: Is it professional, confident, and appropriate for technical communication roles?
|
1. Tone: Is it professional, confident, and appropriate for technical communication roles?
|
||||||
2. Understandability: Is the writing clear, well-organized, and easy to follow?
|
2. Understandability: Is the writing clear, well-organized, and easy to follow?
|
||||||
3. Technical Writing Skills: Does the candidate demonstrate ability to explain complex concepts clearly?
|
3. Technical Writing Skills: Does the candidate demonstrate ability to explain complex concepts clearly?
|
||||||
|
|
||||||
Resume:
|
Resume:
|
||||||
$RESUME
|
$RESUME
|
||||||
|
|
||||||
Respond with JSON:
|
Respond with JSON:
|
||||||
{
|
{
|
||||||
\"tone\": \"brief assessment\",
|
\"tone\": \"brief assessment\",
|
||||||
\"understandability\": \"brief assessment\",
|
\"understandability\": \"brief assessment\",
|
||||||
\"assessment\": \"PASS or FAIL\",
|
\"assessment\": \"PASS or FAIL\",
|
||||||
\"reason\": \"one sentence explaining your decision\"
|
\"reason\": \"one sentence explaining your decision\"
|
||||||
}"
|
}"
|
||||||
|
|
||||||
echo "Testing Ollama connectivity..."
|
echo "Testing Ollama connectivity..."
|
||||||
curl -v http://ollama:11434/api/tags || echo "Ollama unreachable"
|
curl -v http://ollama:11434/api/tags || echo "Ollama unreachable"
|
||||||
|
|
||||||
echo "Sending validation request to Ollama..."
|
echo "Sending validation request to Ollama..."
|
||||||
RESPONSE=$(curl -s -X POST http://ollama:11434/api/generate \
|
RESPONSE=$(curl -s -X POST http://ollama:11434/api/generate \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
--max-time 300 \
|
--max-time 300 \
|
||||||
-d "{
|
-d "{
|
||||||
\"model\": \"phi:2.7b\",
|
\"model\": \"phi:2.7b\",
|
||||||
\"prompt\": $(echo "$PROMPT" | jq -Rs .),
|
\"prompt\": $(echo "$PROMPT" | jq -Rs .),
|
||||||
\"stream\": false
|
\"stream\": false
|
||||||
}")
|
}")
|
||||||
|
|
||||||
echo "Raw response:"
|
echo "Raw response:"
|
||||||
echo "$RESPONSE"
|
echo "$RESPONSE"
|
||||||
echo "---"
|
echo "---"
|
||||||
|
|
||||||
if [ -z "$RESPONSE" ]; then
|
if [ -z "$RESPONSE" ]; then
|
||||||
echo "Error: No response from Ollama"
|
echo "Error: No response from Ollama"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RESULT=$(echo "$RESPONSE" | jq -r '.response' 2>/dev/null)
|
RESULT=$(echo "$RESPONSE" | jq -r '.response' 2>/dev/null)
|
||||||
|
|
||||||
if [ -z "$RESULT" ] || [ "$RESULT" = "null" ]; then
|
if [ -z "$RESULT" ] || [ "$RESULT" = "null" ]; then
|
||||||
echo "Error: Could not extract response from Ollama"
|
echo "Error: Could not extract response from Ollama"
|
||||||
echo "Response was: $RESPONSE"
|
echo "Response was: $RESPONSE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Ollama response:"
|
|
||||||
echo "$RESULT"
|
|
||||||
echo "validation_result=$RESULT" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
|
echo "Ollama response:"
|
||||||
|
echo "$RESULT"
|
||||||
|
echo "validation_result=$RESULT" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Block if assessment fails
|
- name: Block if assessment fails
|
||||||
if: steps.extract.outputs.content_found == 'true'
|
if: steps.extract.outputs.content_found == 'true'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue