Skip to content

Commit

Permalink
Add missing 'anthropic-version' header for non-streaming requests. (#539
Browse files Browse the repository at this point in the history
)
  • Loading branch information
swuecho authored Sep 14, 2024
1 parent 9cbf799 commit 9753283
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions api/chat_main_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ func (h *ChatHandler) chatStreamClaude3(w http.ResponseWriter, chatSession sqlc_
}

req.Header.Set("Content-Type", "application/json")
req.Header.Set("anthropic-version", "2023-06-01")

if !stream {
req.Header.Set("Accept", "application/json")
Expand All @@ -934,8 +935,6 @@ func (h *ChatHandler) chatStreamClaude3(w http.ResponseWriter, chatSession sqlc_
req.Header.Set("Accept", "text/event-stream")
req.Header.Set("Cache-Control", "no-cache")
req.Header.Set("Connection", "keep-alive")
// TODO: remove this?
req.Header.Set("anthropic-version", "2023-06-01")
}

// create the http client and send the request
Expand Down

0 comments on commit 9753283

Please sign in to comment.