You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 416916e
Browse filesBrowse the repository at this point in the historyBrowse files
if (status.status==="completed") awaitai.write((awaitai.video.result(model, job.id)).videos[0], "./kite.mp4")
@@ -1305,9 +1313,8 @@ Everything below is exported from `@opencode/ai/effect` unless noted.
1305
1313
-**`LanguageModel.make(...)` / `ToolCallPart.make(...)` / `ToolResultPart.make(...)` / `ToolDefinition.make(...)`** — model and tool-related constructors from the canonical schema model.
1306
1314
-**`StreamEvent`** — the discriminated union of stream events; narrow with `event.type === "text-delta"` or a `switch` on `type`.
1307
1315
-**`ai.image.request` / `generate` / `stream` / `start` / `status` / `result` / `cancel`** — images over inline, streaming (partial previews), and queued routes through a provider-neutral request and response model. `start`, `status`, `result` and `cancel` address a queued job by the provider's job ID, like video; see [Image jobs](#image-jobs).
1308
-
-**`ai.video.request` / `start` / `status` / `result` / `cancel`** — video generation as a job addressed by the provider's job ID; see [Video generation](#video-generation).
1316
+
-**`ai.video.request` / `generate` / `stream` / `start` / `status` / `result` / `cancel`** — video generation: polled for you, or as a job addressed by the provider's job ID; see [Video generation](#video-generation).
1309
1317
-**`Media`** — the shared asset type (`Media.Asset`, `Media.Source`) and constructors used by messages, tool results, and media requests.
1310
-
-**`Generation`** — provider-neutral handle for an in-flight media generation (`await`, `refresh`, `cancel`, `events`) used by queued media routes.
1311
1318
-**`ai.decision.request` / `ai.decision.generate`** — typed predicate, choice, and score questions over text, JSON, and media input.
1312
1319
-**`ai.embedding.request` / `ai.embedding.generate`** — one vector per text or media value, with optional `dimensions` and `inputType`.
1313
1320
-**`AI`** — one Effect service for every operation: text as `stream`, `generate` and `compact`, and media grouped as `image`, `video`, `speech`, `transcription`, `decision` and `embedding`. `ai.*` from `@opencode/ai/effect` runs through it. `AI.layer` requires `RequestExecutor.Service`; `AI.layerWith(executor)` and `AI.fetchLayer` provide `AI` and the executor in one layer.
@@ -1417,8 +1424,9 @@ for await (const event of ai.experimental.speech.stream({ model, text: "Hello fr
1417
1424
1418
1425
Transcription (speech-to-text) is the one modality whose providers use every route kind: OpenAI and Gemini stream,
1419
1426
Deepgram and ElevenLabs answer inline, and AssemblyAI is queued. `Transcription.generate` and `Transcription.stream`
1420
-
work on all of them; `Transcription.start` / `resume` return a `Generation` on queued routes and fail with
1421
-
`UnsupportedOperation` elsewhere. Models come from the transcription APIs of the `OpenAI`, `Google`,
1427
+
work on all of them, polling queued routes like images and video. `Transcription.start`, `status`, `result` and `cancel`
1428
+
address a queued job by the provider's job ID, like video, and fail with `UnsupportedOperation` elsewhere; `cancel`
1429
+
also fails with it on AssemblyAI, which has no cancel endpoint. Models come from the transcription APIs of the `OpenAI`, `Google`,
1422
1430
`Deepgram`, `ElevenLabs`, and `AssemblyAI` facades. Common fields (`language`, `prompt`,
1423
1431
`timestamps: "none" | "segment" | "word"`, `diarize`, `speakers`) lower natively or fail with a typed `AIError` before
1424
1432
any network call; a route may return more than asked.
@@ -1455,11 +1463,11 @@ const program = Effect.gen(function* () {
1455
1463
Stream.runDrain,
1456
1464
)
1457
1465
1458
-
// Queued: persist the token with the provider and model ID (the token alone cannot pick the model), resume, and await.
1466
+
// Queued: persist the job ID with the provider and model ID (the ID alone cannot pick the model), then read it back.
1459
1467
const model =assemblyai({ apiKey }).model("universal-3-5-pro")
0 commit comments