Closed ryicoh closed 4 months ago
Hi @ryicoh, thank you for your report. Which version are you currently using? Please let me know the commit or tag. With the latest version v0.2.3, I was not able to reproduce this error message. However, I did encounter a similar error when I realized I was using my wrong account with no remaining credit.
This is my version of parrot.nvim
.
parrot.nvim % git log
commit c9db07995107fa7d4f8196126451e1760a39ab25 (grafted, HEAD -> main, origin/main, origin/HEAD)
Author: Frank Röder <fr.coding@proton.me>
Date: Fri May 3 13:56:43 2024 +0200
I've tried to make minimal vimrc for reproducing the issue, but I couldn't do it. I'll reopen the issue if I encounter it again.
" This file is for reproducing the bug in the issue #8
" see: https://github.com/frankroeder/parrot.nvim/issues/8
" 1. Clone the repository
"
" $ git clone https://github.com/frankroeder/parrot.nvim/ ~/.local/share/nvim/site/pack/debug/opt/parrot.nvim
" $ git clone https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/debug/opt/plenary.nvim
" 2. Open nvim
"
" $ nvim -u ./minimal.vimrc
packadd plenary.nvim
packadd parrot.nvim
" Set ANTHROPIC_API_KEY environment variable
const anth_key_path = expand('~/.config/anthropic.token')
if filereadable(anth_key_path)
let $ANTHROPIC_API_KEY = readfile(anth_key_path)[0]
else
echomsg "ANTHROPIC_API_KEY not found"
endif
lua << EOF
require("parrot").setup {
providers = {
anthropic = {
api_key = os.getenv "ANTHROPIC_API_KEY",
}
}
}
EOF
call execute('PrtProvider anthropic')
call execute('PrtChatNew')
call execute('PrtAgent Claude-3-Haiku-Chat')
Today, Anthropic API has changed to return the following error.
The log of the payload is here.
I make it work with the following changes.