mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-28 05:54:55 +00:00
For Context please check #29626 The Deepseek is using langchain_openai. The error happens that it show `json decode error`. I added a handler for this to give a more sensible error message which is DeepSeek API returned empty/invalid json. Reproducing the issue is a bit challenging as it is inconsistent, sometimes DeepSeek returns valid data and in other times it returns invalid data which triggers the JSON Decode Error. This PR is an exception handling, but not an ultimate fix for the issue. --------- Co-authored-by: Chester Curme <chester.curme@gmail.com> |
||
---|---|---|
.. | ||
langchain_deepseek | ||
scripts | ||
tests | ||
.gitignore | ||
LICENSE | ||
Makefile | ||
pyproject.toml | ||
README.md | ||
uv.lock |
langchain-deepseek
This package contains the LangChain integration with the DeepSeek API
Installation
pip install -U langchain-deepseek
And you should configure credentials by setting the following environment variables:
DEEPSEEK_API_KEY
Chat Models
ChatDeepSeek
class exposes chat models from DeepSeek.
from langchain_deepseek import ChatDeepSeek
llm = ChatDeepSeek(model="deepseek-chat")
llm.invoke("Sing a ballad of LangChain.")