最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

authorization - Langchain Unauthorized Legacy API Key - Stack Overflow

programmeradmin1浏览0评论

When executing invoke() the following error happens:

Errno 401 Client Error: Unauthorized for url: ] {"detail":"Using legacy API key. Please generate a new API key."}

I've created several API keys (yes, the new ones with the lsv2_pt bit), but am still getting an error. The weird thing is we have another API key that's being used regularly for other tasks, and it works fine on a different machine, but when testing it with invoke() and prompt.push(), it won't work as well.

These are the environment variables I have set:

os.environ["LANGCHAIN_API_KEY"] = 'lsv2_pt_000000000000'
os.environ["LANGCHAIN_HUB_API_KEY"] = 'lsv2_pt_000000000000'
os.environ["LANGCHAIN_TRACING_V2"] = "true"
os.environ["LANGCHAIN_ENDPOINT"] = ";

pip list | grep lang returns:

google-ai-generativelanguage  0.4.0
langchain                     0.3.7
langchain-benchmarks          0.0.14
langchain-community           0.0.38
langchain-core                0.3.19
langchain-google-genai        0.0.9
langchain-openai              0.2.9
langchain-text-splitters      0.3.2
langchainhub                  0.1.15
langsmith                     0.1.129

I'm at a loss here. Any help will be appreciated!

发布评论

评论列表(0)

  1. 暂无评论