← Về thư mục
openai4s/jobs.py
- _record_diagnostic · function · L100-L117 — def _record_diagnostic(exc: BaseException, *, surface: str) -> None
- Job · class · L120-L317 — class Job
- init · method · L121-L172 — def init( self, kind: str, command: str, cwd: str, *, deadline_s: float = DEFAULT_JOB_DEADLINE_S, job_id: str | None = None, ) -> None
- append_bytes · method · L174-L191 — def append_bytes(self, chunk: bytes) -> None
- _finish_locked · method · L193-L212 — def _finish_locked(self, status: str, *, exit_code: int | None = None) -> str
- finish · method · L214-L216 — def finish(self, status: str, *, exit_code: int | None = None) -> str
- _claim_stop_locked · method · L218-L231 — def _claim_stop_locked(self, reason: str) -> bool
- claim_stop · method · L233-L235 — def claim_stop(self, reason: str) -> bool
- append · method · L237-L239 — def append(self, text: str) -> None
- output · method · L241-L261 — def output(self) -> str
- to_dict · method · L263-L288 — def to_dict(self, *, with_output: bool = False) -> dict
- receipt · method · L290-L317 — def receipt(self) -> dict
- JobManager · class · L320-L839 — class JobManager: #: How long
cancel waits for _run to publish the true terminal result of #: a job that turned out to have already exited. The process is reaped, so #: _run only has to finish draining a now-closed stdout pipe; this is a #: generous cap on that, not an expected wait.
- init · method · L332-L340 — def init(self, root: Path) -> None
- _adopt_abandoned · method · L344-L399 — def _adopt_abandoned(self) -> None
- _persist · method · L401-L416 — def _persist(self, job: Job) -> None
- submit · method · L418-L518 — def submit( self, command: str, kind: str = "bash", cwd: str | None = None, *, deadline_s: float | None = None, ) -> dict
- _run · method · L520-L642 — def _run(self, job: Job) -> None
- _expire · method · L644-L659 — def _expire(self, job: Job) -> None
- cancel · method · L661-L745 — def cancel(self, job_id: str) -> dict
- list · method · L747-L750 — def list(self) -> list[dict]
- get · method · L752-L756 — def get(self, job_id: str) -> dict
- close · method · L758-L820 — def close(self) -> dict
- _prune_locked · method · L822-L839 — def _prune_locked(self) -> None