Releases: segmind/segmind-python
Release list
v1.1.0 — async-default verbs + LLM chat (BREAKING)
1.1.0 — ⚠️ BREAKING
This release redefines the inference verbs to make async the default and
adds a normalized LLM chat surface. Adoption was effectively zero, so the
verb flip ships without a deprecation cycle.
Breaking — verb redefinition (SEG-354)
| Verb | 1.1.0 behavior | Was (≤1.0.x) |
|---|---|---|
run(slug, **params) |
async — v2 queue-backed, submit + poll until done; returns the result dict |
sync v1, returned httpx.Response |
run_sync(slug, **params) |
sync — single blocking POST /v1/{slug}; returns httpx.Response |
new (this is the old run) |
run_async(slug, **params) |
removed — no alias; raises AttributeError / ImportError |
the old async one-shot |
submit_async(slug, **params) |
unchanged — returns AsyncJob (.wait/.status/.result) |
unchanged |
stream(...) |
raises NotImplementedError (gateway has no SSE yet) |
silently returned None |
Migration:
# 1.0.x -> 1.1.0
segmind.run(slug, ...) # sync image/etc. -> segmind.run_sync(slug, ...)
segmind.run_async(slug, ...) # async one-shot -> segmind.run(slug, ...)
segmind.submit_async(slug, ...) # unchangedrun (async) inherits the 600s job.wait default. For long / video
models the documented path is submit_async() + job.wait(timeout=…), not
run. All model params — including any literally named timeout / interval
— are still forwarded verbatim to the model body (SEG-339).
Added — LLM chat surface + output normalization (SEG-344)
The gateway returns each provider's raw native JSON in three incompatible
shapes (OpenAI choices[0].message.content, Anthropic content[0].text,
Gemini candidates[0].content.parts[0].text). The new chat surface hides that:
chat(slug, *, messages=[...] | prompt=..., **opts)→ChatResponse— async (mirrorsrun).chat_sync(...)→ChatResponse— sync singlePOST /v1.submit_chat(...)→AsyncChatJob(.wait/.status/.result/.request_id).ChatResponse:.text(provider-normalized),.json()(parse JSON-mode output),.usage,.finish_reason,.tool_calls(empty until the gateway forwardstools),.raw(always the native body).image_url(url | local_path)— builds an OpenAI image content-part; local paths are base64-encoded into adata:URI (recommended over URL, whose fetch path 400s on some hosts).- The v2 async
outputis a stringified copy of the provider JSON; the async chat pathjson.loads-es it before normalizing. stream=kwarg reserved onchat(); raisesNotImplementedErroruntil the gateway grows SSE.
100% additive apart from the verb rename above.
1.0.1
What's new in 1.0.1
v2 async inference (SEG-52)
segmind.submit_async(slug, **params)→AsyncJobhandlesegmind.run_async(slug, **params, timeout=600, interval=1.0)— one-shot submit + poll to completionAsyncJob.wait()/.status()/.result()- New exceptions
InferenceFailed(server FAILED) andInferenceTimeout - Tolerates heimdall's 4xx-on-FAILED responses; derives the v2 endpoint from
base_url
SDK traffic attribution (SEG-319)
- The client now sends
X-Initiator: SDK-PY, so Segmind can attribute SDK traffic (SDK-PYsync /SDK-PY-V2async) instead of bucketing it asOTHERS
Maintenance
- CI: bumped GitHub Pages actions past the deprecated
upload-artifact@v3
Full test matrix green on Python 3.9–3.12.