Skip to content

Commit

Permalink
Fix release note generation
Browse files Browse the repository at this point in the history
  • Loading branch information
mhdzumair committed Nov 6, 2024
1 parent 68ba10c commit 271e2e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,13 @@ ifndef ANTHROPIC_API_KEY
@exit 1
endif
@PROMPT_CONTENT=`make prompt VERSION_OLD=$(VERSION_OLD) VERSION_NEW=$(VERSION_NEW) | tr '\n' ' ' | sed 's/"/\\\\"/g'`; \
temp_file=$$(mktemp); \
curl -s https://api.anthropic.com/v1/messages \
--header "x-api-key: $(ANTHROPIC_API_KEY)" \
--header "anthropic-version: $(ANTHROPIC_VERSION)" \
--header "content-type: application/json" \
--data "{\"model\":\"$(CLAUDE_MODEL)\",\"max_tokens\":$(MAX_TOKENS),\"messages\":[{\"role\":\"user\",\"content\":\"$$PROMPT_CONTENT\"}]}" \
| jq -r '.content[] | select(.type=="text") | .text';
--data "{\"model\":\"$(CLAUDE_MODEL)\",\"max_tokens\":$(MAX_TOKENS),\"messages\":[{\"role\":\"user\",\"content\":\"$$PROMPT_CONTENT\"}]}" > $$temp_file; \
jq -r '.content[] | select(.type=="text") | .text' $$temp_file || { echo "Failed to generate release notes using Claude AI, response: $$(cat $$temp_file)"; rm $$temp_file; exit 1; } ; \
rm $$temp_file

all: build-multi

0 comments on commit 271e2e0

Please sign in to comment.