effect-uai 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +145 -0
- package/README.md +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,150 @@
|
|
|
1
1
|
# effect-uai
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a332f0a: 0.6 bundles one large-but-mechanical naming sweep with a set of
|
|
8
|
+
additive features. The breaking part is source-level only — **the wire
|
|
9
|
+
format is unchanged** (`function_call` / `function_call_output` still
|
|
10
|
+
go out on the wire, so no provider payloads change). Almost every
|
|
11
|
+
rewrite is find-and-replace; the full before/after diffs and the
|
|
12
|
+
recommended order live in [Migrating to 0.6](https://effect-uai.betalyra.com/migrations/v0-6/).
|
|
13
|
+
|
|
14
|
+
### Breaking: "function call" → "tool call" terminology
|
|
15
|
+
|
|
16
|
+
Every public name that said "function call" now says "tool call":
|
|
17
|
+
- `Item` → `HistoryItem`; `FunctionCall` → `ToolCall`;
|
|
18
|
+
`FunctionCallOutput` → `ToolCallOutput`.
|
|
19
|
+
- `Items.functionCallOutput` → `Items.toolCallOutput`;
|
|
20
|
+
`Items.isFunctionCall` → `Items.isToolCall`;
|
|
21
|
+
`Items.isFunctionCallOutput` → `Items.isToolCallOutput`.
|
|
22
|
+
- `Turn.functionCalls` → `Turn.getToolCalls`.
|
|
23
|
+
|
|
24
|
+
### Breaking: module renames
|
|
25
|
+
- `@effect-uai/core/Outcome` → `@effect-uai/core/ToolResult`. Also
|
|
26
|
+
`ToolResult.Value` → `ToolResult.Ok`, `isValue` → `isOk`,
|
|
27
|
+
`rejected(...)` → `failed(...)`, `toFunctionCallOutput` →
|
|
28
|
+
`toToolCallOutput`.
|
|
29
|
+
- `@effect-uai/core/Resolvers` → `@effect-uai/core/Approval`. Also
|
|
30
|
+
`fromApprovalMap` → `fromMap`, `fromVerdictQueue` → `fromQueue`,
|
|
31
|
+
`ToolCallDecision` → `ApprovalDecision`, and the queue helper's
|
|
32
|
+
`announce` field → `approvalRequests`.
|
|
33
|
+
|
|
34
|
+
### Breaking: Turn / Toolkit / Tool / ToolEvent renames
|
|
35
|
+
- `Turn.appendTurn` → `Turn.appendToHistory`.
|
|
36
|
+
- `Turn.toStructured` → `Turn.decodeStructured`.
|
|
37
|
+
- `Toolkit.executeAll` → `Toolkit.run`.
|
|
38
|
+
- `Toolkit.continueWith` → `Toolkit.continueWithResults`.
|
|
39
|
+
- `Toolkit.make(...)` + `Toolkit.toDescriptors(kit)` → just
|
|
40
|
+
`Tool.toDescriptors([...])`. The homogeneous-toolkit wrapper is gone.
|
|
41
|
+
- `Tool.AnyKindTool` → `Tool.AnyTool`.
|
|
42
|
+
- `ToolEvent.Intermediate` → `ToolEvent.Progress`;
|
|
43
|
+
`isIntermediate` → `isProgress`.
|
|
44
|
+
|
|
45
|
+
### Breaking: Loop helper trim
|
|
46
|
+
- `Loop.loopFrom(...)` → `Loop.loopOver(...)`.
|
|
47
|
+
- `Loop.Event<A, S>` → `Loop.Step<A, S>`.
|
|
48
|
+
- `return stop` → `return stop()`.
|
|
49
|
+
- `Loop.stopWith(state)` → `Loop.stop(state)`.
|
|
50
|
+
- `nextAfter` / `stopAfter` / `stopWithAfter` / `stopEvent` /
|
|
51
|
+
`nextAfterFold` are removed — compose with `Stream.concat` instead.
|
|
52
|
+
See the migration doc for one-line replacements.
|
|
53
|
+
|
|
54
|
+
### Additive: new Toolkit / Loop helpers
|
|
55
|
+
- `Toolkit.appendToolResults(state, turn)` — shorthand for the canonical
|
|
56
|
+
`continueWithResults` body that folds tool results into history.
|
|
57
|
+
- `Toolkit.collectResults` — lower-level drain of a `Stream<ToolEvent>`
|
|
58
|
+
to its `ToolResult`s without advancing the loop.
|
|
59
|
+
- `Loop.emitValues(stream)` / `Loop.emitNext(effect)` — fork-helper
|
|
60
|
+
building blocks behind `Toolkit.continueWithResults`.
|
|
61
|
+
|
|
62
|
+
### Additive: sandboxes
|
|
63
|
+
|
|
64
|
+
A new `Sandbox` capability in `@effect-uai/core/sandbox` for running
|
|
65
|
+
untrusted code, commands, or LLM-generated scripts inside an isolated
|
|
66
|
+
microVM. Two new provider packages ship behind the same
|
|
67
|
+
`SandboxService`:
|
|
68
|
+
- **`@effect-uai/microsandbox`** — local Firecracker microVMs via
|
|
69
|
+
[microsandbox](https://github.com/microsandbox/microsandbox).
|
|
70
|
+
- **`@effect-uai/deno`** — hosted Firecracker microVMs on
|
|
71
|
+
[Deno Deploy](https://docs.deno.com/deploy/).
|
|
72
|
+
|
|
73
|
+
Both cover `create` / `exec` / `execStream` / volumes / snapshots /
|
|
74
|
+
network policies / bound secrets / OCI image references. The
|
|
75
|
+
`recipes-extras/sandbox-code-interpreter` recipe shows the "run, fix,
|
|
76
|
+
repeat" pattern.
|
|
77
|
+
|
|
78
|
+
### Additive: new recipes
|
|
79
|
+
- `sleeper-agent` — long-lived background agent waking on scheduled
|
|
80
|
+
triggers.
|
|
81
|
+
- `external-task-polling` — drive the loop from an external task
|
|
82
|
+
queue.
|
|
83
|
+
- `sandbox-code-interpreter` (in `recipes-extras/`) — agent writes
|
|
84
|
+
Python, sandbox runs it, stderr feeds back into the next turn.
|
|
85
|
+
|
|
86
|
+
## 0.5.2
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- 1509883: Two related refactors. Both are breaking but mechanical — a one-line
|
|
91
|
+
rewrite per affected call site.
|
|
92
|
+
|
|
93
|
+
### `Retry` is its own module
|
|
94
|
+
|
|
95
|
+
`LanguageModel.retry` and `LanguageModel.Retryable` were not
|
|
96
|
+
LanguageModel-specific — the implementation was a generic `AiError`
|
|
97
|
+
combinator. Hoisted out into `@effect-uai/core/Retry`, with two
|
|
98
|
+
carriers so it covers every model surface:
|
|
99
|
+
- `Retry.stream(schedule)` — for `Stream<A, AiError, R>` (`streamTurn`,
|
|
100
|
+
`streamSynthesis`, `streamTranscriptionFrom`).
|
|
101
|
+
- `Retry.effect(schedule)` — for `Effect<A, AiError, R>` (`turn`,
|
|
102
|
+
`embed`, `embedMany`, `synthesize`, `transcribe`).
|
|
103
|
+
|
|
104
|
+
Both gate on the `RateLimited | Unavailable | Timeout` subset; other
|
|
105
|
+
`AiError`s propagate unchanged. The namespace deliberately doesn't
|
|
106
|
+
shadow Effect's own `Stream.retry` / `Effect.retry`.
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
// Before
|
|
110
|
+
import { retry } from "@effect-uai/core/LanguageModel";
|
|
111
|
+
streamTurn(req).pipe(retry(schedule));
|
|
112
|
+
|
|
113
|
+
// After
|
|
114
|
+
import * as Retry from "@effect-uai/core/Retry";
|
|
115
|
+
streamTurn(req).pipe(Retry.stream(schedule));
|
|
116
|
+
embed(req).pipe(Retry.effect(schedule));
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
`Retryable` and `isRetryable` move to the same module.
|
|
120
|
+
|
|
121
|
+
### `turn` is now on `LanguageModelService`
|
|
122
|
+
|
|
123
|
+
`turn(request): Effect<Turn, AiError>` is now a method on the service
|
|
124
|
+
alongside `streamTurn`. Providers without a native non-streaming
|
|
125
|
+
endpoint derive it from `streamTurn` via the new
|
|
126
|
+
`LanguageModel.turnFromStream(streamTurn)` helper; providers with a
|
|
127
|
+
native complete endpoint can override.
|
|
128
|
+
|
|
129
|
+
The top-level `LanguageModel.turn(request)` helper is unchanged at
|
|
130
|
+
call sites — it now delegates to the service method instead of
|
|
131
|
+
draining `streamTurn` inline.
|
|
132
|
+
|
|
133
|
+
Hand-rolled `LanguageModelService` values (most commonly in tests)
|
|
134
|
+
must now supply a `turn` field. Use `turnFromStream`:
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
// Before
|
|
138
|
+
const service: LanguageModelService = {
|
|
139
|
+
streamTurn: () => Stream.fromIterable([...]),
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// After
|
|
143
|
+
import { turnFromStream } from "@effect-uai/core/LanguageModel"
|
|
144
|
+
const streamTurn: LanguageModelService["streamTurn"] = () => Stream.fromIterable([...])
|
|
145
|
+
const service: LanguageModelService = { streamTurn, turn: turnFromStream(streamTurn) }
|
|
146
|
+
```
|
|
147
|
+
|
|
3
148
|
## 0.5.1
|
|
4
149
|
|
|
5
150
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -19,5 +19,9 @@ packages live under the `@effect-uai/*` scope:
|
|
|
19
19
|
Inworld speech.
|
|
20
20
|
- [`@effect-uai/jina`](https://www.npmjs.com/package/@effect-uai/jina) —
|
|
21
21
|
Jina embeddings (dense / sparse / multivector).
|
|
22
|
+
- [`@effect-uai/microsandbox`](https://www.npmjs.com/package/@effect-uai/microsandbox) —
|
|
23
|
+
Local microVM sandboxes via [microsandbox](https://github.com/microsandbox/microsandbox).
|
|
24
|
+
- [`@effect-uai/deno`](https://www.npmjs.com/package/@effect-uai/deno) —
|
|
25
|
+
Hosted Firecracker microVMs on Deno Deploy.
|
|
22
26
|
|
|
23
27
|
Project repository: https://github.com/betalyra/effect-uai
|
package/package.json
CHANGED