gradio icon indicating copy to clipboard operation
gradio copied to clipboard

Enhancements to tool use in `gr.Chatbot`

Open abidlabs opened this issue 1 year ago • 6 comments

As suggested by @Blaizzy, there are some ways we can improve the tool use display in gr.Chatbot:

  1. Better documentation, outside of LangChain and OpenAI.

  2. I would like to pass the arguments used to the assistant chat component so users can see what was used for the call.

  3. And a way to display parallel calls.

abidlabs avatar Aug 07 '24 16:08 abidlabs

Thanks @abidlabs!

To elaborate on the docs part. It took me 15 min to look through your docs to find anything related to this component.

Then the examples told me nothing about how to use it. I found the solution by looking through the code on a HF space.

https://huggingface.co/spaces/gradio/agent_chatbot/blob/main/utils.py

Blaizzy avatar Aug 08 '24 07:08 Blaizzy

Regarding the arguments, I expect to pass the JSON and have it nicely displayed but instead it displayed the string which is not optimal.

And formatting it into a string can be painful if have multiple arguments or tools with different formatting.

Blaizzy avatar Aug 08 '24 07:08 Blaizzy

Thanks @Blaizzy! cc @freddyaboulton

abidlabs avatar Aug 08 '24 07:08 abidlabs

My pleasure!

Parallel calls is pretty much clear if we solve the first two.

Blaizzy avatar Aug 08 '24 08:08 Blaizzy

@Blaizzy btw regarding docs, did you see this Guide: https://www.gradio.app/guides/agents-and-tool-usage -- was it not sufficient?

abidlabs avatar Aug 09 '24 16:08 abidlabs

I saw it, but it was not very informative on how to do it.

I have my custom library for inferencing Models locally on Apple Silicon that follows the openAI API.

Blaizzy avatar Aug 09 '24 16:08 Blaizzy

Reassigning this issue to you @freddyaboulton as you'll be looking at tool use next week.

abidlabs avatar Dec 06 '24 14:12 abidlabs

I have my custom library for inferencing Models locally on Apple Silicon that follows the openAI API.

@Blaizzy does your library include tool usage? can you share a link?

abidlabs avatar Dec 06 '24 14:12 abidlabs