This commit is contained in:
Rodrigo Nader 2023-07-27 22:14:05 -03:00
commit 2ce2be4544

View file

@ -162,7 +162,7 @@ class BestComponent(CustomComponent):
The class can have a [_`build_config`_](focus://11:19) method, which is used to define configuration fields for the component. The _`build_config`_ method should always return a dictionary with specific keys representing the field names and their corresponding configurations. It must follow the format described below:
- Top level keys are field names.
- Top-level keys are field names.
- Their values are also of type _`dict`_. They specify the behavior of the generated fields.
Check out the [component reference](../components/custom) for more details on the available field configurations.
@ -188,7 +188,7 @@ class BestComponent(CustomComponent):
## Example
Let's create a custom component that will convert a chain into a tool. It should receive as input a chain component, a tool name and description (for an agent to access it).
Let's create a custom component that will convert a chain into a tool. It should receive as input a chain component, a tool name, and a description (for an agent to access it).
<Admonition type="info" label="Tip">
@ -251,9 +251,9 @@ class BestComponent(CustomComponent):
The _`build_config`_ method will be used to configure the fields of the component.
- _`multiline`_ adds the possibility of editing text in an expansive text editor.
- _`multiline`_ allows editing text in an expansive text editor.
- _`is_list`_ allows for an input field to contain multiple values. When paired with _`options`_, it will transform it into a dropdown menu.
- _`is_list`_ allows an input field to contain multiple values. When paired with _`options`_, it will transform it into a dropdown menu.
```python focus=12:19
from langflow import CustomComponent
@ -415,7 +415,7 @@ class FlowRunner(CustomComponent):
```
Now let's import Document from the schema module which will be our return type for the _`build`_ method.
Now let's import Document from the schema module, which will be our return type for the _`build`_ method.
---
@ -488,7 +488,7 @@ class FlowRunner(CustomComponent):
```
With the _`list_flows`_ method we can get a list of all the flows in the collection.
With the _`list_flows`_ method, we can get a list of all the flows in the collection.
We can then get the flow that matches the selected name.