diff --git a/nmdc_ontology/mixs_environments_extensions_to_envo_envirnmental_materials_by_claude.py b/nmdc_ontology/mixs_environments_extensions_to_envo_envirnmental_materials_by_claude.py index 8e9bada..d2df64e 100644 --- a/nmdc_ontology/mixs_environments_extensions_to_envo_envirnmental_materials_by_claude.py +++ b/nmdc_ontology/mixs_environments_extensions_to_envo_envirnmental_materials_by_claude.py @@ -3,8 +3,14 @@ from anthropic import Anthropic -# Set up the Anthropic API client +from dotenv import load_dotenv + +load_dotenv("../local/.env") + api_key = os.environ["ANTHROPIC_API_KEY"] + +# Set up the Anthropic API client +# api_key = os.environ["ANTHROPIC_API_KEY"] MODEL_NAME = "claude-3-opus-20240229" client = Anthropic(api_key=api_key) @@ -35,9 +41,11 @@ def get_completion(client, prompt): completion = get_completion(client, f"""Here are the definitions of environments, according to MIxS: {mixs_environments} and the definitions of environmental materials, according to EnvO: {envo_materials}. -Generate an exhasutive YAML-formatted report of all environmental materials that could reasonalby be found in the Soil environment. +Generate an exhaustive YAML-formatted report of all environmental materials +that could reasonably be found in the Soil environment. When associating an environmental material with an environment, -report both the environmental material id and the environmental material label for every associated environmental material. +report both the environmental material id +and the environmental material label for every associated environmental material. """ ) diff --git a/poetry.lock b/poetry.lock index a2327b2..e10282c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2142,6 +2142,20 @@ files = [ [package.dependencies] six = ">=1.5" +[[package]] +name = "python-dotenv" +version = "1.0.1" +description = "Read key-value pairs from a .env file and set them as environment variables" +optional = false +python-versions = ">=3.8" +files = [ + {file = "python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"}, + {file = "python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a"}, +] + +[package.extras] +cli = ["click (>=5.0)"] + [[package]] name = "pytrie" version = "0.4.0" @@ -3343,4 +3357,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "d9441720a39010428ac0167bf8b24a47dea68d8d222367827807c55a0ca50ebb" +content-hash = "8459450b9ef059b1b14cb83f6dd6c370aa1530fc55cda20db65a843b1f3a2fa4" diff --git a/pyproject.toml b/pyproject.toml index ad5bcf8..340fb31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,7 @@ python = "^3.10" oaklib = "^0.5.25" pyarrow = "^15.0.0" anthropic = "^0.21.1" +python-dotenv = "^1.0.1" [build-system] requires = ["poetry-core"]