Skip to main content

Contribute components

New components are added as objects of the CustomComponent class.

Any dependencies are added to the pyproject.toml file.

Contribute an example component to Langflow

Anyone can contribute an example component. For example, if you created a new document loader called MyCustomDocumentLoader, you can follow these steps to contribute it to Langflow.

  1. Write your loader as an object of the CustomComponent class. You'll create a new class, MyCustomDocumentLoader, that will inherit from CustomComponent and override the base class's methods.
  2. Define optional attributes like display_namedescription, and documentation to provide information about your custom component.
  3. Implement the build_config method to define the configuration options for your custom component.
  4. Implement the build method to define the logic for taking input parameters specified in the build_config method and returning the desired output.
  5. Add the code to the /components/documentloaders folder.
  6. Add the dependency to /documentloaders/init.py as from .MyCustomDocumentLoader import MyCustomDocumentLoader.
  7. Add any new dependencies to the pyproject.toml file.
  8. Submit documentation for your component. For this example, you'd submit documentation to the loaders page.
  9. Submit your changes as a pull request. The Langflow team will have a look, suggest changes, and add your component to Langflow.

Hi, how can I help you?