-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #347 from aitomatic/example-langchain-react-agent
add LangChain ReAct impl to examples/FinanceBench
- Loading branch information
Showing
9 changed files
with
236 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from argparse import ArgumentParser | ||
|
||
from pandas import DataFrame, read_csv | ||
|
||
from data_and_knowledge import FB_ID_COL_NAME, LOCAL_CACHE_DIR_PATH | ||
|
||
|
||
EXPORT_FILE_NAME: str = 'export-multi-runs.csv' | ||
|
||
|
||
arg_parser = ArgumentParser() | ||
arg_parser.add_argument('output_name') | ||
arg_parser.add_argument('output_file_names', nargs='+') | ||
args = arg_parser.parse_args() | ||
|
||
|
||
for i, df in enumerate(read_csv(LOCAL_CACHE_DIR_PATH / output_file_name, index_col=FB_ID_COL_NAME) | ||
for output_file_name in args.output_file_names): | ||
if not i: | ||
export_df: DataFrame = df[['question']] | ||
|
||
export_df.loc[:, f'answer {i + 1}'] = df[args.output_name] # pylint: disable=possibly-used-before-assignment | ||
|
||
|
||
export_df.to_csv(LOCAL_CACHE_DIR_PATH / EXPORT_FILE_NAME, index=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.