Skip to content

Commit f6b4349

Browse files
committed
more temp templates
1 parent e51e090 commit f6b4349

50 files changed

Lines changed: 8255 additions & 19 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

notebooks/experiments/run_stats/run_stats_template/prompt1.ipynb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"from mdcrow import MDCrow\n",
1010
"from langchain.callbacks import get_openai_callback\n",
1111
"from datetime import datetime\n",
12-
"import os"
12+
"import os\n",
13+
"import traceback"
1314
]
1415
},
1516
{
@@ -49,14 +50,19 @@
4950
" top_k_tools=tools, \n",
5051
" use_memory=False,\n",
5152
" streaming=False,\n",
52-
" verbose=True\n",
53+
" verbose=True,\n",
5354
")\n",
5455
"with get_openai_callback() as cb:\n",
5556
" chat_start = datetime.now()\n",
56-
" response = agent.run(prompt_1_natural, callbacks=[cb])\n",
57+
" try:\n",
58+
" response = agent.run(prompt_1_natural, callbacks=[cb])\n",
59+
" print(response)\n",
60+
" except Exception as e:\n",
61+
" exc_type, exc_value, exc_traceback = sys.exc_info()\n",
62+
" print(f'{type(e).__name__}:{e}')\n",
63+
" print(\"\".join(traceback.format_exception(exc_type, exc_value, exc_traceback)))\n",
5764
" chat_end = datetime.now()\n",
5865
" total_runtime = (chat_end - chat_start).total_seconds()\n",
59-
" print(response)\n",
6066
" print(cb)\n",
6167
" print(f\"Total runtime: {total_runtime:.2f}s\")"
6268
]

notebooks/experiments/run_stats/run_stats_template/prompt10.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@
5757
" chat_start = datetime.now()\n",
5858
" try:\n",
5959
" response = agent.run(prompt_10_natural, callbacks=[cb])\n",
60+
" print(response)\n",
6061
" except Exception as e:\n",
6162
" exc_type, exc_value, exc_traceback = sys.exc_info()\n",
6263
" print(f'{type(e).__name__}:{e}')\n",
6364
" print(\"\".join(traceback.format_exception(exc_type, exc_value, exc_traceback)))\n",
6465
" chat_end = datetime.now()\n",
6566
" total_runtime = (chat_end - chat_start).total_seconds()\n",
66-
" print(response)\n",
6767
" print(cb)\n",
6868
" print(f\"Total runtime: {total_runtime:.2f}s\")"
6969
]

notebooks/experiments/run_stats/run_stats_template/prompt2.ipynb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"source": [
99
"from mdcrow import MDCrow\n",
1010
"from langchain.callbacks import get_openai_callback\n",
11-
"from datetime import datetime"
11+
"from datetime import datetime\n",
12+
"import traceback"
1213
]
1314
},
1415
{
@@ -54,10 +55,15 @@
5455
")\n",
5556
"with get_openai_callback() as cb:\n",
5657
" chat_start = datetime.now()\n",
57-
" response = agent.run(prompt_2_natural, callbacks=[cb])\n",
58+
" try:\n",
59+
" response = agent.run(prompt_2_natural, callbacks=[cb])\n",
60+
" print(response)\n",
61+
" except Exception as e:\n",
62+
" exc_type, exc_value, exc_traceback = sys.exc_info()\n",
63+
" print(f'{type(e).__name__}:{e}')\n",
64+
" print(\"\".join(traceback.format_exception(exc_type, exc_value, exc_traceback)))\n",
5865
" chat_end = datetime.now()\n",
5966
" total_runtime = (chat_end - chat_start).total_seconds()\n",
60-
" print(response)\n",
6167
" print(cb)\n",
6268
" print(f\"Total runtime: {total_runtime:.2f}s\")"
6369
]

notebooks/experiments/run_stats/run_stats_template/prompt3.ipynb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"from mdcrow import MDCrow\n",
1010
"from langchain.callbacks import get_openai_callback\n",
1111
"from datetime import datetime\n",
12-
"import os "
12+
"import os \n",
13+
"import traceback"
1314
]
1415
},
1516
{
@@ -54,10 +55,15 @@
5455
")\n",
5556
"with get_openai_callback() as cb:\n",
5657
" chat_start = datetime.now()\n",
57-
" response = agent.run(prompt_3_natural, callbacks=[cb])\n",
58+
" try:\n",
59+
" response = agent.run(prompt_3_natural, callbacks=[cb])\n",
60+
" print(response)\n",
61+
" except Exception as e:\n",
62+
" exc_type, exc_value, exc_traceback = sys.exc_info()\n",
63+
" print(f'{type(e).__name__}:{e}')\n",
64+
" print(\"\".join(traceback.format_exception(exc_type, exc_value, exc_traceback)))\n",
5865
" chat_end = datetime.now()\n",
5966
" total_runtime = (chat_end - chat_start).total_seconds()\n",
60-
" print(response)\n",
6167
" print(cb)\n",
6268
" print(f\"Total runtime: {total_runtime:.2f}s\")"
6369
]

notebooks/experiments/run_stats/run_stats_template/prompt4.ipynb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"from mdcrow import MDCrow\n",
1010
"from langchain.callbacks import get_openai_callback\n",
1111
"from datetime import datetime\n",
12-
"import os "
12+
"import os \n",
13+
"import traceback"
1314
]
1415
},
1516
{
@@ -54,10 +55,15 @@
5455
")\n",
5556
"with get_openai_callback() as cb:\n",
5657
" chat_start = datetime.now()\n",
57-
" response = agent.run(prompt_4_natural, callbacks=[cb])\n",
58+
" try:\n",
59+
" response = agent.run(prompt_4_natural, callbacks=[cb])\n",
60+
" print(response)\n",
61+
" except Exception as e:\n",
62+
" exc_type, exc_value, exc_traceback = sys.exc_info()\n",
63+
" print(f'{type(e).__name__}:{e}')\n",
64+
" print(\"\".join(traceback.format_exception(exc_type, exc_value, exc_traceback)))\n",
5865
" chat_end = datetime.now()\n",
5966
" total_runtime = (chat_end - chat_start).total_seconds()\n",
60-
" print(response)\n",
6167
" print(cb)\n",
6268
" print(f\"Total runtime: {total_runtime:.2f}s\")"
6369
]

notebooks/experiments/run_stats/run_stats_template/prompt5.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@
5757
" chat_start = datetime.now()\n",
5858
" try:\n",
5959
" response = agent.run(prompt_5_natural, callbacks=[cb])\n",
60+
" print(response)\n",
6061
" except Exception as e:\n",
6162
" exc_type, exc_value, exc_traceback = sys.exc_info()\n",
6263
" print(f'{type(e).__name__}:{e}')\n",
6364
" print(\"\".join(traceback.format_exception(exc_type, exc_value, exc_traceback)))\n",
6465
" chat_end = datetime.now()\n",
6566
" total_runtime = (chat_end - chat_start).total_seconds()\n",
66-
" print(response)\n",
6767
" print(cb)\n",
6868
" print(f\"Total runtime: {total_runtime:.2f}s\")"
6969
]

notebooks/experiments/run_stats/run_stats_template/prompt6.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@
5757
" chat_start = datetime.now()\n",
5858
" try:\n",
5959
" response = agent.run(prompt_6_natural, callbacks=[cb])\n",
60+
" print(response)\n",
6061
" except Exception as e:\n",
6162
" exc_type, exc_value, exc_traceback = sys.exc_info()\n",
6263
" print(f'{type(e).__name__}:{e}')\n",
6364
" print(\"\".join(traceback.format_exception(exc_type, exc_value, exc_traceback)))\n",
6465
" chat_end = datetime.now()\n",
6566
" total_runtime = (chat_end - chat_start).total_seconds()\n",
66-
" print(response)\n",
6767
" print(cb)\n",
6868
" print(f\"Total runtime: {total_runtime:.2f}s\")"
6969
]

notebooks/experiments/run_stats/run_stats_template/prompt7.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@
5757
" chat_start = datetime.now()\n",
5858
" try:\n",
5959
" response = agent.run(prompt_7_natural, callbacks=[cb])\n",
60+
" print(response)\n",
6061
" except Exception as e:\n",
6162
" exc_type, exc_value, exc_traceback = sys.exc_info()\n",
6263
" print(f'{type(e).__name__}:{e}')\n",
6364
" print(\"\".join(traceback.format_exception(exc_type, exc_value, exc_traceback)))\n",
6465
" chat_end = datetime.now()\n",
6566
" total_runtime = (chat_end - chat_start).total_seconds()\n",
66-
" print(response)\n",
6767
" print(cb)\n",
6868
" print(f\"Total runtime: {total_runtime:.2f}s\")"
6969
]

notebooks/experiments/run_stats/run_stats_template/prompt8.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@
5757
" chat_start = datetime.now()\n",
5858
" try:\n",
5959
" response = agent.run(prompt_8_natural, callbacks=[cb])\n",
60+
" print(response)\n",
6061
" except Exception as e:\n",
6162
" exc_type, exc_value, exc_traceback = sys.exc_info()\n",
6263
" print(f'{type(e).__name__}:{e}')\n",
6364
" print(\"\".join(traceback.format_exception(exc_type, exc_value, exc_traceback)))\n",
6465
" chat_end = datetime.now()\n",
6566
" total_runtime = (chat_end - chat_start).total_seconds()\n",
66-
" print(response)\n",
6767
" print(cb)\n",
6868
" print(f\"Total runtime: {total_runtime:.2f}s\")"
6969
]

notebooks/experiments/run_stats/run_stats_template/prompt9.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@
5757
" chat_start = datetime.now()\n",
5858
" try:\n",
5959
" response = agent.run(prompt_9_natural, callbacks=[cb])\n",
60+
" print(response)\n",
6061
" except Exception as e:\n",
6162
" exc_type, exc_value, exc_traceback = sys.exc_info()\n",
6263
" print(f'{type(e).__name__}:{e}')\n",
6364
" print(\"\".join(traceback.format_exception(exc_type, exc_value, exc_traceback)))\n",
6465
" chat_end = datetime.now()\n",
6566
" total_runtime = (chat_end - chat_start).total_seconds()\n",
66-
" print(response)\n",
6767
" print(cb)\n",
6868
" print(f\"Total runtime: {total_runtime:.2f}s\")"
6969
]

0 commit comments

Comments
 (0)