freddyaboulton / gradio-agentchatbot

Chat with agents 🤖 and see their thoughts 💭
Apache License 2.0
3 stars 1 forks source link

feature request: show tool response #3

Closed Cppowboy closed 2 months ago

Cppowboy commented 2 months ago

Thanks for the great demo. Could you please make the demo show the tool responses?

freddyaboulton commented 2 months ago

We've basically upstreamed this component into gr.Chatbot.

What do you mean by tool responses exactly?

Cppowboy commented 2 months ago

For example, could you show the search result after calling the search tool?

image

not only show "used tool weather", but also show the response of weather api, such as

{"location":{"city":"Sunnyvale","woeid":2502265,"country":"United States","lat":37.371609,"long":-122.038254,"timezone_id":"America/Los_Angeles"},"current_observation":{"pubDate":1725940261,"wind":{"chill":64,"direction":"NW","speed":3},"atmosphere":{"humidity":85,"visibility":10,"pressure":1011.5},"astronomy":{"sunrise":"6:47 AM","sunset":"7:22 PM"},"condition":{"temperature":63,"text":"Clear","code":31}},"forecasts":[{"day":"Mon","date":1725984000,"high":76,"low":56,"text":"Mostly Clear","code":33},{"day":"Tue","date":1726070400,"high":75,"low":56,"text":"Mostly Sunny","code":34},{"day":"Wed","date":1726156800,"high":77,"low":58,"text":"Partly Cloudy","code":30},{"day":"Thu","date":1726243200,"high":79,"low":55,"text":"Mostly Sunny","code":34},{"day":"Fri","date":1726329600,"high":81,"low":56,"text":"Mostly Sunny","code":34},{"day":"Sat","date":1726416000,"high":75,"low":58,"text":"Mostly Sunny","code":34},{"day":"Sun","date":1726502400,"high":72,"low":56,"text":"Sunny","code":32},{"day":"Mon","date":1726588800,"high":68,"low":57,"text":"Partly Cloudy","code":30},{"day":"Tue","date":1726675200,"high":74,"low":58,"text":"Partly Cloudy","code":30},{"day":"Wed","date":1726761600,"high":74,"low":56,"text":"Sunny","code":32},{"day":"Thu","date":1726848000,"high":78,"low":57,"text":"Sunny","code":32}]}
freddyaboulton commented 2 months ago

Hi @Cppowboy - yes you can put the json output in the content field as well.

Cppowboy commented 2 months ago

Hi @Cppowboy - yes you can put the json output in the content field as well.

got it