Yvann commited on
Commit
9a2d407
·
1 Parent(s): 99ece80

add max_iterations for csv agent

Browse files
Files changed (2) hide show
  1. src/chatbot_csv.py +2 -2
  2. src/modules/layout.py +1 -1
src/chatbot_csv.py CHANGED
@@ -59,9 +59,9 @@ def main():
59
  history.generate_messages(response_container)
60
 
61
  if st.session_state["show_csv_agent"]:
62
- query = st.text_input(label="Use CSV agent for precise information about the CSV file itself")
63
  if query != "":
64
- agent = create_csv_agent(ChatOpenAI(temperature=0), uploaded_file_content, verbose=True)
65
  st.write(agent.run(query))
66
  except Exception as e:
67
  st.error(f"Error: {str(e)}")
 
59
  history.generate_messages(response_container)
60
 
61
  if st.session_state["show_csv_agent"]:
62
+ query = st.text_input(label="Use CSV agent for precise information about the structure of your csv file")
63
  if query != "":
64
+ agent = create_csv_agent(ChatOpenAI(temperature=0), uploaded_file_content, verbose=True, max_iterations=4)
65
  st.write(agent.run(query))
66
  except Exception as e:
67
  st.error(f"Error: {str(e)}")
src/modules/layout.py CHANGED
@@ -9,7 +9,7 @@ class Layout:
9
  """
10
  st.markdown(
11
  """
12
- <h1 style='text-align: center;'>ChatBot-CSV, Talk with the content of your csv data! 💬</h1>
13
  """,
14
  unsafe_allow_html=True,
15
  )
 
9
  """
10
  st.markdown(
11
  """
12
+ <h1 style='text-align: center;'>ChatBot-CSV, Talk with your csv data! 💬</h1>
13
  """,
14
  unsafe_allow_html=True,
15
  )