langflow icon indicating copy to clipboard operation
langflow copied to clipboard

feat: Table Input for tools metadata (tool name and description) in component as tools

Open edwinjosechittilappilly opened this issue 3 months ago • 1 comments

Merge to main only after https://github.com/langflow-ai/langflow/pull/4946

This pull request includes several changes to the backend components and workflows. The most important changes focus on enhancing the component tools with metadata handling, and updating various component definitions.

Component Tools Enhancements:

  • Updated ComponentToolkit class in src/backend/base/langflow/base/tools/component_tool.py to include metadata handling for tools. Added a new method update_tools_metadata to update tool names and descriptions based on provided metadata. [1] [2]
  • Introduced a new constant TOOLS_METADATA_INPUT_NAME in src/backend/base/langflow/base/tools/constants.py.

Component Definitions Updates:

  • Added an icon attribute to the SQLDatabaseComponent class in src/backend/base/langflow/components/langchain_utilities/sql_database.py.
  • Replaced FloatInput with SliderInput for the temperature field in OpenAIModelComponent class in src/backend/base/langflow/components/models/openai.py.

Custom Component Enhancements:

  • Updated run_and_validate_update_outputs method in src/backend/base/langflow/custom/custom_component/component.py to handle tool metadata input.
  • Modified to_toolkit method to update tools metadata if available. Added a new method _build_tools_metadata_input to build tool metadata input. [1] [2]

edwinjosechittilappilly avatar Nov 29 '24 21:11 edwinjosechittilappilly