Skip to content

Commit 2e96076

Browse files
authored
Strand -> Thread (#369)
1 parent 2fff24c commit 2e96076

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+618
-418
lines changed

.changeset/empty-foxes-turn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"liminal": minor
3+
---
4+
5+
Refactoring "strands" into "threads", which can provide a handle with which to operate on the thread context outside of the thread's sequencers arguments.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ An effect is a conversation.
2222
```ts
2323
import { FileSystem } from "@effect/platform"
2424
import { Effect } from "effect"
25-
import { L } from "liminal"
25+
import L from "liminal"
2626

2727
const conversation = Effect.gen(function*() {
2828
// Set system instruction.
@@ -55,7 +55,7 @@ const conversation = Effect.gen(function*() {
5555
// Re-append messages.
5656
yield* L.append(...messages)
5757
}).pipe(
58-
L.strand,
58+
L.thread,
5959
)
6060
```
6161

bun.lock

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/_logger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Console, Effect, flow } from "effect"
2-
import { L, LPretty } from "liminal"
2+
import L, { LPretty } from "liminal"
33

44
export const logger = L.listen(flow(
55
LPretty.event,

examples/_messages.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const SYSTEM = `
2+
Unless otherwise specified, do not ask follow-up questions; Always reply to the best of your ability using the information you have.
3+
`

examples/activity_suggestions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Effect, Schema } from "effect"
2-
import { L } from "liminal"
2+
import L from "liminal"
33
import { ModelLive } from "./_layers.ts"
44
import { logger } from "./_logger.ts"
55

@@ -23,7 +23,7 @@ Effect.gen(function*() {
2323
i++
2424
}
2525
}).pipe(
26-
L.strand,
26+
L.thread,
2727
Effect.scoped,
2828
Effect.provide(ModelLive),
2929
Effect.runFork,

examples/basic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Effect } from "effect"
2-
import { L } from "liminal"
2+
import L from "liminal"
33
import { ModelLive } from "./_layers.ts"
44
import { logger } from "./_logger.ts"
55

@@ -8,7 +8,7 @@ Effect.gen(function*() {
88
yield* L.user`Hey.`
99
yield* L.assistant
1010
}).pipe(
11-
L.strand,
11+
L.thread,
1212
Effect.provide(ModelLive),
1313
Effect.scoped,
1414
Effect.runFork,

examples/chaining.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Effect, Schema } from "effect"
2-
import { L } from "liminal"
2+
import L from "liminal"
33
import { ModelLive } from "./_layers.ts"
44
import { logger } from "./_logger.ts"
55

@@ -37,7 +37,7 @@ Effect.gen(function*() {
3737
}
3838
return { copy, qualityMetrics }
3939
}).pipe(
40-
L.strand,
40+
L.thread,
4141
Effect.scoped,
4242
Effect.provide(ModelLive),
4343
Effect.runFork,

examples/compare_models.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { OpenAiLanguageModel } from "@effect/ai-openai"
22
import { Console, Effect, Schema } from "effect"
3-
import { L } from "liminal"
3+
import L from "liminal"
44
import { ClientLive, ModelLive } from "./_layers.ts"
55
import { logger } from "./_logger.ts"
66

@@ -33,7 +33,7 @@ Effect.gen(function*() {
3333
Effect.flatMap((key) => Console.log(rewrites[key])),
3434
)
3535
}).pipe(
36-
L.strand,
36+
L.thread,
3737
Effect.scoped,
3838
Effect.provide([ModelLive, ClientLive]),
3939
Effect.runFork,

examples/documentation_qa.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Command, FileSystem } from "@effect/platform"
22
import { BunContext } from "@effect/platform-bun"
33
import { Effect, flow, Schema } from "effect"
44
import * as Console from "effect/Console"
5-
import { L } from "liminal"
5+
import L from "liminal"
66
import { ModelLive } from "./_layers.ts"
77

88
// TODO: use this for actual docs
@@ -46,7 +46,7 @@ Effect.gen(function*() {
4646

4747
yield* Console.log(suggestions)
4848
}).pipe(
49-
L.strand,
49+
L.thread,
5050
Effect.provide([ModelLive, BunContext.layer]),
5151
Effect.runFork,
5252
)

0 commit comments

Comments
 (0)