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
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.
- 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
-
Clone this repository to your local machine:
git clone https://github.com/kulaone/LC_GCF
-
Navigate to the
javascript/
orpython/
directory, depending on the implementation you want to work with. -
Follow the steps in the tutorial to create and configure a new Google Cloud Function and deploy the code from the chosen directory.
To test your Google Cloud Function, you can use the provided front-end application located in the frontend/
directory:
-
Update the backendUrl variable in the
frontend/main.js
file to match the URL of your deployed Google Cloud Function. -
Open the
frontend/index.html
file in your web browser. -
Enter the text you want to translate in the input field and click the "Translate" button.
-
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.
This project is licensed under the [LICENSE NAME] License - see the LICENSE file for details.