2023-10-28 23:26:52 +00:00
|
|
|
# Contributing
|
|
|
|
|
|
|
|
Thanks for taking the time to contribute a new template!
|
|
|
|
We've tried to make this process as simple and painless as possible.
|
|
|
|
If you need any help at all, please reach out!
|
|
|
|
|
|
|
|
To contribute a new template, first fork this repository.
|
|
|
|
Then clone that fork and pull it down locally.
|
2023-10-29 05:13:22 +00:00
|
|
|
Set up an appropriate dev environment, and make sure you are in this `templates` directory.
|
2023-10-28 23:26:52 +00:00
|
|
|
|
|
|
|
Make sure you have `langchain-cli` installed.
|
|
|
|
|
|
|
|
```shell
|
2023-11-03 19:10:32 +00:00
|
|
|
pip install -U langchain-cli
|
2023-10-28 23:26:52 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
You can then run the following command to create a new skeleton of a package.
|
2023-11-02 20:31:04 +00:00
|
|
|
By convention, package names should use `-` delimiters (not `_`).
|
2023-10-28 23:26:52 +00:00
|
|
|
|
|
|
|
```shell
|
2023-10-30 23:39:39 +00:00
|
|
|
langchain template new $PROJECT_NAME
|
2023-10-28 23:26:52 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
You can then edit the contents of the package as you desire.
|
|
|
|
Note that by default we expect the main chain to be exposed as `chain` in the `__init__.py` file of the package.
|
|
|
|
You can change this (either the name or the location), but if you do so it is important to update the `tool.langchain`
|
|
|
|
part of `pyproject.toml`.
|
|
|
|
For example, if you update the main chain exposed to be called `agent_executor`, then that section should look like:
|
|
|
|
|
|
|
|
```text
|
|
|
|
[tool.langserve]
|
|
|
|
export_module = "..."
|
|
|
|
export_attr = "agent_executor"
|
|
|
|
```
|
|
|
|
|
|
|
|
Make sure to add any requirements of the package to `pyproject.toml` (and to remove any that are not used).
|
|
|
|
|
|
|
|
Please update the `README.md` file to give some background on your package and how to set it up.
|
|
|
|
|
|
|
|
If you want to change the license of your template for whatever, you may! Note that by default it is MIT licensed.
|
|
|
|
|
|
|
|
If you want to test out your package at any point in time, you can spin up a LangServe instance directly from the package.
|
|
|
|
See instructions [here](LAUNCHING_PACKAGE.md) on how to best do that.
|