otto8-ai / otto8

Open source AI Agent Platform
Apache License 2.0
8 stars 9 forks source link

Excel Tool - Provide a way to create cells with formula. #124

Open sangee2004 opened 1 month ago

sangee2004 commented 1 month ago

Steps to reproduce the problem:

1.Create an agent with github.com/gptscript-ai/tools/apis/excel/write

  1. Chat with this agent and ask it to open an excel file with following format - mypay55.xlsx

  2. Once it provides the details from this xlsheet, ask to Add a new row with values for Gross Pay and Net Pay to be the total of corresponding column values from all the pervious rows

Notice that new rows with total gets added but is incorrect since the LLM's calculation is not acqurate. In this case , we should have support for tools that would allow us to create cells with formulas which will result in excel doing the right calculations.

cjellick commented 1 month ago

Can you retest this with a better prompt that makes it clear you want it to write a formula?

cjellick commented 1 month ago

(see my comment in the similar issue opened for google sheets)

sangee2004 commented 2 weeks ago

I tried to create a new column which is a difference of existing 2 columns. The cell values got evaluated as expected , but it got created as new set of rows instead of appending a column to the existing rows.

Following is the content of the xlsheet: Image

Asked to create a new column which is a difference of existing 2 columns. Image

Content of xlsheet after update ( Rows from 26 are newly added rows)

Image

Debug calls - calls (63).json

sangee2004 commented 2 weeks ago

With prompt being changed to create a new column "difference" as the difference between "GrossPay" and "NetPay" and add it all existing rows , i am able to get it to append columns to the existing rows.

In this case, I still see updateCellInSpreadsheet being called multiple times (as many rows to update) which would mean that the actual calculation is still done my the LLM and not the Excel tool.

Is there a way for me to create a cell with a formula ?

Debug call - calls (64).json

sangee2004 commented 2 weeks ago

Tried with - Create a column "Take Home" as a formula that subtracts "Gross Pay" and "Net pay" and add it to all existing rows

This results in new rows being added and formula not being used

Debug logs - calls (67).json

cjellick commented 1 week ago

this feels like a mess. we might need to be more restrictive in what you can do with the spreadsheet tools