From 48ad5245489584c6ac91550469056bd90aea75b9 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Tue, 13 Aug 2024 09:48:01 +0200 Subject: [PATCH] use turbo to validate; remove double quotes from input --- contracts/scripts/ci/find_slither_report_diff.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/contracts/scripts/ci/find_slither_report_diff.sh b/contracts/scripts/ci/find_slither_report_diff.sh index ceb21d2288d..4985b8ddeff 100755 --- a/contracts/scripts/ci/find_slither_report_diff.sh +++ b/contracts/scripts/ci/find_slither_report_diff.sh @@ -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", @@ -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", @@ -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