Add docs for field update, icon, and small fixes (#1459)

* Refactor code formatting and improve error handling in utils.py

* Refactor parameterComponent to include refresh button

* Update Langflow description

* Add new_langflow_demo.gif and remove langflow-demo.gif and langflow-screen.png

* Update image source path in README.md

* Add dynamic options and default value support to CustomComponent class
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-02-21 22:30:01 -03:00 committed by GitHub
commit 8c897514aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 36 additions and 11 deletions

View file

@ -82,6 +82,16 @@ The CustomComponent class serves as the foundation for creating custom component
| _`info: str`_ | Adds a tooltip to the field. |
| _`file_types: List[str]`_ | This is a requirement if the _`field_type`_ is _file_. Defines which file types will be accepted. For example, _json_, _yaml_ or _yml_. |
| _`range_spec: langflow.field_typing.RangeSpec`_ | This is a requirement if the _`field_type`_ is _`float`_. Defines the range of values accepted and the step size. If none is defined, the default is _`[-1, 1, 0.1]`_. |
<Admonition type="info" label="Tip">
Keys _`options`_ and _`value`_ can receive a method or function that returns a list of strings or a string, respectively. This is useful when you want to dynamically generate the options or the default value of a field. A refresh button will appear next to the field in the component, allowing the user to update the options or the default value.
</Admonition>
- The CustomComponent class also provides helpful methods for specific tasks (e.g., to load and use other flows from the Langflow platform):
| Method Name | Description |
@ -96,6 +106,7 @@ The CustomComponent class serves as the foundation for creating custom component
| -------------- | ----------------------------------------------------------------------------- |
| _`status`_ | Displays the value it receives in the _`build`_ method. Useful for debugging. |
| _`field_order`_ | Defines the order the fields will be displayed in the canvas. |
| _`icon`_ | Defines the emoji (for example, _`:rocket:`_) that will be displayed in the canvas. |
<Admonition type="info" label="Tip">

View file

@ -1,6 +1,6 @@
# 👋 Welcome to Langflow
Langflow is an easy way to prototype [LangChain](https://github.com/hwchase17/langchain) flows. The drag-and-drop feature allows quick and effortless experimentation, while the built-in chat interface facilitates real-time interaction. It provides options to edit prompt parameters, create chains and agents, track thought processes, and export flows.
Langflow is an easy way to create flows. The drag-and-drop feature allows quick and effortless experimentation, while the built-in chat interface facilitates real-time interaction. It provides options to edit prompt parameters, create chains and agents, track thought processes, and export flows.
import ThemedImage from "@theme/ThemedImage";
import useBaseUrl from "@docusaurus/useBaseUrl";
@ -11,7 +11,7 @@ import ZoomableImage from "/src/theme/ZoomableImage.js";
<ZoomableImage
alt="Docusaurus themed image"
sources={{
light: "img/new_langflow.gif",
light: "img/new_langflow_demo.gif",
}}
style={{ width: "100%" }}
/>