Skip to content

Commit

Permalink
TEST-1234 Fix: Escape double quotes in Gemini API request Escape doub…
Browse files Browse the repository at this point in the history
…le quotes in the Gemini API request to prevent errors.
  • Loading branch information
wesleyscholl committed Sep 23, 2024
1 parent 6c22010 commit c1ca246
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-commit-push-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ diff=$(git diff --cached)
diff=$(echo $diff | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | sed 's/\n/\\n/g')

# Prepare the Gemini API request
gemini_request='{"contents":[{"parts":[{"text": "Write a git commit message (commit message title 72 character maximum and commit message summary 50 character maxiumum) for the following git diff: '"$diff"' The format should be as follows (without titles, back ticks, markdown fomatting, or template strings): <commit message title> (2 new lines) <commit message summary> "}]}]}'
gemini_request='{"contents":[{"parts":[{"text": "Write a git commit message (commit message title 72 character maximum and commit message summary 50 character maxiumum) for the following git diff: '"$diff"' The format should be as follows (without titles, back ticks, markdown fomatting): <commit message title> (2 new lines) <commit message summary> "}]}]}'

# Get commit message from Gemini API
commit_message=$(curl -s \
Expand Down

0 comments on commit c1ca246

Please sign in to comment.