microsoft / data-formulator

🪄 Create rich visualizations with AI
https://arxiv.org/abs/2408.16119
MIT License
239 stars 13 forks source link

"Formulate Data" does not seem to be working. #26

Closed riikacharya-code closed 3 weeks ago

riikacharya-code commented 1 month ago

I was working with one of the example datasets (movies.csv) and I wanted to create a new custom category: 'percentage_of_gross', by taking the 'US_Gross' and dividing it by the 'Worldwide_Gross' for each data point, but I ended up with this error, which I believe to be a bug:

My prompt was this specifically: Plot 'percentage_of_gross' by taking 'US_Gross' and dividing it by Worldwide_Gross' for each data point

spec------------------------------ [{'name': 'Release_Date'}, {'name': 'percentage_of_gross'}] Plot 'percentage_of_gross' by taking 'US_Gross' and dividing it by Worldwide_Gross' for each data point [2024-09-09 22:31:22,450] ERROR in app: Exception on /derive-data [POST] Traceback (most recent call last): File "/workspaces/data-formulator/venv/lib/python3.12/site-packages/flask/app.py", line 1473, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspaces/data-formulator/venv/lib/python3.12/site-packages/flask/app.py", line 882, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspaces/data-formulator/venv/lib/python3.12/site-packages/flask_cors/extension.py", line 194, in wrapped_function return cors_after_request(app.make_response(f(*args, kwargs))) ^^^^^^^^^^^^^^^^^^ File "/workspaces/data-formulator/venv/lib/python3.12/site-packages/flask/app.py", line 880, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "/workspaces/data-formulator/venv/lib/python3.12/site-packages/flask/app.py", line 865, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspaces/data-formulator/app.py", line 345, in derive_data results = agent.run(input_tables, instruction, [field['name'] for field in new_fields]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspaces/data-formulator/server/agents/agent_data_transform_v2.py", line 273, in run return self.process_gpt_response(input_tables, messages, response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspaces/data-formulator/server/agents/agent_data_transform_v2.py", line 204, in process_gpt_response logger.info(response.prompt_filter_results) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspaces/data-formulator/venv/lib/python3.12/site-packages/pydantic/main.py", line 828, in getattr raise AttributeError(f'{type(self).name!r} object has no attribute {item!r}') AttributeError: 'ChatCompletion' object has no attribute 'prompt_filter_results' 127.0.0.1 - - [09/Sep/2024 22:31:22] "POST /derive-data HTTP/1.1" 500 -

Chenglong-MS commented 3 weeks ago

I realize this could be an openai connection issue, yet the error message is not correctly displaying the issue, working on a fix now.

Chenglong-MS commented 3 weeks ago

fixed per commit https://github.com/microsoft/data-formulator/commit/3b6c53396251090dc94f666f39d11cefb0c7779d.

It should display the correct error message this time.