Skip to content

Commit

Permalink
use turbo to validate; remove double quotes from input
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Aug 13, 2024
1 parent 712a9a5 commit 48ad524
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions contracts/scripts/ci/find_slither_report_diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ else
validation_prompt_path=""
fi

first_report_content=$(cat "$first_report_path" | sed 's/"/\\"/g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
second_report_content=$(cat "$second_report_path" | sed 's/"/\\"/g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
first_report_content=$(cat "$first_report_path" | sed 's/"//g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
second_report_content=$(cat "$second_report_path" | sed 's/"//g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
openai_prompt=$(cat "$report_prompt_path" | sed 's/"/\\"/g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
openai_model="gpt-4o"
openai_result=$(echo '{
"model": "'$openai_model'",
"temperature": 0.1,
"temperature": 0.01,
"messages": [
{
"role": "system",
Expand Down Expand Up @@ -57,11 +57,12 @@ echo "$new_issues_report_content" > "$new_issues_report_path"

if [[ -n "$validation_prompt_path" ]]; then
echo "::debug::Validating the diff report using the validation prompt"
report_input=$(echo "$new_issues_report_content" | sed 's/"/\\"/g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
openai_model="gpt-4-turbo"
report_input=$(echo "$new_issues_report_content" | sed 's/"//g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
validation_prompt_content=$(cat "$validation_prompt_path" | sed 's/"/\\"/g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
validation_result=$(echo '{
"model": "'$openai_model'",
"temperature": 0.1,
"temperature": 0.01,
"messages": [
{
"role": "system",
Expand All @@ -87,5 +88,7 @@ if [[ -n "$validation_prompt_path" ]]; then

echo "$response_content" | sed -e 's/^ -/ -/g' >> "$new_issues_report_path"
echo "" >> "$new_issues_report_path"
echo "*Confidence rating presented above is an automatic validation (self-check) of the differences between two reports generated by ChatGPT ${openai_model} model*." >> "$new_issues_report_path"
echo "*Confidence rating presented above is an automatic validation (self-check) of the differences between two reports generated by ChatGPT ${openai_model} model. It has a scale of 1 to 5, where 1 means that all new issues are missing and 5 that all new issues are present*." >> "$new_issues_report_path"
echo "" >> "$new_issues_report_path"
echo "*If confidence rating is low it's advised to look for differences manually by downloading Slither reports for base reference and current commit from job's artifacts*." >> "$new_issues_report_path"
fi

0 comments on commit 48ad524

Please sign in to comment.