Update README.md

LangChain support
This commit is contained in:
Chong Ruan 2024-05-10 13:59:57 +08:00 committed by GitHub
parent cbd18b1e47
commit 4e01a7b4ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -286,6 +286,19 @@ generated_text = [output.outputs[0].text for output in outputs]
print(generated_text) print(generated_text)
``` ```
### LangChain Support
Since our API is compatible with OpenAI, you can easily use it in [langchain](https://www.langchain.com/).
Here is an example:
```
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model='deepseek-chat',
openai_api_key=<your-deepseek-api-key>,
openai_api_base='https://api.deepseek.com/v1',
temperature=0.85,
max_tokens=8000)
```
## 8. License ## 8. License
This code repository is licensed under [the MIT License](LICENSE-CODE). The use of DeepSeek-V2 Base/Chat models is subject to [the Model License](LICENSE-MODEL). DeepSeek-V2 series (including Base and Chat) supports commercial use. This code repository is licensed under [the MIT License](LICENSE-CODE). The use of DeepSeek-V2 Base/Chat models is subject to [the Model License](LICENSE-MODEL). DeepSeek-V2 series (including Base and Chat) supports commercial use.