The changes in this commit update the documentation for the Custom Component.
- Clarify that the code must be a class that inherits from the `langflow.CustomComponent` class.
- Explain that the type annotations of the `build` instance method are used to create the fields of the component.
- Provide a table of supported types for the `build` method.
- Introduce the `build_config` instance method for defining configuration fields.
- Describe the format and available keys for the `build_config` method.
- Add usage example for the `build` method.
These changes improve the clarity and completeness of the documentation for the Custom Component, making it easier for users to understand and utilize this feature.
🔧 fix(custom_component.py): add return type hint to 'load_flow' method for better code documentation
🔧 fix(custom_component.py): add return type hint to 'list_flows' method for better code documentation
🐛 fix(custom-component.mdx): change class name from BestComponent to DocumentProcessor to improve semantics and clarity
✨ feat(custom-component.mdx): add support for processing the page content of a document based on a selected function
📝 docs(custom-component.mdx): update example and explanations to reflect the changes made in the code
🐛 fix(custom-component.mdx): fix code indentation and remove unused imports
✨ feat(custom-component.mdx): update component name and description to improve clarity and semantics
🐛 fix(custom-component.mdx): update build method parameters and return type to match the actual implementation
✨ feat(custom-component.mdx): add support for configuring fields in the build_config method
🐛 fix(custom-component.mdx): fix code indentation and remove unused imports in the build_config method
✨ feat(custom-component.mdx): add support for configuring fields in the build_config method
✨ feat(types.py): add validation check for custom component before building field config to ensure only valid components are processed
🐛 fix(types.py): handle empty function_args case to prevent errors when adding extra fields to the frontend node
🐛 fix(types.py): handle exceptions when creating custom component to prevent crashes and log errors
✨ feat(custom-component.mdx): add rules and explanations for creating custom components
📝 docs(custom-component.mdx): update rule 1 to specify that the script must contain a single class inheriting from CustomComponent
📝 docs(custom-component.mdx): update rule 2 to specify that the class must have a build method
📝 docs(custom-component.mdx): update rule 3 to specify that the type annotations of the build method will be used to create the fields of the component
📝 docs(custom-component.mdx): update rule 4 to specify that the class can have a build_config method
📝 docs(custom-component.mdx): update rule 4 to provide details on the format of the build_config method
📝 docs(custom-component.mdx): update rule 4 to correct a typo in the display_name key
📝 docs(custom-component.mdx): update rule 4 to provide additional details on the options and multiline keys in the build_config method
📝 docs(custom-component.mdx): add example for creating a FlowRunner component
📝 docs(custom-component.mdx): update example for creating a FlowRunner component to include display_name and description attributes
📝 docs(custom-component.mdx): update example for creating a FlowRunner component to import Document from the schema module
📝 docs(custom-component.mdx): update example for creating a FlowRunner component to add parameters and return type to the build method
✨ feat(types.py): add support for advanced field configuration in add_new_custom_field function
🐛 fix(types.py): fix issue with incorrect assignment of field_advanced variable in add_code_field function
✨ feat(types.py): add support for advanced field configuration in add_code_field function
🐛 fix(types.py): fix issue with incorrect sorting of function_args in add_extra_fields function
✨ feat(types.py): add sorting of function_args in add_extra_fields function
🐛 fix(types.py): fix issue with incorrect usage of field_config in add_code_field function
✨ feat(types.py): add support for field_config in add_code_field function
🐛 fix(types.py): fix issue with incorrect usage of field_config in build_langchain_template_custom_component function
✨ feat(types.py): add support for field_config in build_langchain_template_custom_component function
- The code changes renamed the file `widget.mdx` to `chat-widget.mdx`.
- The content has been modified to reflect the new name and provide a more detailed description of the Langflow Chat Widget.
- The usage instructions have been updated to reflect the changes.
This commit renames `widget.mdx` to `chat-widget.mdx` and provides more detailed information about the Langflow Chat Widget, including its features, usage in HTML, React, and Angular, and customization options.
🔧 chore(api.tsx): add logic to exclude certain URLs from error retries in the ApiInterceptor component to improve error handling
🔧 chore(index.ts): update postCustomComponent function to use the api instance instead of axios for consistency and reusability
🔀 refactor(custom_component.py): add optional `tweaks` parameter to `load_flow` method to allow for processing tweaks on the graph data
🔀 refactor(custom_component.py): rename `data_graph` variable to `graph_data` for consistency and clarity
🔀 refactor(custom_component.py): add logic to process tweaks on the `graph_data` if `tweaks` parameter is provided
✨ feat(custom-component.mdx): add example code for creating a custom component
🔧 chore(custom-component.mdx): update code comments and fix typo in build_config method
🔧 fix(constants.py): update import statement for CustomComponent to reflect new location
🔧 fix(constants.py): update field_config to build_config to match changes in CustomComponent class
🔧 fix(constants.py): update build method signature to match changes in CustomComponent class
📝 docs(widget.mdx): provide example code for adding the 'langflow-chat' tag with necessary attributes to include the Chat Widget in the component's view