79112476

Date: 2024-10-22 04:52:58
Score: 6 🚩
Natty: 5
Report link

I'm getting the same issue with create_pandas_dataframe_agent:


from langchain_experimental.agents import create_pandas_dataframe_agent
from langchain.agents.agent_types import AgentType

agent = create_pandas_dataframe_agent(
    llm,
    df_chart,
    verbose=True,
    allow_dangerous_code=True,
    agent_type="zero-shot-react-description",
    include_df_in_prompt=True,
    number_of_head_rows=5
)


agent.invoke("what is the combined remaining balance of patient 3 and patient 39?")



> Entering new AgentExecutor chain...
Thought: I need to find the remaining balance of patient 3 and patient 38 in the dataframe.
Action: python_repl_ast
Action Input: `df.loc[df['Patient Name'] == 'Patient_3', 'Balance Remaining'].values[0]`
ObservSyntaxError: invalid syntax (<unknown>, line 1)The error message indicates that there is a syntax error in the code. Upon reviewing the code, I notice that the column name is actually 'Balance Remaining', not 'Balance'. I will correct the code.

output is causing the input line to have a newline then followed by the word "Observ". It seems like a problem with the embedded system prompt but how do you change this???

Reasons:
  • Blacklisted phrase (0.5): I need
  • Blacklisted phrase (1): how do you
  • Blacklisted phrase (1): ???
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): I'm getting the same issue
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: texasdave