From 4873a93a9daa880be8b2f96abe880b7072602629 Mon Sep 17 00:00:00 2001 From: Harrison Chase Date: Tue, 14 Feb 2023 11:57:19 -0800 Subject: [PATCH 1/4] cr --- README.md | 39 ++++++--------------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 178308a79ba0..7d479e43617d 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,6 @@ ⚡ Building applications with LLMs through composability ⚡ -**Production Support:** As you move your LangChains into production, we'd love to offer more comprehensive support. -Please fill out [this form](https://forms.gle/57d8AmXBYp8PP8tZA) and we'll set up a dedicated support Slack channel. - ## Quick Install `yarn add langchain.js --ignore-optional` @@ -25,42 +22,18 @@ create a truly powerful app - the real power comes when you can combine them wit This library is aimed at assisting in the development of those types of applications. +## Relationship with Python LangChain + +This is built to integrate as seamlessly as possible with the [LangChain Python package](https://github.com/hwchase17/langchain). Specifically, this means all objects (prompts, LLMs, chains, etc) are designed in a way where they can be serialized and shared between languages. + ## 📖 Documentation Documentation for Typescript is still WIP. In the meantime you can see the full Python documentation [here](https://langchain.readthedocs.io/en/latest/?) -## 🚀 What can this help with? - -There are six main areas that LangChain is designed to help with. -These are, in increasing order of complexity: - -**📃 LLMs and Prompts:** - -This includes prompt management, prompt optimization, generic interface for all LLMs, and common utilities for working with LLMs. - -**🔗 Chains:** - -Chains go beyond just a single LLM call, and are sequences of calls (whether to an LLM or a different utility). LangChain provides a standard interface for chains, lots of integrations with other tools, and end-to-end chains for common applications. - -**📚 Data Augmented Generation:** - -Data Augmented Generation involves specific types of chains that first interact with an external datasource to fetch data to use in the generation step. Examples of this include summarization of long pieces of text and question/answering over specific data sources. - -**🤖 Agents:** - -Agents involve an LLM making decisions about which Actions to take, taking that Action, seeing an Observation, and repeating that until done. LangChain provides a standard interface for agents, a selection of agents to choose from, and examples of end to end agents. - -**🧠 Memory:** - -Memory is the concept of persisting state between calls of a chain/agent. LangChain provides a standard interface for memory, a collection of memory implementations, and examples of chains/agents that use memory. - -**🧐 Evaluation:** - -[BETA] Generative models are notoriously hard to evaluate with traditional metrics. One new way of evaluating them is using language models themselves to do the evaluation. LangChain provides some prompts/chains for assisting in this. - -For more information on these concepts, please see our [full documentation](https://langchain.readthedocs.io/en/latest/?). ## 💁 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 infra, or better documentation. + +Check out [our contributing guidelines](CONTRIBUTING.md) for instructions on how to contribute. From 4fcea2ff35fe6cfc6a16ab8f533650c742dbe39c Mon Sep 17 00:00:00 2001 From: Harrison Chase Date: Tue, 14 Feb 2023 12:31:57 -0800 Subject: [PATCH 2/4] cr --- CONTRIBUTING.md | 135 ++++++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 21 ++++++++ 2 files changed, 156 insertions(+) create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000000..8f2cad4320a4 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,135 @@ +# Contributing to LangChain + +Hi there! Thank you for even being interested in contributing to LangChain. +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 infra, or better documentation. + +To contribute to this project, please follow a ["fork and pull request"](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) workflow. +Please do not try to push directly to this repo unless you are maintainer. + +## 🗺️Contributing Guidelines + +### 🚩GitHub Issues + +Our [issues](https://github.com/hwchase17/langchainjs/issues) page is kept up to date +with bugs, improvements, and feature requests. There is a taxonomy of labels to help +with sorting and discovery of issues of interest. These include: + +- prompts: related to prompt tooling/infra. +- llms: related to LLM wrappers/tooling/infra. +- chains +- utilities: related to different types of utilities to integrate with (Python, SQL, etc.). +- agents +- memory +- applications: related to example applications to build + +If you start working on an issue, please assign it to yourself. + +If you are adding an issue, please try to keep it focused on a single modular bug/improvement/feature. +If the two issues are related, or blocking, please link them rather than keep them as one single one. + +We will try to keep these issues as up to date as possible, though +with the rapid rate of develop in this field some may get out of date. +If you notice this happening, please just let us know. + +### 🙋Getting Help + +Although we try to have a developer setup to make it as easy as possible for others to contribute (see below) +it is possible that some pain point may arise around environment setup, linting, documentation, or other. +Should that occur, please contact a maintainer! Not only do we want to help get you unblocked, +but we also want to make sure that the process is smooth for future contributors. + +In a similar vein, we do enforce certain linting, formatting, and documentation standards in the codebase. +If you are finding these difficult (or even just annoying) to work with, +feel free to contact a maintainer for help - we do not want these to get in the way of getting +good code into the codebase. + +### 🏭Release process + +# TODO: +As of now, LangChain has an ad hoc release process: releases are cut with high frequency via by +a developer and published to [PyPI](https://pypi.org/project/langchain/). + +LangChain follows the [semver](https://semver.org/) versioning standard. However, as pre-1.0 software, +even patch releases may contain [non-backwards-compatible changes](https://semver.org/#spec-item-4). + +If your contribution has made its way into a release, we will want to give you credit on Twitter (only if you want though)! +If you have a Twitter account you would like us to mention, please let us know in the PR or in another manner. + +## 🚀Quick Start + +# TODO + +This project uses [Poetry](https://python-poetry.org/) as a dependency manager. Check out Poetry's [documentation on how to install it](https://python-poetry.org/docs/#installation) on your system before proceeding. + +❗Note: If you use `Conda` or `Pyenv` as your environment / package manager, avoid dependency conflicts by doing the following first: +1. *Before installing Poetry*, create and activate a new Conda env (e.g. `conda create -n langchain python=3.9`) +2. Install Poetry (see above) +3. Tell Poetry to use the virtualenv python environment (`poetry config virtualenvs.prefer-active-python true`) +4. Continue with the following steps. + +To install requirements: + +```bash +poetry install -E all +``` + +This will install all requirements for running the package, examples, linting, formatting, tests, and coverage. Note the `-E all` flag will install all optional dependencies necessary for integration testing. + +Now, you should be able to run the common tasks in the following section. + +## ✅Common Tasks + + +### Testing: TODO + +Unit tests cover modular logic that does not require calls to outside APIs. + +To run unit tests: + +```bash +make test +``` + +If you add new logic, please add a unit test. + +Integration tests cover logic that requires making calls to outside APIs (often integration with other services). + +To run integration tests: + +```bash +make integration_tests +``` + +If you add support for a new external API, please add a new integration test. + + +## Documentation: TODO + +### Contribute Documentation + +Docs are largely autogenerated by [sphinx](https://www.sphinx-doc.org/en/master/) from the code. + +For that reason, we ask that you add good documentation to all classes and methods. + +Similar to linting, we recognize documentation can be annoying. If you do not want to do it, please contact a project maintainer, and they can help you with it. We do not want this to be a blocker for good code getting contributed. + +### Build Documentation Locally + +Before building the documentation, it is always a good idea to clean the build directory: + +```bash +make docs_clean +``` + +Next, you can run the linkchecker to make sure all links are valid: + +```bash +make docs_linkcheck +``` + +Finally, you can build the documentation as outlined below: + +```bash +make docs_build +``` diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..d5c9d8189aa9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) Harrison Chase + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file From fefcb5acac805690004a46012604784db55af345 Mon Sep 17 00:00:00 2001 From: Harrison Chase Date: Tue, 14 Feb 2023 12:33:06 -0800 Subject: [PATCH 3/4] cr --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 7d479e43617d..26b782868cea 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ ⚡ Building applications with LLMs through composability ⚡ +**Production Support:** As you move your LangChains into production, we'd love to offer more comprehensive support. +Please fill out [this form](https://forms.gle/57d8AmXBYp8PP8tZA) and we'll set up a dedicated support Slack channel. + ## Quick Install `yarn add langchain.js --ignore-optional` From b509d7e1db81c3a42fbf7cfdf46b3c9682ff7408 Mon Sep 17 00:00:00 2001 From: Harrison Chase Date: Thu, 16 Feb 2023 21:18:55 -0800 Subject: [PATCH 4/4] cr --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5c64a23a0b2a..e86080e013a5 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,11 @@ This library is aimed at assisting in the development of those types of applicat This is built to integrate as seamlessly as possible with the [LangChain Python package](https://github.com/hwchase17/langchain). Specifically, this means all objects (prompts, LLMs, chains, etc) are designed in a way where they can be serialized and shared between languages. +The [LangChainHub](https://github.com/hwchase17/langchain-hub) is a central place for the serialized versions of these prompts, chains, and agents. + ## 📖 Documentation -Documentation for Typescript is still WIP. In the meantime you can see the -full Python documentation [here](https://langchain.readthedocs.io/en/latest/?) +For full documentation of prompts, chains, agents and more, please see [here](https://hwchase17.github.io/langchainjs/docs/overview). ## 💁 Contributing