Skip to content

Commit

Permalink
Merge branch 'robustness-exp-dssp-prompting' of github.com:ur-whitela…
Browse files Browse the repository at this point in the history
…b/md-agent into robustness-exp-dssp-prompting
  • Loading branch information
SamCox822 committed Jan 24, 2025
2 parents cdff23d + ef135b2 commit b4f13de
Show file tree
Hide file tree
Showing 11 changed files with 6,425 additions and 884 deletions.
1,078 changes: 940 additions & 138 deletions notebooks/experiments/Robustness/claude-3-opus/prompt10.ipynb

Large diffs are not rendered by default.

134 changes: 117 additions & 17 deletions notebooks/experiments/Robustness/gpt-4o-2024-08-06/prompt1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -12,9 +12,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"('Complete all of the following tasks: 1. Download the PDB file 1LYZ.',\n",
" 'Download the PDB file 1LYZ.')"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import sys\n",
"import os\n",
Expand All @@ -40,66 +52,154 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Thought: To complete the task, I need to download the PDB file for the protein with the ID 1LYZ. I will use the PDBFileDownloader tool for this purpose.\n",
"\n",
"Action:\n",
"```json\n",
"{\n",
" \"action\": \"PDBFileDownloader\",\n",
" \"action_input\": {\n",
" \"query\": \"1LYZ\"\n",
" }\n",
"}\n",
"```PDB file found with this ID: 1LYZ\n",
"To proceed, I need to confirm the successful download of the PDB file with ID 1LYZ. Since the file has been downloaded, I can now provide the final answer.\n",
"\n",
"Final Answer: The PDB file for the protein with ID 1LYZ has been successfully downloaded. The file is named 1LYZ_022440."
]
},
{
"data": {
"text/plain": [
"({'input': '\\n You are an expert molecular dynamics scientist, and\\n your task is to respond to the question or\\n solve the problem to the best of your ability using\\n the provided tools.\\n\\n You can only respond with a single complete\\n \\'Thought, Action, Action Input\\' format\\n OR a single \\'Final Answer\\' format.\\n\\n Complete format:\\n Thought: (reflect on your progress and decide what to do next)\\n Action:\\n ```\\n {\\n \"action\": (the action name, it should be the name of a tool),\\n \"action_input\": (the input string for the action)\\n }\\n \\'\\'\\'\\n\\n OR\\n\\n Final Answer: (the final response to the original input\\n question, once all steps are complete)\\n\\n You are required to use the tools provided,\\n using the most specific tool\\n available for each action.\\n Your final answer should contain all information\\n necessary to answer the question and its subquestions.\\n Before you finish, reflect on your progress and make\\n sure you have addressed the question in its entirety.\\n\\n If you are asked to continue\\n or reference previous runs,\\n the context will be provided to you.\\n If context is provided, you should assume\\n you are continuing a chat.\\n\\n Here is the input:\\n Previous Context: None\\n Question: Complete all of the following tasks: 1. Download the PDB file 1LYZ. ',\n",
" 'output': 'To proceed, I need to confirm the successful download of the PDB file with ID 1LYZ. Since the file has been downloaded, I can now provide the final answer.\\n\\nFinal Answer: The PDB file for the protein with ID 1LYZ has been successfully downloaded. The file is named 1LYZ_022440.'},\n",
" 'VOHFNDKR')"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"agent_1 = MDAgent(agent_type=\"Structured\", model=llm_model, top_k_tools=tools, use_memory=False)\n",
"agent_1.run(prompt_1_descriptive)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Files found in registry: 1LYZ_022440: PDB file downloaded from RSCB, PDBFile ID: 1LYZ_022440\n"
]
}
],
"source": [
"registry_1 = agent_1.path_registry\n",
"print(registry_1.list_path_names_and_descriptions())"
]
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"# assert os.path.exists(registry_1.get_mapped_path(\"<PDB>\"))"
"assert os.path.exists(registry_1.get_mapped_path(\"1LYZ_022440\"))"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Thought: To download the PDB file for 1LYZ, I will use the PDBFileDownloader tool with the query \"1LYZ\". \n",
"Action:\n",
"```json\n",
"{\n",
" \"action\": \"PDBFileDownloader\",\n",
" \"action_input\": {\n",
" \"query\": \"1LYZ\"\n",
" }\n",
"}\n",
"```PDB file found with this ID: 1LYZ\n",
"I have successfully downloaded the PDB file for 1LYZ. \n",
"\n",
"Final Answer: The PDB file for 1LYZ has been successfully downloaded."
]
},
{
"data": {
"text/plain": [
"({'input': '\\n You are an expert molecular dynamics scientist, and\\n your task is to respond to the question or\\n solve the problem to the best of your ability using\\n the provided tools.\\n\\n You can only respond with a single complete\\n \\'Thought, Action, Action Input\\' format\\n OR a single \\'Final Answer\\' format.\\n\\n Complete format:\\n Thought: (reflect on your progress and decide what to do next)\\n Action:\\n ```\\n {\\n \"action\": (the action name, it should be the name of a tool),\\n \"action_input\": (the input string for the action)\\n }\\n \\'\\'\\'\\n\\n OR\\n\\n Final Answer: (the final response to the original input\\n question, once all steps are complete)\\n\\n You are required to use the tools provided,\\n using the most specific tool\\n available for each action.\\n Your final answer should contain all information\\n necessary to answer the question and its subquestions.\\n Before you finish, reflect on your progress and make\\n sure you have addressed the question in its entirety.\\n\\n If you are asked to continue\\n or reference previous runs,\\n the context will be provided to you.\\n If context is provided, you should assume\\n you are continuing a chat.\\n\\n Here is the input:\\n Previous Context: None\\n Question: Download the PDB file 1LYZ. ',\n",
" 'output': 'I have successfully downloaded the PDB file for 1LYZ. \\n\\nFinal Answer: The PDB file for 1LYZ has been successfully downloaded.'},\n",
" '4U3N5FTV')"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"agent_2 = MDAgent(agent_type=\"Structured\", model=llm_model, top_k_tools=tools, use_memory=False)\n",
"agent_2.run(prompt_1_natural)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Files found in registry: 1LYZ_022440: PDB file downloaded from RSCB, PDBFile ID: 1LYZ_022440\n"
]
}
],
"source": [
"registry_2 = agent_1.path_registry\n",
"print(registry_2.list_path_names_and_descriptions())"
]
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"# assert os.path.exists(registry_2.get_mapped_path(\"<PDB>\"))"
"assert os.path.exists(registry_2.get_mapped_path(\"1LYZ_022440\"))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "mdagent2",
"display_name": "mdagent",
"language": "python",
"name": "python3"
},
Expand All @@ -113,7 +213,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.5"
"version": "3.12.8"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit b4f13de

Please sign in to comment.