codeinterpreter-api icon indicating copy to clipboard operation
codeinterpreter-api copied to clipboard

BUG: the arguments is not valid JSON

Open wenxuan1017 opened this issue 1 year ago • 6 comments

When python code in "arguments", it would post this error.

Error in CodeInterpreterSession: ValueError - An output parsing error occurred. In order to pass this error back to the agent and have it try again, pass handle_parsing_errors=True to the AgentExecutor. This is the error: Could not parse tool input:{'name': 'python', 'arguments': "import pandas as pd\n\n# Read the CSV file\ndf = pd.read_csv('test_table.csv')\n\n# Display the first 10 rows of the table\ndf.head(10)"} because the arguments is not valid JSON.

I used Azure openai api, both gpt-4 and gpt-35-turbo i had tried. langchain==0.0349 could you help me

wenxuan1017 avatar Dec 19 '23 10:12 wenxuan1017

Yep, facing the same issue

jawadchughtai6 avatar Jan 01 '24 11:01 jawadchughtai6

@shroominic Can you please assist with this? Thanks!

jawadchughtai6 avatar Jan 01 '24 11:01 jawadchughtai6

hey not fully sure whats causing this issue but codeinterpreterapi==0.0.14 seems to be more stable

shroominic avatar Jan 04 '24 17:01 shroominic

Not able t run this too same issue :(

macmus82 avatar Jan 22 '24 04:01 macmus82

Same issue.

twiecki avatar Jan 25 '24 01:01 twiecki

I think this is due to deprecated API.

https://github.com/shroominic/codeinterpreter-api/blob/main/src/codeinterpreterapi/_patch_parser.py#L109 overwrites the deprecated OpenAIFunctionsAgent: https://api.python.langchain.com/en/latest/agents/langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent.html#

So the patch just gets ignored. Not sure how this could be fixed however.

twiecki avatar Jan 25 '24 02:01 twiecki