diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 513fac0..e58457c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.18.1" + ".": "0.18.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index d2fdcf6..f2f23f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 0.18.2 (2026-11-24) + + +### Bug Fixes + +* **data:** export the stored prompt metadata as PromptMetadata +* **readme:** show the session.models poet calls + +### Deprecations + +* **data:** `openprotein.data.prompts.PromptSummary` and `openprotein.data.prompts.schemas.PromptSummary`: use `openprotein.data.PromptMetadata`. The old name still works, warns with a `FutureWarning`, and is removed in 0.19.0. + ## 0.18.1 (2026-11-24) diff --git a/README.md b/README.md index 839c941..26151f5 100644 --- a/README.md +++ b/README.md @@ -10,19 +10,19 @@ The OpenProtein.AI Python Interface provides a user-friendly library to interact # Table of Contents -| | Workflow | Description | -|---|--------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------| -| 0 | [`Quick start`](#Quick-start) | Quick start guide | -| 1 | [`Installation`](https://docs.openprotein.ai/python-api/installation.html) | Install guide for pip and conda. | -| 2 | [`Session management`](https://docs.openprotein.ai/python-api/index.html) | An overview of the OpenProtein Python Client & the asynchronous jobs system. | -| 3 | [`Property-Regression-Models`](https://docs.openprotein.ai/python-api/property-regression-models/index.html) | Covers core tasks such as data upload, model training & prediction, and sequence design. | -| 4 | [`De Novo prediction & generative models (PoET)`](https://docs.openprotein.ai/python-api/poet/index.html) | Covers PoET, a protein LLM for *de novo* scoring, as well as sequence generation. | -| 5 | [`Foundational models`](https://docs.openprotein.ai/python-api/foundation-models/index.html) | Covers methods for creating sequence embeddings with proprietary & open-source models. | +| | Workflow | Description | +|---|--------------------------------------------------------------------------------|-------------------------------------------------------------------------------| +| 0 | [`Quick start`](#quick-start) | Quick start guide | +| 1 | [`Installation`](#installation) | Install with pip or conda. | +| 2 | [`Python API reference`](https://docs.openprotein.ai/references/python-api/) | Sessions, jobs and every interface in the Python client. | +| 3 | [`Models`](https://docs.openprotein.ai/references/python-api/models/) | Embedding, scoring, generative and structure models, plus GP, SVD and UMAP. | +| 4 | [`PoET`](https://docs.openprotein.ai/references/python-api/models/#poet) | Score and generate sequences conditioned on a protein family. | +| 5 | [`Tutorials`](https://docs.openprotein.ai/tutorials/) | End-to-end workflows. | # Quick-start -Get started with our quickstart README! You can peruse the [official documentation](https://docs.openprotein.ai/python-api/) for more details! +Get started with our quickstart README! You can peruse the [official documentation](https://docs.openprotein.ai/quickstart/) for more details! ## Installation To install the python interface using pip, run the following command: @@ -43,7 +43,7 @@ conda install -c openprotein openprotein-python # Getting started -Read on below for the quick-start guide, or see the [docs](https://docs.openprotein.ai/python-api/) for more information! +Read on below for the quick-start guide, or see the [docs](https://docs.openprotein.ai/references/python-api/) for more information! To begin, create a session using your login credentials. ``` @@ -97,69 +97,63 @@ future.rename(name="my-run", description="baseline model") ``` ### Resuming Jobs -Jobs from prior workflows can be resumed using the load_job method provided by each API. +Jobs from prior workflows can be resumed by loading them by ID. ``` -session.load_job(JOB_ID) # Replace JOB_ID with the ID of the training job to resume +future = session.jobs.get(JOB_ID) # Replace JOB_ID with the ID of the job to resume ``` ## PoET interface -The PoET Interface allows scoring, generating, and retrieving sequences using the PoET model. - -### Scoring Sequences -To score sequences, use the score function. Provide a prompt and a list of queries. The results will be a list of (sequence, score) pydantic objects. +PoET scores and generates sequences conditioned on a prompt, a set of sequences from the protein family. Model handles are on `session.models`. +### Building a Prompt +Create a prompt from sequences you already have, or sample one from an MSA built by homology search. ``` -prompt_seqs = b'MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN' +model = session.models.poet + +seed = "MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN" -prompt = session.poet.upload_prompt(prompt_seqs) +prompt = session.prompt.create_prompt([seed]) + +# or +msa = session.align.create_msa(seed) +prompt = msa.sample_prompt(num_sequences=50) ``` +### Scoring Sequences +To score sequences, use `score` with a list of queries and the prompt. ``` queries = [ - b'MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN', - b'MALWMRLLPLLVLLALWGPDPASAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN', - b'MALWTRLRPLLALLALWPPPPARAFVNQHLCGSHLVEALYLVCGERGFFYTPKARREVEGPQVGALELAGGPGAGGLEGPPQKRGIVEQCCASVCSLYQLENYCN', - b'MALWIRSLPLLALLVFSGPGTSYAAANQHLCGSHLVEALYLVCGERGFFYSPKARRDVEQPLVSSPLRGEAGVLPFQQEEYEKVKRGIVEQCCHNTCSLYQLENYCN', - b'MALWMRLLPLLALLALWAPAPTRAFVNQHLCGSHLVEALYLVCGERGFFYTPKARREVEDLQVRDVELAGAPGEGGLQPLALEGALQKRGIVEQCCTSICSLYQLENYCN', + "MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN", + "MALWMRLLPLLVLLALWGPDPASAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN", + "MALWTRLRPLLALLALWPPPPARAFVNQHLCGSHLVEALYLVCGERGFFYTPKARREVEGPQVGALELAGGPGAGGLEGPPQKRGIVEQCCASVCSLYQLENYCN", ] -``` -``` -future = session.poet.score(prompt, queries) -result = future.wait() -# result is a list of (sequence, score) pydantic objects +future = model.score(queries, prompt=prompt) +scores = future.wait() +# one log-likelihood per query, in the order submitted +# a prompt with several replicates gives one score per replicate ``` ### Scoring Single Site Variants -For scoring single site variants, use the `single_site function`, providing the original sequence and setting `prompt_is_seed` to True if the prompt is a seed sequence. +To score every single-site substitution of a sequence, use `single_site`. ``` -sequence = "MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN" -future = session.poet.single_site(prompt, sequence, prompt_is_seed=True) -result = future.wait() -# result is a dictionary of {variant: score} +future = model.single_site(seed, prompt=prompt) +scores = future.wait() +# one score per substitution, 20 per position: positions in sequence order, +# substitutions in the order of openprotein.utils.sequence.AMINO_ACIDS ``` ### Generating Sequences -To generate sequences from the PoET model, use the `generate` function with relevant parameters. The result will be a list of generated samples. +To sample new sequences from the prompt, use `generate`. ``` -future = session.poet.generate( - prompt, - max_seqs_from_msa=1024, +future = model.generate( + prompt=prompt, num_samples=100, temperature=1.0, - topk=15 + top_k=15, ) -samples = future.wait() -``` - -### Retrieving Input Sequences -You can retrieve the prompt, MSA, or seed sequences for a PoET job using the `get_input` function or the individual functions for each type. -``` -future.get_input(INPUT_TYPE) -# or, functions for each type -future.get_prompt() -future.get_msa() -future.get_seed() +sequences = future.wait() # generated sequences as strings +scores = future.get(output="loglikelihood") # one log-likelihood per sequence ``` See more at our [Homepage](https://docs.openprotein.ai/) diff --git a/openprotein/data/__init__.py b/openprotein/data/__init__.py index f28fe67..85e48c2 100644 --- a/openprotein/data/__init__.py +++ b/openprotein/data/__init__.py @@ -7,7 +7,7 @@ from .assaydataset import Assay, AssayDataset from .data import DataAPI from .msa import MSA, MSAFormat, MSAMetadata -from .prompts import Prompt +from .prompts import Prompt, PromptMetadata from .schemas import AssayDataPage, AssayDataRow, AssayMetadata __all__ = [ @@ -21,4 +21,5 @@ "MSAFormat", "MSAMetadata", "Prompt", + "PromptMetadata", ] diff --git a/openprotein/data/prompts/__init__.py b/openprotein/data/prompts/__init__.py index df40812..ad4a205 100644 --- a/openprotein/data/prompts/__init__.py +++ b/openprotein/data/prompts/__init__.py @@ -1,10 +1,30 @@ -"""Client for stored prompts (``session.data.Prompt``).""" +"""Client for stored prompts (``session.data.Prompt``). + +.. deprecated:: 0.18.2 + ``PromptSummary``: use ``openprotein.data.PromptMetadata``. +""" + +from typing import Any + +from openprotein import _deprecation from .prompts import Prompt -from .schemas import PromptRecord, PromptSummary +from .schemas import PromptMetadata, PromptRecord __all__ = [ "Prompt", + "PromptMetadata", "PromptRecord", - "PromptSummary", ] + + +def __getattr__(name: str) -> Any: + if name == "PromptSummary": + _deprecation.warn_deprecated( + f"{__name__}.PromptSummary", + "`openprotein.data.PromptMetadata`", + since="0.18.2", + removed_in="0.19.0", + ) + return PromptMetadata + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/openprotein/data/prompts/_api.py b/openprotein/data/prompts/_api.py index d34581d..45e9536 100644 --- a/openprotein/data/prompts/_api.py +++ b/openprotein/data/prompts/_api.py @@ -10,13 +10,13 @@ from openprotein.data._reads import read from openprotein.errors import MissingParameterError -from .schemas import PromptRecord, PromptSummary +from .schemas import PromptMetadata, PromptRecord class PromptPage(BaseModel): """One page of prompt summaries, newest first.""" - items: list[PromptSummary] + items: list[PromptMetadata] next: str | None = None diff --git a/openprotein/data/prompts/prompts.py b/openprotein/data/prompts/prompts.py index 94b3c51..0243265 100644 --- a/openprotein/data/prompts/prompts.py +++ b/openprotein/data/prompts/prompts.py @@ -23,7 +23,7 @@ from openprotein.jobs.schemas import Job, JobStatus from . import _api, _replicates -from .schemas import PromptSummary +from .schemas import PromptMetadata if TYPE_CHECKING: from openprotein.align.schemas import MSASamplingMethod @@ -33,7 +33,7 @@ _LIST_PAGE = 200 -class Prompt(_Resource[PromptSummary]): +class Prompt(_Resource[PromptMetadata]): """A stored prompt. ``session.data.Prompt.create`` uploads one, ``session.data.Prompt.list`` @@ -49,7 +49,7 @@ class Prompt(_Resource[PromptSummary]): _replicates: builtins.list[builtins.list[str]] | None = None @classmethod - def _load(cls, session: APISession, id: str) -> PromptSummary: + def _load(cls, session: APISession, id: str) -> PromptMetadata: return _api.prompts_get(session, id) @classmethod @@ -63,7 +63,7 @@ def _from_job(cls, session: APISession, job: Job) -> Self: raise prompt = bound( session, - PromptSummary( + PromptMetadata( id=job.job_id, status=job.status, job_id=job.job_id, @@ -241,7 +241,7 @@ def _sample( ) return Prompt._for(session)( session, - PromptSummary( + PromptMetadata( id=job["job_id"], status=job["status"], job_id=job["job_id"], diff --git a/openprotein/data/prompts/schemas.py b/openprotein/data/prompts/schemas.py index 85d50b9..f847b5c 100644 --- a/openprotein/data/prompts/schemas.py +++ b/openprotein/data/prompts/schemas.py @@ -1,16 +1,21 @@ -"""Schemas for stored prompts (``session.data.Prompt``).""" +"""Schemas for stored prompts (``session.data.Prompt``). + +.. deprecated:: 0.18.2 + ``PromptSummary``: use ``openprotein.data.PromptMetadata``. +""" from datetime import datetime from typing import Any from pydantic import BaseModel +from openprotein import _deprecation from openprotein.jobs.schemas import JobStatus -__all__ = ["PromptRecord", "PromptSummary", "PromptUnitValue"] +__all__ = ["PromptMetadata", "PromptRecord", "PromptUnitValue"] -class PromptSummary(BaseModel): +class PromptMetadata(BaseModel): """One row as listed, without its replicates. A row whose job hasn't finished has a ``status`` other than ``SUCCESS`` and @@ -34,10 +39,22 @@ class PromptUnitValue(BaseModel): value: dict[str, Any] -class PromptRecord(PromptSummary): +class PromptRecord(PromptMetadata): """One row read in full, carrying each replicate's presigned value. ``value`` is ``None`` until the row's job has produced the replicates. """ value: list[PromptUnitValue] | None = None + + +def __getattr__(name: str) -> Any: + if name == "PromptSummary": + _deprecation.warn_deprecated( + f"{__name__}.PromptSummary", + "`openprotein.data.PromptMetadata`", + since="0.18.2", + removed_in="0.19.0", + ) + return PromptMetadata + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/tests/data/test_prompt_names.py b/tests/data/test_prompt_names.py new file mode 100644 index 0000000..25e51a2 --- /dev/null +++ b/tests/data/test_prompt_names.py @@ -0,0 +1,46 @@ +import importlib + +import pytest + +import openprotein.data +from openprotein.data import PromptMetadata + +MODULES = ["openprotein.data.prompts", "openprotein.data.prompts.schemas"] + + +@pytest.mark.parametrize("module", MODULES) +def test_prompt_summary_resolves_to_prompt_metadata_and_warns(module): + with pytest.warns(FutureWarning) as record: + resolved = importlib.import_module(module).PromptSummary + assert resolved is PromptMetadata + assert [str(w.message) for w in record] == [ + ( + f"`{module}.PromptSummary` is deprecated since 0.18.2 and will be removed " + "in 0.19.0. Use `openprotein.data.PromptMetadata`." + ) + ] + assert record[0].filename == __file__ + + +def test_from_import_of_prompt_summary_warns(): + with pytest.warns(FutureWarning, match="openprotein.data.prompts.PromptSummary"): + from openprotein.data.prompts import PromptSummary # noqa: F401 + + +def test_prompt_metadata_is_exported_beside_its_siblings(): + assert {"AssayMetadata", "MSAMetadata", "PromptMetadata"} <= set( + openprotein.data.__all__ + ) + assert ( + "PromptMetadata" in importlib.import_module("openprotein.data.prompts").__all__ + ) + assert ( + "PromptSummary" + not in importlib.import_module("openprotein.data.prompts").__all__ + ) + + +@pytest.mark.parametrize("module", MODULES) +def test_an_unknown_name_raises_attribute_error(module): + with pytest.raises(AttributeError, match="NoSuchName"): + _ = importlib.import_module(module).NoSuchName diff --git a/tests/data/test_prompt_resource.py b/tests/data/test_prompt_resource.py index e48f4e3..e11b627 100644 --- a/tests/data/test_prompt_resource.py +++ b/tests/data/test_prompt_resource.py @@ -8,10 +8,10 @@ import pytest from openprotein.data import DataAPI, Prompt -from openprotein.data.prompts import PromptSummary +from openprotein.data.prompts import PromptMetadata from openprotein.errors import HTTPError, JobOutputsNotReady from openprotein.jobs.schemas import JobStatus -from openprotein.prompt.schemas import PromptMetadata +from openprotein.prompt.schemas import PromptMetadata as CompatPromptMetadata SUMMARY = { "id": "p1", @@ -21,7 +21,7 @@ "description": None, "created_at": "2026-07-20T00:00:00Z", } -SAMPLED = PromptMetadata( +SAMPLED = CompatPromptMetadata( id="s1", name="prompt-abc", description=None, @@ -60,7 +60,7 @@ def prompt(session) -> Prompt: session.get.return_value = _response( content=_zip(b">a\nACDE\n>b\nAC:DE\n", b">a\nMKVL\n") ) - return Prompt(session, PromptSummary.model_validate(SUMMARY)) + return Prompt(session, PromptMetadata.model_validate(SUMMARY)) def test_session_data_hands_out_one_bound_prompt_class(session): @@ -140,7 +140,7 @@ def test_an_unknown_id_raises_the_404(session): def test_reading_a_prompt_the_data_routes_do_not_hold_raises_the_404(session): session.get.side_effect = _not_found() - prompt = Prompt(session, PromptSummary(id="s1", status=JobStatus.SUCCESS)) + prompt = Prompt(session, PromptMetadata(id="s1", status=JobStatus.SUCCESS)) with pytest.raises(HTTPError) as error: list(prompt) assert error.value.status_code == 404 @@ -167,7 +167,7 @@ def test_replicates_are_read_once_per_handle(prompt, session): def test_reading_a_pending_prompt_names_its_status(session, read): pending = SUMMARY | {"status": "PENDING", "job_id": "p1"} session.get.return_value = _response(pending) - prompt = Prompt(session, PromptSummary.model_validate(pending)) + prompt = Prompt(session, PromptMetadata.model_validate(pending)) with pytest.raises(JobOutputsNotReady, match="Prompt p1 is PENDING"): read(prompt) session.get.assert_called_once_with("v1/data/prompts/p1") @@ -188,4 +188,4 @@ def test_delete_deletes_the_row(prompt, session): @pytest.mark.parametrize("name", ["download", "replicates", "record", "upload"]) def test_a_prompt_has_no_download_replicates_record_or_upload(name): assert not hasattr(Prompt, name) - assert not hasattr(Prompt(MagicMock(), PromptSummary(id="p1")), name) + assert not hasattr(Prompt(MagicMock(), PromptMetadata(id="p1")), name) diff --git a/tests/data/test_prompts_api.py b/tests/data/test_prompts_api.py index 541b333..fb020e0 100644 --- a/tests/data/test_prompts_api.py +++ b/tests/data/test_prompts_api.py @@ -4,7 +4,7 @@ import pytest -from openprotein.data.prompts import Prompt, PromptRecord, PromptSummary +from openprotein.data.prompts import Prompt, PromptMetadata, PromptRecord from openprotein.data.prompts._api import ( prompts_delete, prompts_download, @@ -195,7 +195,7 @@ def test_get_wraps_the_record(mock_session): def test_prompt_wrapper_methods_route_to_its_id(mock_session, sample_record): payload = _zip_of([b">c1\nACDE\n", b">c1\nMKVL\n"]) mock_session.get.return_value.content = payload - prompt = Prompt(mock_session, PromptSummary.model_validate(sample_record)) + prompt = Prompt(mock_session, PromptMetadata.model_validate(sample_record)) assert list(prompt) == [["ACDE"], ["MKVL"]] assert mock_session.get.call_args[0][0] == "v1/data/prompts/prompt123/download" @@ -222,7 +222,7 @@ def pending_summary(sample_summary) -> dict: def test_pending_summary_parses_with_its_job_status(mock_session, pending_summary): - summary = PromptSummary.model_validate(pending_summary) + summary = PromptMetadata.model_validate(pending_summary) prompt = Prompt(mock_session, summary) assert summary.status == JobStatus.RUNNING assert prompt.status == JobStatus.RUNNING @@ -230,14 +230,14 @@ def test_pending_summary_parses_with_its_job_status(mock_session, pending_summar def test_summary_without_status_reads_success_and_no_job(mock_session, sample_summary): - prompt = Prompt(mock_session, PromptSummary.model_validate(sample_summary)) + prompt = Prompt(mock_session, PromptMetadata.model_validate(sample_summary)) assert prompt.status == JobStatus.SUCCESS assert prompt.job_id is None @pytest.mark.parametrize("status", ["FAILURE", "CANCELED"]) def test_summary_parses_terminal_job_statuses(sample_summary, status): - summary = PromptSummary.model_validate({**sample_summary, "status": status}) + summary = PromptMetadata.model_validate({**sample_summary, "status": status}) assert summary.status == JobStatus(status) diff --git a/tests/data/test_prompts_sample.py b/tests/data/test_prompts_sample.py index a94778e..53ab71e 100644 --- a/tests/data/test_prompts_sample.py +++ b/tests/data/test_prompts_sample.py @@ -7,7 +7,7 @@ from openprotein.align.schemas import MSASamplingMethod from openprotein.data.msa import MSA, MSAMetadata -from openprotein.data.prompts import Prompt, PromptSummary +from openprotein.data.prompts import Prompt, PromptMetadata from openprotein.errors import HTTPError, MissingParameterError from openprotein.jobs import JobStatus @@ -182,7 +182,7 @@ def get(path, **kwargs): def _sampled(mock_session, status: str = "SUCCESS") -> Prompt: return Prompt( mock_session, - PromptSummary(id=PROMPT_ID, status=JobStatus(status), job_id=PROMPT_ID), + PromptMetadata(id=PROMPT_ID, status=JobStatus(status), job_id=PROMPT_ID), ) diff --git a/tests/data/test_resource_jobs.py b/tests/data/test_resource_jobs.py index 6fac829..284c8e9 100644 --- a/tests/data/test_resource_jobs.py +++ b/tests/data/test_resource_jobs.py @@ -6,7 +6,7 @@ from openprotein.data import MSA, Prompt from openprotein.data.msa import MSAMetadata -from openprotein.data.prompts import PromptSummary +from openprotein.data.prompts import PromptMetadata from openprotein.errors import ( HTTPError, JobFailedException, @@ -47,7 +47,7 @@ def get(path, **kwargs): def _sampled(session: MagicMock, status: str = "SUCCESS") -> Prompt: return Prompt( session, - PromptSummary(id=PROMPT_ID, status=JobStatus(status), job_id=PROMPT_ID), + PromptMetadata(id=PROMPT_ID, status=JobStatus(status), job_id=PROMPT_ID), ) diff --git a/tests/embeddings/test_embeddings_models.py b/tests/embeddings/test_embeddings_models.py index 61d5875..00d2ddb 100644 --- a/tests/embeddings/test_embeddings_models.py +++ b/tests/embeddings/test_embeddings_models.py @@ -241,7 +241,7 @@ def test_ablang2_single_site_forwards_base_sequence(): def test_a_poet_model_sends_the_id_of_a_stored_prompt_that_is_not_ready( model_class, model_id ): - from openprotein.data.prompts import Prompt, PromptSummary + from openprotein.data.prompts import Prompt, PromptMetadata from openprotein.jobs import JobStatus from openprotein.prompt import PromptAPI @@ -250,7 +250,7 @@ def test_a_poet_model_sends_the_id_of_a_stored_prompt_that_is_not_ready( session.prompt._resolve_query.return_value = None prompt = Prompt( session, - PromptSummary(id="prompt-9", status=JobStatus.PENDING, job_id="prompt-9"), + PromptMetadata(id="prompt-9", status=JobStatus.PENDING, job_id="prompt-9"), ) job = { "job_id": "job-123", diff --git a/tests/models/test_handles.py b/tests/models/test_handles.py index c814977..c1967cd 100644 --- a/tests/models/test_handles.py +++ b/tests/models/test_handles.py @@ -121,11 +121,11 @@ def test_a_scoring_seed_with_a_card_default_is_left_to_the_card( class TestPrompt: def test_a_prompt_object_sends_its_id(self, models, models_session): from openprotein.data.prompts.prompts import Prompt - from openprotein.data.prompts.schemas import PromptSummary + from openprotein.data.prompts.schemas import PromptMetadata prompt = Prompt( models_session.session, - PromptSummary(id="prompt-1", created_at="2026-10-21T08:00:00Z"), + PromptMetadata(id="prompt-1", created_at="2026-10-21T08:00:00Z"), ) models.poet.score(["MKT"], prompt=prompt) @@ -139,11 +139,11 @@ def test_a_prompt_object_sends_its_id(self, models, models_session): def test_a_prompt_that_is_not_ready_sends_its_id( self, models, models_session, model, verb ): - from openprotein.data.prompts import Prompt, PromptSummary + from openprotein.data.prompts import Prompt, PromptMetadata prompt = Prompt( models_session.session, - PromptSummary(id="prompt-9", status=JobStatus.PENDING, job_id="prompt-9"), + PromptMetadata(id="prompt-9", status=JobStatus.PENDING, job_id="prompt-9"), ) getattr(getattr(models, model), verb)(["MKT"], prompt=prompt) diff --git a/tests/models/test_models_api.py b/tests/models/test_models_api.py index 21e187b..f8ac901 100644 --- a/tests/models/test_models_api.py +++ b/tests/models/test_models_api.py @@ -445,7 +445,7 @@ def test_a_verb_forwards_prompt_id_from_a_stored_or_a_sampled_prompt( self, mock_session ): from openprotein.data.prompts.prompts import Prompt - from openprotein.data.prompts.schemas import PromptSummary + from openprotein.data.prompts.schemas import PromptMetadata poet2 = Model( mock_session, @@ -458,7 +458,7 @@ def test_a_verb_forwards_prompt_id_from_a_stored_or_a_sampled_prompt( stored_prompt = Prompt( mock_session, - PromptSummary( + PromptMetadata( id="prompt-1", owner="user", created_at="2026-09-05T08:00:00Z", @@ -466,7 +466,7 @@ def test_a_verb_forwards_prompt_id_from_a_stored_or_a_sampled_prompt( ) sampled_prompt = Prompt( mock_session, - PromptSummary(id="sample-job-1", status="PENDING", job_id="sample-job-1"), + PromptMetadata(id="sample-job-1", status="PENDING", job_id="sample-job-1"), ) poet2.embed(["MKTAYIAK"], prompt_id=stored_prompt.id)