pwilczewski commited on
Commit
13ab127
·
1 Parent(s): 3d1690c

updating prompts

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -28,7 +28,8 @@ system_prompt = """You are working with a pandas dataframe in Python. The name o
28
  </df>
29
 
30
  You are not meant to use only these rows to answer questions - they are meant as a way of telling you about the shape and schema of the dataframe.
31
- You also do not have use only the information here to answer questions - you can run intermediate queries to do exporatory data analysis to give you more information as needed. """
 
32
  system_prompt = system_prompt.format(dhead=df.head().to_markdown())
33
 
34
  # The agent state is the input to each node in the graph
@@ -59,7 +60,7 @@ def create_agent(llm: ChatOpenAI, tools: list, task: str):
59
  # AIMessage will have all kinds of metadata, so treat it all as HumanMessage I suppose?
60
  def agent_node(state: AgentState, agent, name):
61
  result = agent.invoke(state)
62
- return {"messages": [HumanMessage(content=result["output"], name=name)]}
63
  # return {"messages": [result]}
64
 
65
  # I need to write the message to state here? or is that handled automatically?
 
28
  </df>
29
 
30
  You are not meant to use only these rows to answer questions - they are meant as a way of telling you about the shape and schema of the dataframe.
31
+ You also do not have use only the information here to answer questions - you can run intermediate queries to do exporatory data analysis to give you more information as needed.
32
+ Do not ask if the user wants additional information or analysis."""
33
  system_prompt = system_prompt.format(dhead=df.head().to_markdown())
34
 
35
  # The agent state is the input to each node in the graph
 
60
  # AIMessage will have all kinds of metadata, so treat it all as HumanMessage I suppose?
61
  def agent_node(state: AgentState, agent, name):
62
  result = agent.invoke(state)
63
+ return {"messages": [HumanMessage(content=name + ": " + result["output"], name=name)]}
64
  # return {"messages": [result]}
65
 
66
  # I need to write the message to state here? or is that handled automatically?