-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
480 additions
and
0 deletions.
There are no files selected for viewing
176 changes: 176 additions & 0 deletions
176
notebooks/experiments/experiment_k1/claude_3_opus/exp_2.ipynb
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,176 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from mdagent import MDAgent" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"prompt2 = \"Download the pdb file for PDB ID 1LYZ.\"\n", | ||
"agent = MDAgent(agent_type=\"Structured\", model=\"claude-3-opus-20240229\", top_k_tools=\"all\", use_memory=False)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.\n" | ||
] | ||
}, | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Num of tokens: 351\n", | ||
"\n", | ||
"\n", | ||
"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n" | ||
] | ||
}, | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...\n", | ||
"To disable this warning, you can either:\n", | ||
"\t- Avoid using `tokenizers` before the fork if possible\n", | ||
"\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n" | ||
] | ||
}, | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Thought: To download the PDB file for 1LYZ, I can use the PDBFileDownloader tool.\n", | ||
"\n", | ||
"Action:\n", | ||
"```\n", | ||
"{\n", | ||
" \"action\": \"PDBFileDownloader\",\n", | ||
" \"action_input\": \"1LYZ\"\n", | ||
"}\n", | ||
"```\n", | ||
"\n", | ||
"\u001b[32;1m\u001b[1;3mThought: To download the PDB file for 1LYZ, I can use the PDBFileDownloader tool.\n", | ||
"\n", | ||
"Action:\n", | ||
"```\n", | ||
"{\n", | ||
" \"action\": \"PDBFileDownloader\",\n", | ||
" \"action_input\": \"1LYZ\"\n", | ||
"}\n", | ||
"```\n", | ||
"\n", | ||
"\u001b[0mPDB file found with this ID: 1LYZ\n" | ||
] | ||
}, | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"2024-08-05 22:48:30.873 \n", | ||
" \u001b[33m\u001b[1mWarning:\u001b[0m to view this Streamlit app on a browser, run it with the following\n", | ||
" command:\n", | ||
"\n", | ||
" streamlit run /opt/anaconda3/envs/mda_jun15/lib/python3.12/site-packages/ipykernel_launcher.py [ARGUMENTS]\n" | ||
] | ||
}, | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"\n", | ||
"Observation: \u001b[38;5;200m\u001b[1;3mSucceeded. Downloaded the PDB file:1LYZ_224831\u001b[0m\n", | ||
"Thought:I have successfully downloaded the PDB file for 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 for the protein with PDB ID 1LYZ. The file has been saved with the ID 1LYZ_224831.\"\n", | ||
"}\n", | ||
"```\u001b[32;1m\u001b[1;3mI have successfully downloaded the PDB file for 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 for the protein with PDB ID 1LYZ. The file has been saved with the ID 1LYZ_224831.\"\n", | ||
"}\n", | ||
"```\u001b[0m\n", | ||
"\n", | ||
"\u001b[1m> Finished chain.\u001b[0m\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: (the action name, should be the name of a tool)\\n Action Input: (the input string to the action)\\n\\n OR\\n\\n Final Answer: (the final response to the original input\\n question, when 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 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 for PDB ID 1LYZ. ',\n", | ||
" 'output': 'I have downloaded the PDB file for the protein with PDB ID 1LYZ. The file has been saved with the ID 1LYZ_224831.'},\n", | ||
" '4NMLS7MI')" | ||
] | ||
}, | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"agent.run(prompt2)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Files found in registry: 1LYZ_224831: PDB file downloaded from RSCB, PDBFile ID: 1LYZ_224831\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"registry = agent.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.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.