Skip to content

CSV agent dose not Actually writing down the code the changing. #23796

Answered by dosubot bot
jeremygan2021 asked this question in Q&A
Discussion options

You must be logged in to vote

To ensure that the changes made by the CSV agent are saved back to the CSV file, you need to write the modified DataFrame back to the CSV file after processing it. Here is an example of how you can modify your script to save the changes back to the CSV file:

import config
import pandas as pd
from langchain_openai import ChatOpenAI
from langchain_core.output_parsers.openai_tools import JsonOutputKeyToolsParser
from langchain_experimental.agents import create_pandas_dataframe_agent
import sys
import os
from tenacity import retry, stop_after_attempt, wait_fixed

sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
BASE_DIR = os.path.dirname(os.path.abspath(__file__))

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jeremygan2021
Comment options

Answer selected by jeremygan2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant