SDK reference¶
Auto-generated from the incheck Python package.
Clients¶
incheck.Client ¶
Client(
api_key: str | None = None,
*,
environment: Environment | None = None,
base_url: str | None = None,
timeout: float = 120.0,
http_client: Client | None = None,
)
Synchronous InCheck API client.
Example
from incheck import Client
with Client() as client: # INCHECK_API_KEY from env for org in client.documents.list_orgs().org_ids: print(org)
Point at the staging (acceptance) environment:¶
with Client(environment="staging") as client: ...
incheck.AsyncClient ¶
AsyncClient(
api_key: str | None = None,
*,
environment: Environment | None = None,
base_url: str | None = None,
timeout: float = 120.0,
http_client: AsyncClient | None = None,
)
Asynchronous InCheck API client.
Example
import asyncio from incheck import AsyncClient
async def main(): async with AsyncClient(environment="staging") as client: orgs = await client.documents.list_orgs() print(orgs.org_ids)
asyncio.run(main())
Documents resource¶
incheck.resources.documents.DocumentsResource ¶
list ¶
All documents in an org_id's current version (with presigned GETs).
wait_for_job ¶
Block until the job reaches a terminal state or timeout elapses.
Raises :class:~incheck.exceptions.JobFailedError on failed and
:class:~incheck.exceptions.JobTimeoutError if the deadline is hit.
upload ¶
upload(
org_id: str,
files: Iterable[FileSpec],
*,
batch_size: int = 6,
wait: bool = True,
timeout: float = 600.0,
poll_interval: float = 10.0,
) -> JobStatus | UploadCompleted
Initiate → PUT to S3 → complete → (optionally) poll until done.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
org_id
|
str
|
Hierarchical org_id (must start with your namespace). |
required |
files
|
Iterable[FileSpec]
|
Local paths or |
required |
batch_size
|
int
|
Document-chunking batch size (1-20). |
6
|
wait
|
bool
|
When True (default), block until the processing job
reaches a terminal state and return the final :class: |
True
|
timeout
|
float
|
Max seconds to wait when |
600.0
|
poll_interval
|
float
|
Seconds between status polls. |
10.0
|
Chat resource¶
incheck.resources.chat.ChatResource ¶
send ¶
send(
content: str,
*,
org_id: str | None = None,
user_id: str = "sdk",
conversation_id: str | None = None,
scope: str = "ALS",
state: str = "Massachusetts",
conversation_hx: str | None = None,
) -> ChatResponse
Send a chat message and return the aggregated reply.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str
|
The user message. |
required |
org_id
|
str | None
|
Optional. Pass your Pod's hierarchical org_id to run in unified mode (retrieval-aware against the documents onboarded into that Pod via the Documents API). Omit it to run in EMS mode (general EMS knowledge, no retrieval). First segment must equal your namespace. |
None
|
user_id
|
str
|
An identifier for the end-user. Audit trail only. |
'sdk'
|
conversation_id
|
str | None
|
Optional — a UUID is generated if omitted. |
None
|
scope
|
str
|
EMS scope ( |
'ALS'
|
state
|
str
|
US state for state-specific protocols. |
'Massachusetts'
|
conversation_hx
|
str | None
|
Optional prior conversation context. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
ChatResponse
|
class: |
ChatResponse
|
joined and the raw chunks available on |
stream ¶
stream(
content: str,
*,
org_id: str | None = None,
user_id: str = "sdk",
conversation_id: str | None = None,
scope: str = "ALS",
state: str = "Massachusetts",
conversation_hx: str | None = None,
) -> Iterator[ChatChunk]
Stream chat chunks as they arrive (SSE).
Identical contract to :meth:send, but yields each
:class:~incheck.models.ChatChunk as it lands. Terminates on
the type='complete' marker.
Example
for chunk in client.chat.stream( ... "Summarize the dispatch SOP.", ... org_id="acme_dispatch", ... ): ... if chunk.content: ... print(chunk.content, end="", flush=True)
incheck.resources.chat.AsyncChatResource ¶
send
async
¶
send(
content: str,
*,
org_id: str | None = None,
user_id: str = "sdk",
conversation_id: str | None = None,
scope: str = "ALS",
state: str = "Massachusetts",
conversation_hx: str | None = None,
) -> ChatResponse
Async counterpart of :meth:ChatResource.send.
stream
async
¶
stream(
content: str,
*,
org_id: str | None = None,
user_id: str = "sdk",
conversation_id: str | None = None,
scope: str = "ALS",
state: str = "Massachusetts",
conversation_hx: str | None = None,
) -> AsyncIterator[ChatChunk]
Async counterpart of :meth:ChatResource.stream.
Models¶
incheck.models.UploadInitiated ¶
Bases: _IncheckModel
Result of a successful documents.initiate_upload call.
incheck.models.PresignedUpload ¶
Bases: _IncheckModel
One file's presigned-POST credentials, returned by initiate-upload.
Pass upload_fields verbatim as multipart form fields, then attach the
file under the file field, and POST to upload_url. S3 will respond
with 204 No Content on success.
incheck.models.UploadCompleted ¶
Bases: _IncheckModel
Result of documents.complete_upload — processing has been triggered.
incheck.models.UpdateInitiated ¶
Bases: _IncheckModel
Result of documents.initiate_update for an existing org_id.
incheck.models.OrgListResponse ¶
Bases: _IncheckModel
Result of documents.list_orgs() — always filtered to your namespace.
incheck.models.OrgInfo ¶
Bases: _IncheckModel
A single org_id discovered under your namespace.
incheck.models.DocumentListResponse ¶
Bases: _IncheckModel
incheck.models.DocumentInfo ¶
Bases: _IncheckModel
A single document inside an org_id's current version.
download_url exposes the short-lived presigned GET URL (the API
field name is presigned_url; the SDK normalises to
download_url for symmetry with other SDKs).
incheck.models.VersionInfo ¶
Bases: _IncheckModel
incheck.models.JobStatus ¶
Bases: _IncheckModel
Status of a document-processing job.
status is one of: initiated, pending, processing,
completed, failed. Use :meth:is_terminal to check.
incheck.models.JobProgress ¶
Bases: _IncheckModel
incheck.models.DeleteResponse ¶
Bases: _IncheckModel
incheck.models.ChatResponse ¶
Bases: _IncheckModel
Aggregated non-streaming chat reply.
incheck.models.ChatChunk ¶
Bases: _IncheckModel
A single Server-Sent-Event payload from streaming /chat.
Streamed chunks carry content deltas. The final event has
type='complete' and no content.
Errors¶
incheck.exceptions.IncheckError ¶
Bases: Exception
Base class for all InCheck SDK errors.