Google Cloud Firestore的LangChain集成
项目描述
快速入门
为了使用这个库,您首先需要完成以下步骤
安装
使用pip在virtualenv中安装此库。 virtualenv是一种创建独立Python环境的工具。它解决的基本问题是依赖关系和版本,以及间接权限。
使用virtualenv,您可以在不需要系统安装权限的情况下安装此库,并且不会与已安装的系统依赖冲突。
支持的Python版本
Python >= 3.8
Mac/Linux
pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install langchain-google-firestore
Windows
pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install langchain-google-firestore
向量存储使用
使用向量存储来存储嵌入式数据并执行向量搜索。
from langchain_google_firestore import FirestoreVectorStore
from langchain_google_vertexai import VertexAIEmbeddings
embedding = VertexAIEmbeddings(model_name="textembedding-gecko@003")
store = FirestoreVectorStore(
collection="VectorStore",
embedding=embedding
)
查看完整的向量存储教程。
文档加载器使用
使用文档加载器将数据作为LangChain Document加载。
from langchain_google_firestore import FirestoreLoader
loader = FirestoreLoader("Collection")
docs = loader.lazy_load()
查看完整的文档加载器教程。
聊天消息历史使用
使用ChatMessageHistory存储消息并向LLMs提供会话历史。
from langchain_google_firestore import FirestoreChatMessageHistory
history = FirestoreChatMessageHistory(
session_id="my-session-id",
collection="HistoryMessages"
)
查看完整的聊天消息历史教程。
贡献
欢迎并鼓励对该库的贡献。
有关如何开始的信息,请参阅贡献指南。
请注意,该项目以贡献者行为准则发布。通过参与该项目,您同意遵守其条款。更多信息请参阅行为准则。
许可证
Apache 2.0 - 更多信息请参阅许可证。
免责声明
这不是一个官方支持的Google产品。
项目详情
关闭
langchain_google_firestore-0.4.0-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | d658ffab869b8871d70e2b59cbc9d19a773fee8a00fb013486a4a6138c0391de |
|
MD5 | 426e9716ac937aa3abbcbeaaddf62dd9 |
|
BLAKE2b-256 | 665a6f7a99a233edefd8c17b742be232677badd2ec9c0fddf4cf7385c9ed757b |