Skip to content

Commit

Permalink
add clients list to gpt query & show errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Jan 12, 2025
1 parent 35d1e90 commit 30baa96
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/_shared-run-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ jobs:
echo "Your summary should not exceed 500 characters. Use easy language with technical details like client names. Avoid listing block numbers or timestamps." >> ./temp/chatgpt_query.txt
echo "" >> ./temp/chatgpt_query.txt
echo "Client Pairs:" >> ./temp/chatgpt_query.txt
cat ./temp/clients_summary.txt >> ./temp/chatgpt_query.txt
echo "" >> ./temp/chatgpt_query.txt
echo "$test_status" >> ./temp/chatgpt_query.txt
echo "" >> ./temp/chatgpt_query.txt
echo "Failed Test Task Status:" >> ./temp/chatgpt_query.txt
Expand Down Expand Up @@ -348,8 +352,6 @@ jobs:
)
query_json=$(echo "$query_json" | jq -c ".+=${chatgpt_extra_cfg}")
echo "Query JSON:"
echo $query_json | jq
result=$(curl $chatgpt_url \
-H "Content-Type: application/json" \
Expand All @@ -358,8 +360,13 @@ jobs:
)
echo "ChatGPT Summary:"
echo $result | jq -r ".choices[0].message.content"
echo $result | jq -r ".choices[0].message.content" > ./temp/chatgpt_summary.txt
summary="$(echo $result | jq -r ".choices[0].message.content")"
if [ "$summary" == "null" ]; then
echo "ChatGPT failed to generate a summary"
echo $result | jq
else
echo "$summary" > ./temp/chatgpt_summary.txt
fi
echo "summary<<EOF" >> $GITHUB_OUTPUT
echo $result | jq -r ".choices[0].message.content" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 30baa96

Please sign in to comment.