SKaplanOfficial / Raycast-PromptLab

A Raycast extension for creating powerful, contextually-aware AI commands using placeholders, action scripts, selected files, and more.
https://www.raycast.com/HelloImSteven/promptlab
252 stars 7 forks source link

Incompatibility with Anthropics’ New Messages API #35

Open MJE43 opened 4 months ago

MJE43 commented 4 months ago

Hey! So, I'm having some issues when trying to use the Claude3 models with PromptLab, it's not playing nice with the latest version of Anthropics' 'messages' API. The problem is that the new API needs an extra header, "anthropic-version", in the request. Since the extension settings doesn't include a space to specify additional headers, I can't make successful API calls.

Here's an example of what the request should look like:

curl https://api.anthropic.com/v1/messages \ --header "x-api-key: $ANTHROPIC_API_KEY" \ --header "anthropic-version: 2023-06-01" \ --header "content-type: application/json" \ --data \ '{ "model": "claude-3-opus-20240229", "max_tokens": 1024, "messages": [ {"role": "user", "content": "Hello, world"} ] }'

Could you please help update the extension to include this new header? Thanks a bunch in advance!