Skip to content

Commit

Permalink
robustness experiment opus nbs
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCox822 committed Nov 1, 2024
1 parent cb88c48 commit b67d324
Show file tree
Hide file tree
Showing 10 changed files with 7,117 additions and 0 deletions.
194 changes: 194 additions & 0 deletions notebooks/experiments/Robustness/claude-3-opus/prompt1.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from mdagent import MDAgent"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"descriptive_prompt_1 = \"Complete all of the following tasks: 1. Download the PDB file 1LYZ.\"\n",
"non_descriptive_prompt_1 = \"Download the PDB file 1LYZ.\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Required Tasks:\n",
"- Download"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"llm_model = \"claude-3-opus-20240229\"\n",
"tools = \"all\""
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Thought: To download the PDB file 1LYZ, I can use the PDBFileDownloader tool.\n",
"\n",
"Action:\n",
"```\n",
"{\n",
" \"action\": \"PDBFileDownloader\",\n",
" \"action_input\": \"1LYZ\"\n",
"}\n",
"```\n",
"\n",
"PDB file found with this ID: 1LYZ\n",
"Action:\n",
"```\n",
"{\n",
" \"action\": \"Final Answer\",\n",
" \"action_input\": \"I have successfully downloaded the PDB file 1LYZ using the PDBFileDownloader tool. The file ID is 1LYZ_204045. This completes the task of downloading the 1LYZ PDB file.\"\n",
"}\n",
"```"
]
},
{
"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': 'I have successfully downloaded the PDB file 1LYZ using the PDBFileDownloader tool. The file ID is 1LYZ_204045. This completes the task of downloading the 1LYZ PDB file.'},\n",
" 'FRH2BAIN')"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"agent_1 = MDAgent(agent_type=\"Structured\", model=llm_model, top_k_tools=tools)\n",
"agent_1.run(descriptive_prompt_1)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Files found in registry: 1LYZ_204045: PDB file downloaded from RSCB, PDBFile ID: 1LYZ_204045\n"
]
}
],
"source": [
"registry = agent_1.path_registry\n",
"print(registry.list_path_names_and_descriptions())"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Thought: To download the PDB file 1LYZ, I can use the PDBFileDownloader tool and provide the PDB ID as input.\n",
"\n",
"Action:\n",
"```\n",
"{\n",
" \"action\": \"PDBFileDownloader\",\n",
" \"action_input\": \"1LYZ\"\n",
"}\n",
"```\n",
"\n",
"PDB file found with this ID: 1LYZ\n",
"I have successfully downloaded the PDB file 1LYZ using the PDBFileDownloader tool. No further actions are needed.\n",
"\n",
"Action:\n",
"```\n",
"{\n",
" \"action\": \"Final Answer\",\n",
" \"action_input\": \"I have downloaded the PDB file 1LYZ using the PDBFileDownloader tool. The file ID is 1LYZ_204058.\"\n",
"}\n",
"```"
]
},
{
"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 downloaded the PDB file 1LYZ using the PDBFileDownloader tool. The file ID is 1LYZ_204058.'},\n",
" '74UNVYZJ')"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"agent_2 = MDAgent(agent_type=\"Structured\", model=llm_model, top_k_tools=tools)\n",
"agent_2.run(non_descriptive_prompt_1)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Files found in registry: 1LYZ_204045: PDB file downloaded from RSCB, PDBFile ID: 1LYZ_204045\n"
]
}
],
"source": [
"registry = agent_1.path_registry\n",
"print(registry.list_path_names_and_descriptions())"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "mdagent2",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit b67d324

Please sign in to comment.