Giter Club home page Giter Club logo

langchain-google-firestore-python's Introduction

Firestore for LangChain

preview pypi versions

Quick Start

In order to use this library, you first need to go through the following steps:

  1. Select or create a Cloud Platform project.
  2. Enable billing for your project.
  3. Enable the Google Cloud Firestore API.
  4. Setup Authentication.

Installation

Install this library in a virtualenv using pip. virtualenv is a tool to create isolated Python environments. The basic problem it addresses is one of dependencies and versions, and indirectly permissions.

With virtualenv, it’s possible to install this library without needing system install permissions, and without clashing with the installed system dependencies.

Supported Python Versions

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

Vector Store Usage

Use a vector store to store embedded data and perform vector search.

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
)

See the full Vector Store tutorial.

Document Loader Usage

Use a document loader to load data as LangChain Documents.

from langchain_google_firestore import FirestoreLoader

loader = FirestoreLoader("Collection")
docs = loader.lazy_load()

See the full Document Loader tutorial.

Chat Message History Usage

Use ChatMessageHistory to store messages and provide conversation history to LLMs.

from langchain_google_firestore import FirestoreChatMessageHistory

history = FirestoreChatMessageHistory(
    session_id="my-session-id",
    collection="HistoryMessages"
)

See the full Chat Message History tutorial.

Contributions

Contributions to this library are always welcome and highly encouraged.

See CONTRIBUTING for more information how to get started.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See Code of Conduct for more information.

License

Apache 2.0 - See LICENSE for more information.

Disclaimer

This is not an officially supported Google product.

langchain-google-firestore-python's People

Contributors

averikitsch avatar renovate-bot avatar release-please[bot] avatar duwenxin99 avatar dependabot[bot] avatar ju-2094 avatar yuan325 avatar pr-mais avatar ehsannas avatar klmilam avatar

Stargazers

chefai avatar Ramesh Krishna avatar Masahiro Nakamura avatar Jimmy Briggs avatar nkmry avatar Brenden Durham avatar Jonathan Poczatek avatar Vinesh avatar  avatar Josh Ogden avatar  avatar Alfredo Prada Giorgi avatar Mark Edmondson avatar

Watchers

Riccardo Carlesso avatar Alexander Lucas avatar Peter Friese avatar Don McCasland avatar Jessica Chan avatar David Poll avatar Romin Irani avatar LeoY avatar Chris Cotter avatar Chalmer Lowe avatar Yu-Han Liu avatar Baha Aiman avatar  avatar Aaron Wanjala avatar Jason Davenport avatar  avatar  avatar  avatar

langchain-google-firestore-python's Issues

Warning: a recent release failed

The following release PRs may have failed:

  • #27 - The release job was triggered, but has not reported back success.
  • #1 - The release job was triggered, but has not reported back success.

Warning: a recent release failed

The following release PRs may have failed:

  • #27 - The release job was triggered, but has not reported back success.
  • #1 - The release job was triggered, but has not reported back success.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • chore(deps): update github actions (actions/checkout, actions/setup-python)
  • chore(deps): update dependency test/mypy to v1.10.1
  • chore(deps): update dependency test/black to v24
  • chore(deps): update dependency test/pytest to v8

Detected dependencies

github-actions
.github/workflows/docs.yml
  • actions/checkout v4
  • actions/setup-python v5
  • actions/checkout v4
  • actions/setup-python v5
.github/workflows/lint.yml
  • actions/github-script v7.0.1@60a0d83039c74a4aee543508d2ffcb1c3799cdea
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-python v5.1.0@82c7e631bb3cdc910f68e0081d67478d79c6982d
.github/workflows/lint_fallback.yml
pep621
pyproject.toml
  • langchain-core >=0.1.1, <1.0.0
  • langchain-community >=0.0.18, <1.0.0
  • google-cloud-firestore >=2.16.0, <3.0.0
  • more_itertools >=10.2.0, <11.0.0
  • test/black ==23.12.1
  • test/isort ==5.13.2
  • test/mypy ==1.10.0
  • test/pytest-asyncio ==0.23.7
  • test/pytest ==7.4.4
  • test/pytest-cov ==5.0.0
pip_requirements
requirements.txt
  • langchain-core ==0.2.9
  • langchain-community ==0.2.5
  • google-cloud-firestore ==2.16.0
  • more-itertools ==10.3.0

  • Check this box to trigger a request for Renovate to run again on this repository

Your .repo-metadata.json file has a problem πŸ€’

You have a problem with your .repo-metadata.json file:

Result of scan πŸ“ˆ:

  • client_documentation must match pattern "^https://.*" in .repo-metadata.json

☝️ Once you address these problems, you can close this issue.

Need help?

  • Schema definition: lists valid options for each field.
  • API index: for gRPC libraries api_shortname should match the subdomain of an API's hostName.
  • Reach out to go/github-automation if you have any questions.

Your .repo-metadata.json file has a problem πŸ€’

You have a problem with your .repo-metadata.json file:

Result of scan πŸ“ˆ:

  • must have required property 'client_documentation' in .repo-metadata.json

☝️ Once you address these problems, you can close this issue.

Need help?

  • Schema definition: lists valid options for each field.
  • API index: for gRPC libraries api_shortname should match the subdomain of an API's hostName.
  • Reach out to go/github-automation if you have any questions.

Readable string in firestore for chat_message_history

Hi and thanks for this module,

It is possible to have a possibility to not encode the message into the firestore db ?

Use case: We want to sync the db into BigQuery for analysis without having to decode them and browse the firestore db to check the message.

Thanks again

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.