openprotein.embeddings.EmbeddingsResultFuture#
- class openprotein.embeddings.EmbeddingsResultFuture(session, job, sequences=None, max_workers=10)[source]#
Future for manipulating results for embeddings-related requests.
- Parameters:
session (APISession)
job (EmbeddingsJob | AttnJob | LogitsJob)
sequences (list[bytes] | list[str] | None)
max_workers (int)
- __init__(session, job, sequences=None, max_workers=10)[source]#
Initialize the MappedFuture.
- Parameters:
session (APISession) – The session for API interactions.
job (Job) – The job to retrieve results from.
max_workers (int, optional) – The number of workers for concurrent result retrieval. Defaults to config.MAX_CONCURRENT_WORKERS.
sequences (list[bytes] | list[str] | None)
Notes
Use max_workers > 0 to enable concurrent retrieval.
Methods
__init__(session, job[, sequences, max_workers])Initialize the MappedFuture.
cancelled()Check if the job has been cancelled.
create(session[, job_id, job, response])Create an instance of the appropriate Future class based on the job type.
done()Check if the job has completed.
get([verbose])Return all results from the job by consuming the stream.
get_item(sequence)Get embedding results for specified sequence.
refresh()Refresh the job status and internal job object.
stream()Retrieve results for this job as a stream.
stream_parallel()Stream the results in parallel using a thread pool.
stream_sync()Stream the results synchronously.
wait([interval, timeout, verbose])Wait for the job to complete, then fetch results.
wait_until_done([interval, timeout, verbose])Wait for the job to complete.
Attributes
created_dateThe creation timestamp of the job.
end_dateThe end timestamp of the job.
idThe unique identifier of the job.
job_idThe unique identifier of the job.
job_typeThe type of the job.
progress_counterThe progress counter of the job.
sequencesstart_dateThe start timestamp of the job.
statusThe current status of the job.
jobsession