Skip to content

Commit 5f2b926

Browse files
committed
docs: Update CONTRIBUTING.md
1 parent 898d535 commit 5f2b926

File tree

3 files changed

+113
-46
lines changed

3 files changed

+113
-46
lines changed

CONTRIBUTING.md

Lines changed: 101 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
We welcome contributions of any size and skill level, whether it be in the form of a new
55
feature, improved infra, or better documentation.
66

7-
To contribute to this project, please follow a
8-
["fork and pull request"](https://github.com/firstcontributions/first-contributions) workflow.
9-
10-
## 🔗 Quick links
11-
12-
### Not sure what to work on?
7+
## 🙋Where to start
138

149
If you are not sure what to work on, we have a few suggestions:
1510

@@ -22,7 +17,70 @@ If you are not sure what to work on, we have a few suggestions:
2217
If you are interested in working on a specific integration or feature, just pick anything from
2318
those lists not done yet, please let us know and we can help you get started.
2419

25-
## 🗺️ Contributing guidelines
20+
Once you have picked an issue, read the rest of this document to get set up and start contributing!
21+
22+
## 🗺️ Guidelines
23+
24+
### 📁 Project structure
25+
26+
The project has a modular design where the core `langchain` package provides the LangChain API and
27+
each integration with a model provider, data store, etc. is provided by a separate package
28+
(e.g. `langchain_openai`).
29+
30+
The project is structured as follows:
31+
- `packages`: contains the core `langchain` package and all integration packages.
32+
- `docs`: contains the project documentation.
33+
- `examples`: contains sample apps that demonstrate how to use the LangChain.dart.
34+
35+
### 👩‍💻 Workflow
36+
37+
To contribute to this project, please follow a
38+
["fork and pull request"](https://github.com/firstcontributions/first-contributions) workflow.
39+
40+
Pull requests cannot land without passing the formatting, linting and testing checks first. See
41+
[Common Tasks](https://github.com/davidmigloz/langchain_dart/blob/main/CONTRIBUTING.md#-common-tasks)
42+
for how to run these checks locally.
43+
44+
The project follows [Conventional Commits](https://www.conventionalcommits.org/) specification for commit messages.
45+
This allows us to automatically generate the changelog and release notes. We use the following types:
46+
- `feat`: a new feature.
47+
- `fix`: a bug fix.
48+
- `refactor`: a code change that neither fixes a bug nor adds a feature.
49+
- `test`: adding missing tests or correcting existing tests.
50+
- `docs`: documentation only changes.
51+
- `chore`: changes to the build process or auxiliary tools.
52+
53+
After the type comes the scope, we use the component name indicated in the issue (e.g. `chains`, `llms`, etc.).
54+
If it is a breaking change, append a `!` after the type/scope (e.g. `feat(chains)!: ...`).
55+
At the end of the commit message, add the ticket number (e.g. `#123`).
56+
57+
These are some examples of valid commit messages:
58+
```
59+
feat(memory): Add support for ConversationTokenBufferMemory (#26)
60+
fix(agents): Allow to add memory to an agent executor (#80)
61+
refactor(memory): Extract default memory key and prefixes to constants
62+
tests(memory): ChatMessageHistory removeLast and removeFirst (#82)
63+
docs(agents): Add example of using memory in OpenAIFunctionsAgent (#91)
64+
```
65+
66+
It's essential that we maintain great documentation and testing. If you:
67+
- Add a new feature
68+
* Add relevant documentation (API docs, project docs, examples, etc.)
69+
* Add relevant unit or integration test
70+
- Fix a bug
71+
* Add a relevant unit or integration test
72+
- Make an improvement
73+
* Add or update relevant documentation (API docs, project docs, examples, etc.)
74+
* Add or update relevant unit or integration test
75+
76+
If you add a new major piece of functionality, it is helpful to add an example to showcase how to
77+
use it. Most of our users find examples to be the most helpful kind of documentation.
78+
79+
Examples can be added in the `examples` directory of the repository. Each example should contain
80+
a README that explains what the example does, and how to run it.
81+
82+
We're a small, building-oriented team. If there's something you'd like to add or change, opening a pull
83+
request is the best way to get our attention.
2684

2785
### 🚩 GitHub issues
2886

@@ -70,18 +128,9 @@ codebase. If you are finding these difficult (or even just annoying) to work wit
70128
contact a maintainer for help - we do not want these to get in the way of getting good code into
71129
the codebase.
72130

73-
### 🏭 Release process
74-
75-
As of now, LangChain has an ad hoc release process: releases are cut with high frequency via by
76-
a developer and published to [pub.dev](https://pub.dev/packages/langchain).
77-
78-
LangChain follows the [semver](https://semver.org/) versioning standard. However, as pre-1.0
79-
software, even patch releases may contain
80-
[non-backwards-compatible changes](https://semver.org/#spec-item-4).
81-
82131
## 🚀 Quick start
83132

84-
### Tooling
133+
Our primary goal is to make it as easy as possible for you to contribute to this project.
85134

86135
This project uses the following tools, which are worth getting familiar with if you plan to
87136
contribute:
@@ -92,20 +141,17 @@ contribute:
92141
- **[GitHub Actions](https://github.com/features/actions)** - a CI/CD tool for GitHub repositories.
93142
- **[docsify](https://docsify.js.org)** - static site generation for documentation.
94143

95-
Now, you should be able to run the common tasks in the following section.
96-
97-
## ✅ Common tasks
98-
99-
Our primary goal is to make it as easy as possible for you to contribute to this project.
100-
101-
### Setup
102-
103-
To get started, you will need to install the dependencies for the project. To do so, run:
144+
To get started, run:
104145

105146
```bash
106147
melos bootstrap
107148
```
108149

150+
This will install all the dependencies and set up the monorepo. If you don't get any errors,
151+
you are good to go!
152+
153+
## ✅ Common tasks
154+
109155
### Formatting
110156

111157
We use [dart format](https://dart.dev/tools/dart-format) to enforce
@@ -145,14 +191,6 @@ If you only want to run the tests for the packages that have changed compared to
145191
melos test:diff
146192
```
147193

148-
### Examples
149-
150-
If you add a new major piece of functionality, it is helpful to add an example to showcase how to
151-
use it. Most of our users find examples to be the most helpful kind of documentation.
152-
153-
Examples can be added in the `examples` directory of the repository. Each example should contain
154-
a README that explains what the example does, and how to run it.
155-
156194
## 📄 Documentation
157195

158196
The [API reference](https://pub.dev/documentation/langchain/latest/) docs are automatically
@@ -168,3 +206,32 @@ You can run a hot-reloading version of the docs static site by running:
168206
```bash
169207
docsify serve docs
170208
```
209+
210+
## 🏭 Release process
211+
212+
As of now, LangChain has an ad-hoc release process: releases are cut with high frequency via by
213+
a developer and published to [pub.dev](https://pub.dev/packages/langchain).
214+
215+
LangChain follows the [semver](https://semver.org/) versioning standard. However, as pre-1.0
216+
software, even patch releases may contain
217+
[non-backwards-compatible changes](https://semver.org/#spec-item-4).
218+
219+
To create a release, run:
220+
221+
```bash
222+
melos version -V langchain:x.x.x --no-private
223+
```
224+
225+
This command will bump the version in the `langchain` package and all packages that depend on it.
226+
It will also update the CHANGELOG.md for each package, commit the changes and creates tags.
227+
228+
Create a new release on GitHub and copy the CHANGELOG.md content into the release description.
229+
230+
After that, you can publish the package to pub.dev:
231+
232+
```bash
233+
melos publish --no-dry-run
234+
```
235+
236+
Finally, drop by the [Discord](https://discord.gg/x4qbhqecVR) and let everyone know about the new
237+
release!

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ The components can be grouped into a few core modules:
2323

2424
![LangChain.dart](https://raw.githubusercontent.com/davidmigloz/langchain_dart/main/docs/img/langchain.dart.png)
2525

26-
- **Model I/O:** streamlines the interaction between the model inputs (prompt templates), the
26+
- 📃 **Model I/O:** streamlines the interaction between the model inputs (prompt templates), the
2727
Language Model (abstracting different providers), and the model output (output parsers).
28-
- **Data Connection:** assists in loading user data (document loaders), modifying it (document
28+
- 📚 **Data Connection:** assists in loading user data (document loaders), modifying it (document
2929
transformers), storing (via text embedding models and vector stores), and retrieving when needed
3030
(retrievers).
31-
- **Chains:** a way to compose multiple components or other chains into a single pipeline.
32-
- **Memory:** equips chains or agents with both short-term and long-term memory capabilities,
31+
- 🔗 **Chains:** a way to compose multiple components or other chains into a single pipeline.
32+
- 🧠 **Memory:** equips chains or agents with both short-term and long-term memory capabilities,
3333
facilitating recall of prior interactions with the user.
34-
- **Agents:** "Bots" that harness LLMs to perform tasks. They serve as the link between LLM and the
34+
- 🤖 **Agents:** "Bots" that harness LLMs to perform tasks. They serve as the link between LLM and the
3535
tools (web search, calculators, database lookup, etc.). They determine what has to be
3636
accomplished and the tools that are more suitable for the specific task.
3737

@@ -87,7 +87,7 @@ final result = await llm('Hello world!');
8787
- [LangChain conceptual guide](https://docs.langchain.com/docs)
8888
- [LangChain.dart documentation](https://langchaindart.com)
8989
- [Sample apps](https://github.com/davidmigloz/langchain_dart/tree/main/examples)
90-
- [Blog](https://blog.langchaindart.com)
90+
- [LangChain.dart blog](https://blog.langchaindart.com)
9191
- [Project board](https://github.com/users/davidmigloz/projects/2/views/1)
9292

9393
## Support

packages/langchain/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ The components can be grouped into a few core modules:
2323

2424
![LangChain.dart](https://raw.githubusercontent.com/davidmigloz/langchain_dart/main/docs/img/langchain.dart.png)
2525

26-
- **Model I/O:** streamlines the interaction between the model inputs (prompt templates), the
26+
- 📃 **Model I/O:** streamlines the interaction between the model inputs (prompt templates), the
2727
Language Model (abstracting different providers), and the model output (output parsers).
28-
- **Data Connection:** assists in loading user data (document loaders), modifying it (document
28+
- 📚 **Data Connection:** assists in loading user data (document loaders), modifying it (document
2929
transformers), storing (via text embedding models and vector stores), and retrieving when needed
3030
(retrievers).
31-
- **Chains:** a way to compose multiple components or other chains into a single pipeline.
32-
- **Memory:** equips chains or agents with both short-term and long-term memory capabilities,
31+
- 🔗 **Chains:** a way to compose multiple components or other chains into a single pipeline.
32+
- 🧠 **Memory:** equips chains or agents with both short-term and long-term memory capabilities,
3333
facilitating recall of prior interactions with the user.
34-
- **Agents:** "Bots" that harness LLMs to perform tasks. They serve as the link between LLM and the
34+
- 🤖 **Agents:** "Bots" that harness LLMs to perform tasks. They serve as the link between LLM and the
3535
tools (web search, calculators, database lookup, etc.). They determine what has to be
3636
accomplished and the tools that are more suitable for the specific task.
3737

@@ -87,7 +87,7 @@ final result = await llm('Hello world!');
8787
- [LangChain conceptual guide](https://docs.langchain.com/docs)
8888
- [LangChain.dart documentation](https://langchaindart.com)
8989
- [Sample apps](https://github.com/davidmigloz/langchain_dart/tree/main/examples)
90-
- [Blog](https://blog.langchaindart.com)
90+
- [LangChain.dart blog](https://blog.langchaindart.com)
9191
- [Project board](https://github.com/users/davidmigloz/projects/2/views/1)
9292

9393
## Support

0 commit comments

Comments
 (0)