openprotein.prompt
SDK release/v0.18.0Create prompts and queries for PoET models. The Models interface accepts a prompt ID, a compatibility Prompt, a stored Data Prompt, or a Data PromptFuture as prompt= (or None). If you already have a stored alignment, see sample a prompt from a stored MSA.
msa = session.align.create_msa("ACDEFGHIK")
prompt = msa.sample_prompt(num_sequences=10)
job = session.models.poet.embed(["ACDEFGHIK"], prompt=prompt)Some pinned SDK docstrings still link to the deprecated embedding interface.
13source
Prompt API providing the interface to create prompts for use with PoET models.
sessionAPISessionmethodcreate_prompt(context, name=None, description=None)→Promptsource
Create a prompt.
contextContext | Sequence[Context]Context or list of contexts. Each context is a sequence of entries
where each entry is a raw sequence (bytes/str, optionally with
: chain breaks for multichain), Protein, or
Complex. Only protein chains are accepted; passing a
Complex with DNA, RNA, or Ligand chains raises
InvalidParameterError.
namestr= NoneName of the prompt.
descriptionOptional[str]= NoneDescription of the prompt.
The created prompt.
methodcreate_query(query, force_structure=False)→Querysource
Create a query.
A query protein or complex. Raw bytes/str inputs may include
: chain breaks to denote a multichain protein. Only protein
chains are accepted; passing a Complex with DNA, RNA, or Ligand
chains raises InvalidParameterError.
force_structurebool= FalseOptionally force a query to be interpreted with a structure. Useful for creating structure prediction queries which can have no structure.
The created query.
propertyhuman_antibody_vh:Promptsource
Curated prompt of naive human antibody heavy chains (VH).
Tracks the latest version of this prompt, currently
human_antibody_vh_v1. Use the versioned attribute directly to
pin a version that will not change in a later release.
propertyhuman_antibody_vh_v1:Promptsource
Curated prompt of naive human antibody heavy chains (VH), version 1.
An ensemble of 10 replicates, each a random sample of 200 naive human antibody heavy chain (VH) sequences from the OAS paired database, clustered at 70% sequence identity.
propertyhuman_antibody_vl:Promptsource
Curated prompt of naive human antibody light chains (VL).
Tracks the latest version of this prompt, currently
human_antibody_vl_v1. Use the versioned attribute directly to
pin a version that will not change in a later release.
propertyhuman_antibody_vl_v1:Promptsource
Curated prompt of naive human antibody light chains (VL), version 1.
An ensemble of 10 replicates, each a random sample of 200 naive human antibody light chain (VL) sequences from the OAS paired database, clustered at 70% sequence identity.
propertyhuman_antibody_vh_vl:Promptsource
Curated prompt of naive paired human antibodies, heavy chain first.
Tracks the latest version of this prompt, currently
human_antibody_vh_vl_v1. Use the versioned attribute directly
to pin a version that will not change in a later release.
propertyhuman_antibody_vh_vl_v1:Promptsource
Curated prompt of naive paired human antibodies (VH-VL), version 1.
An ensemble of 10 replicates, each a random sample of 200 naive paired human antibody sequences from the OAS paired database, clustered at 70% sequence identity. Each complex is the heavy chain (VH) followed by the light chain (VL).
propertyhuman_antibody_vl_vh:Promptsource
Curated prompt of naive paired human antibodies, light chain first.
Tracks the latest version of this prompt, currently
human_antibody_vl_vh_v1. Use the versioned attribute directly
to pin a version that will not change in a later release.
propertyhuman_antibody_vl_vh_v1:Promptsource
Curated prompt of naive paired human antibodies (VL-VH), version 1.
An ensemble of 10 replicates, each a random sample of 200 naive paired human antibody sequences from the OAS paired database, clustered at 70% sequence identity. Each complex is the light chain (VL) followed by the heavy chain (VH).
21source
Bases: Future
Prompt which contains a set of sequences and/or structures used to condition the PoET models.
methodget_as_complexes()→list[list[Complex]]source
Retrieve the prompt context with every entry as a Complex.
Single-chain entries are wrapped as Complex({"A": protein}) so the
return type is uniform regardless of chain count.
methodget_as_proteins()→list[list[Protein]]source
Retrieve the prompt context with every entry as a Protein.
Raises InvalidParameterError if any entry is multichain — use
get_as_complexes instead when multichain entries may be present.
propertyidsource
The unique identifier of the prompt.
propertynamesource
The name of the prompt.
propertydescriptionsource
The description of the prompt.
propertycreated_datesource
The timestamp when the prompt was created.
methodrename(name=None, description=None)source
Not supported: a prompt's name is set when it is created.
namestr | None= Nonedescriptionstr | None= Nonepropertynum_replicatessource
The number of replicates in the prompt for an ensemble prompt.
propertyargs:dict[str, Any]source
inherited from openprotein.jobs.Future
The registered job arguments.
methodcancelled()→boolsource
inherited from openprotein.jobs.Future
Check if the job has been cancelled.
True if the job is cancelled, False otherwise.
methoddone()→boolsource
inherited from openprotein.jobs.Future
Check if the job has completed.
True if the job is done, False otherwise.
propertyend_date:datetime | Nonesource
inherited from openprotein.jobs.Future
The end timestamp of the job.
methodget(verbose=False, **kwargs)→list[list[Protein | Complex]]source
inherited from openprotein.jobs.Future
Retrieve the prompt as context entries.
Single-chain entries collapse to Protein;
multichain entries are returned as Complex.
Use get_as_complexes for a uniform Complex return, or
get_as_proteins for a uniform Protein return (the latter
raises if any entry is multichain).
verbosebool= Falsepropertyprogress_counter:intsource
inherited from openprotein.jobs.Future
The progress counter of the job.
methodrefresh()source
inherited from openprotein.jobs.Future
Refresh the job status and internal job object.
propertystart_date:datetime | Nonesource
inherited from openprotein.jobs.Future
The start timestamp of the job.
methodwait(interval=5, timeout=None, verbose=False, **kwargs)→Vsource
inherited from openprotein.jobs.Future
Wait for the job to complete, then fetch results.
intervalint= config.POLLING_INTERVALTime in seconds between polling. Defaults to config.POLLING_INTERVAL.
timeoutint | None= NoneMaximum time in seconds to wait. Defaults to None.
verbosebool= FalseVerbosity flag. Defaults to False.
**kwargs= {}Keyword arguments passed to get.
The results of the job.
methodwait_until_done(interval=5, timeout=None, verbose=False)→boolsource
inherited from openprotein.jobs.Future
Wait for the job to complete.
intervalfloat= config.POLLING_INTERVALTime in seconds between polling. Defaults to config.POLLING_INTERVAL.
timeoutint= NoneMaximum time in seconds to wait. Defaults to None.
verbosebool= FalseVerbosity flag. Defaults to False.
True if the job completed successfully.
This method does not fetch the job results, unlike wait().
5source
Query containing a sequence/structure used to query the design models which opens up new workflows.
Create a query with a masked sequence using mask_sequence_at for PoET2Model to run inverse folding.
Create a query with a masked structure using mask_structure_at for RFdiffusion to run inverse folding.
sessionAPISessionmetadataQueryMetadatamethodget()→Protein | Complexsource
Retrieve the query as a Protein or Complex.
Single-chain queries collapse to Protein; multichain queries are
returned as Complex. For a uniform return type, see
get_as_complex or get_as_protein.
methodget_as_complex()→Complexsource
Retrieve the query as a Complex.
An mmCIF or PDB query returns the parsed Complex with chain ids taken from the
file. A FASTA query has no chain id, so a single-chain result is
wrapped as Complex({"A": protein}).
methodget_as_protein()→Proteinsource
Retrieve the query as a Protein.
Raises InvalidParameterError if the query is multichain — use
get_as_complex instead when multichain queries may be present.
propertyidsource
The unique identifier of the query.
propertycreated_datesource
The timestamp when the query was created.
source
Bases: BaseModel
Metadata about a prompt.
source
Bases: BaseModel
Metadata about a query.