Skip to content

kulaone/LC_GCF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LangChain.js with Google Cloud Functions

This repository contains the source code and additional resources for the tutorial on integrating the LangChain.js library with Google Cloud Functions to build powerful and scalable natural language processing (NLP) applications.

More about it in the article: https://medium.com/@zps270/a-comprehensive-guide-to-using-langchain-js-and-google-cloud-functions-for-ai-applications-426e0e83f0e6

Contents

  • javascript/: Code for the JavaScript implementation of the Google Cloud Function with LangChain.js.
  • python/: Code for the Python implementation of the Google Cloud Function with LangChain.js.
  • frontend/: A simple front-end application for testing the Google Cloud Function.

Getting Started

Prerequisites

  • A Google Cloud account with an active project
  • Node.js (version 10 or higher) installed for the JavaScript implementation
  • Python (version 3.7 or higher) installed for the Python implementation
  • Google Cloud SDK installed and configured on your local machine

Setup

  1. Clone this repository to your local machine:

    git clone https://github.com/kulaone/LC_GCF
    
  2. Navigate to the javascript/ or python/ directory, depending on the implementation you want to work with.

  3. Follow the steps in the tutorial to create and configure a new Google Cloud Function and deploy the code from the chosen directory.

Testing

To test your Google Cloud Function, you can use the provided front-end application located in the frontend/ directory:

  1. Update the backendUrl variable in the frontend/main.js file to match the URL of your deployed Google Cloud Function.

  2. Open the frontend/index.html file in your web browser.

  3. Enter the text you want to translate in the input field and click the "Translate" button.

  4. The translated text should appear below the input field.

Please note that the examples provided in this repository do not include security measures. Implement appropriate security precautions before deploying your function to a production environment.

License

This project is licensed under the [LICENSE NAME] License - see the LICENSE file for details.

About

Using LangChain with Google Cloud Functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published