This release is a pre-release and may not be stable for production use.
🦜️🔗✨ LangChain-xfyun
⚡ 在LangChain中流畅地使用讯飞星火大模型 ⚡
⏩ 快速安装
pip install langchain-xfyun
🤔 这是什么?
大型语言模型(LLM)正在成为一种变革性技术,它使开发人员能够构建以前无法构建的应用程序。然而,孤立地使用这些 LLM 通常不足以创建真正强大的应用程序,只有将它们与其他计算或知识来源相结合,才能发挥真正的威力。
-
Fork from langchain
-
添加了讯飞星火大模型的支持,让你可以在langchain中使用SparkLLM
-
[TODO] 修改langchain内置prompt以适应SparkLLM
-
其它关于langchain的信息可以参考 LangChain's original README.md
❓ 如何使用
from langchain_xfyun.chat_models import ChatSpark
from langchain_xfyun.prompts import ChatPromptTemplate
from langchain_xfyun.chains import LLMChain
llm = ChatSpark(app_id="your_app_id", api_key="your_api_key",
api_secret="your_api_secret")
prompt = ChatPromptTemplate.from_template(
"我有一个生产[{product}]商品的公司,请帮我取一个最合适的公司名称。只输出答案本身"
)
chain = LLMChain(llm=llm, prompt=prompt, verbose=True)
product = "魔方"
ans = chain.run(product)
print(ans)
-
像以前一样使用chat model,现在你可以使用
ChatSpark而不是ChatOpenAI -
更详细的内容请参考langchain 官方文档
💁 Contributing
As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
For detailed information on how to contribute, see here.
Metadata
Release files for langchain-xfyun 0.0.275b2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_xfyun-0.0.275b2.tar.gz | 1.1 MB | Without provenance | Details for langchain_xfyun-0.0.275b2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_xfyun-0.0.275b2-py3-none-any.whl | Python 3 | none | any | Details for langchain_xfyun-0.0.275b2-py3-none-any.whl |
Total release size: 2.7 MB
Release files / langchain_xfyun-0.0.275b2.tar.gz
| Download URL | langchain_xfyun-0.0.275b2.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2cc0e9a0dd00ce3cbf1ead3f1a176bee340d508ea039daf4cd624fc1096d0cb9
|
|
BLAKE2b-256 checksum How to use checksums |
0493abf62c6118ae2bd289d204b5975cf6384bc836eab4bf3bd31442074cfaf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.4 Darwin/22.4.0
|
Release files / langchain_xfyun-0.0.275b2-py3-none-any.whl
| Download URL | langchain_xfyun-0.0.275b2-py3-none-any.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8815290baa509869f17dde79b13dcee252051ddd39115717f840f6f18e710041
|
|
BLAKE2b-256 checksum How to use checksums |
2e0e6e17a1286a12e5b2db5f87dd4312a247f0cb11957ed4de019cff5dcab0a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.4 Darwin/22.4.0
|
Security for langchain-xfyun 0.0.275b2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.