Generated from
lighton-sdk 1.0.0.
Install it and see runnable examples in the quick start.Client
LightOn
LightOn.ask()
Returns
LightOn.close()
LightOn.extract()
Returns
Raises
LightOn.parse()
Returns
Raises
LightOn.search()
Returns
LightOnConfiguration
Non-essential client knobs. api_key stays a direct LightOn() argument.Workspaces & files
Workspace
Workspace.create()
Returns
Workspace.delete()
Workspace.get()
Classmethod.
Returns
Workspace.ingest()
Returns
Raises
Workspace.ingest_many()
Returns
Raises
Workspace.list()
Classmethod.
Returns
Workspace.refresh()
Workspace.save()
File
File.classify()
Returns
Raises
File.clear_attribute()
Returns
File.create()
Returns
Raises
File.delete()
File.facets()
Raises
File.get()
Classmethod.
Returns
File.get_by_name()
Classmethod.
title, not filename: the server uniquifies filenames on upload
(“report.pdf” is stored as something like “report_20260728_c9be.pdf”), so the
name you uploaded never matches the stored one. A title defaults to the
uploaded filename without its extension, so “report.pdf” and “report” both
find that upload.
Titles are not unique the way stored filenames are, uploading the same
document twice gives both copies the same title, so this returns every match
rather than picking one. Check the length if you need exactly one.
The API’s title filter is a case-insensitive partial match, so the
candidates it returns are narrowed to an exact title match here.
Arguments
Returns
Raises
File.list()
Classmethod.
Returns
File.refresh()
File.save()
File.set_attribute()
Returns
File.tag()
Returns
Raises
File.unclassify()
Returns
File.untag()
Returns
Raises
File.wait()
Returns
Raises
wait_all
Returns
Raises
Tags & content types
Tag
Tag.create()
Returns
Tag.delete()
Tag.get()
Classmethod.
Tag.list()
Classmethod.
Returns
Tag.refresh()
ContentType
A node in the content-type taxonomy.ContentType.list()
Classmethod.
children).
Arguments
Returns
Attribute
One attribute of a content type, a definition, or a value set on a file. Carries both the schema (type/required/choices) and, when read from a file’s facets, the currentvalue. value is None for bare definitions / when unset.
Facet
A content type assigned to a file, with the file’s attribute values on it.API keys
ApiKey
ApiKey.create()
Returns
ApiKey.delete()
ApiKey.get()
Classmethod.
Returns
ApiKey.list()
Classmethod.
Returns
ApiKey.refresh()
ApiKey.save()
ApiKeyScope
Jobs & batches
ParseJob
ParseJob.poll()
Returns
Raises
ExtractJob
ExtractJob.poll()
Returns
Raises
BatchIngestJob
A running (or finished) batch ingestion. Returned byWorkspace.ingest_many(mode=ExecMode.ASYNC). Uploads (and, when
wait=True, ingestion polls) run in a background thread; read progress,
succeeded, and failed at any time, or block with wait().
BatchIngestJob.poll()
BatchIngestJob.wait()
Returns
Raises
BatchIngest
Terminal result of a batch: the Files that succeeded and what failed.BatchProgress
Live snapshot of a running batch (seeBatchIngestJob.progress).
FailedIngest
One file that didn’t make it.Enums
ExecMode
Execution mode for parse/extract: run inline or queue as an async job. Uppercase members (unlike the other enums here) so the async member can beASYNC, lowercase async is a Python keyword and can’t be a member name.
FileStatus
Ingestion pipeline status for a File.JobStatus
Status of an async parse/extract job. Onlypending (initial) and completed (success) are documented by the
API, the schema types status as a bare string with no enum and doesn’t
publish the failure vocabulary. This enum is for call-site comparisons
(StrEnum members equal their string values), NOT to validate the response
field, so an unrecognized server value compares unequal rather than erroring.
Detect terminal-failure via completed_at being set without completed
(or, for parse, the error block) rather than a status string.
RelevanceScoring
Cross-encoder relevance scoring step for search.Role
Access role granted by an API-key scope on a workspace.SearchMode
Retrieval mode for search/ask.Exceptions
Importable fromlighton.exceptions. Every method that performs a request can
raise these, so they are listed once here rather than repeated on each method.
A method’s own Raises block covers only what it raises directly.