huggingface / chat-ui

Open source codebase powering the HuggingChat app
https://huggingface.co/chat
Apache License 2.0
7.31k stars 1.06k forks source link

Community tools #1250

Closed nsarrazin closed 1 month ago

nsarrazin commented 3 months ago

Community tools

Features

[!IMPORTANT] The feature is currently feature flagged, so your user in the db must have isEarlyAccess: true in order to see any part of the feature. This will let us test in production internally before releasing to the public. See #1365 for more details

Screenshots

Main window

Screenshot from 2024-07-31 16-27-56

/tools page

Screenshot from 2024-07-31 16-36-10

/tools/[toolId] page

Screenshot from 2024-07-31 16-34-51

New tool/ tool edit form

Screenshot from 2024-07-31 16-34-43

nsarrazin commented 2 months ago

Overall this should be good to go @gary149, the feature is fully hidden behind a feature flag so we can deploy & test internally for now

mishig25 commented 1 month ago

First round of review on UX:

  1. filter by name is not working. For example, you can go to URL http://localhost:5173/chat/tools?sort=trending&q=parser where I expect the tools that only have substring parser in their name to be present. But all the tools are present. image

  2. On medium sized screen, tool titles that are long like Image Generation get cut image

  3. There should be limit on tool name and tool description

    image
  4. when a space does not have a function that can be called as a tool, we should show a label that says: Space does not have a callable function. Example you can try with is: predatortoabuse/Realistic-Image-Generator-Model image

  5. durin toolmcreation, save btn should be disabled until all the fields are valid (i.e. have values)

    image
  6. I can enter string into float values. I guess we should not ? image

  7. cancel btn in tools should go back to previous page. Right now, it is redirecting to homepage image

nsarrazin commented 1 month ago

Overall I think I should improve the inputs in the tool creation form. Use number input fields for Int and Float types, a checkbox for boolean types and a radio with a list of options for Literal['optionA', 'optionB'] types. That should cover 99% of input types. Will tackle this

nsarrazin commented 1 month ago

@mishig25 I implemented your feedback, should be better now!

I also refactored the input selection field for default values, it now only accepts floats for float inputs, integers for int inputs, shows a checkbox for boolean selection and a dropdown select for Literal types with multiple choices

nsarrazin commented 1 month ago

Going to merge this, since we have feature flags so it will be invisible to everyone and I can ensure everything is working well in prod.