Skip to content

Commit d6fe173

Browse files
authored
Remove Handler and Use Export Paths (#335)
1 parent 768fde7 commit d6fe173

26 files changed

Lines changed: 125 additions & 153 deletions

.changeset/wicked-planets-guess.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+
Remove approach to passing handlers to strands.

.cursor/rules/style.mdc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.cursor/rules/tests.mdc

Lines changed: 0 additions & 16 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
"[css]": {
33
"editor.defaultFormatter": "dprint.dprint"
44
},
5-
"[dockercompose]": {
6-
"editor.defaultFormatter": "dprint.dprint"
7-
},
85
"[github-actions-workflow]": {
96
"editor.defaultFormatter": "dprint.dprint"
107
},
@@ -20,9 +17,6 @@
2017
"[markdown]": {
2118
"editor.defaultFormatter": "dprint.dprint"
2219
},
23-
"[sql]": {
24-
"editor.defaultFormatter": "dprint.dprint"
25-
},
2620
"[typescript]": {
2721
"editor.defaultFormatter": "dprint.dprint"
2822
},
@@ -33,21 +27,7 @@
3327
"editor.defaultFormatter": "dprint.dprint"
3428
},
3529
"editor.formatOnSave": true,
36-
"editor.quickSuggestions": {
37-
"strings": "on"
38-
},
3930
"editor.tabSize": 2,
4031
"dprint.path": "node_modules/.bin/dprint",
41-
"sqltools.connections": [
42-
{
43-
"server": "localhost",
44-
"port": 54321,
45-
"driver": "PostgreSQL",
46-
"name": "liminal",
47-
"database": "db",
48-
"username": "username",
49-
"password": "password"
50-
}
51-
],
52-
"typescript.preferences.autoImportSpecifierExcludeRegexes": ["^(node:)?os$"]
32+
"typescript.tsdk": "node_modules/typescript/lib"
5333
}

bun.lock

Lines changed: 43 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/_common.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
import { OpenAiClient, OpenAiLanguageModel } from "@effect/ai-openai"
1+
import * as OpenAiClient from "@effect/ai-openai/OpenAiClient"
2+
import * as OpenAiLanguageModel from "@effect/ai-openai/OpenAiLanguageModel"
23
import { FetchHttpClient } from "@effect/platform"
3-
import { Config, Effect, flow } from "effect"
4+
import * as Config from "effect/Config"
5+
import * as Effect from "effect/Effect"
6+
import { flow } from "effect/Function"
47

58
export const common = flow(
69
Effect.onError((cause) => Effect.logError(cause.toString())),

examples/activity_suggestions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Effect, Schema } from "effect"
1+
import * as Effect from "effect/Effect"
2+
import * as Schema from "effect/Schema"
23
import { L, strand } from "liminal"
34
import { common } from "./_common.ts"
45

examples/chaining.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Console, Effect, Schema } from "effect"
1+
import * as Effect from "effect/Effect"
2+
import * as Schema from "effect/Schema"
23
import { L, strand } from "liminal"
34
import { common } from "./_common"
45

56
await Effect.gen(function*() {
6-
console.log("Here")
77
yield* L.user`Please generate the first draft.`
88
let copy = yield* L.assistant()
99
yield* L.user`
@@ -36,7 +36,6 @@ await Effect.gen(function*() {
3636
}).pipe(
3737
strand({
3838
system: `Write persuasive marketing copy for: Buffy The Vampire Slayer. Focus on benefits and emotional appeal.`,
39-
handler: Console.log,
4039
}),
4140
common,
4241
Effect.runPromise,

examples/compare_models.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { OpenAiLanguageModel } from "@effect/ai-openai"
2-
import { Effect, Schema } from "effect"
2+
import * as Effect from "effect/Effect"
3+
import * as Schema from "effect/Schema"
34
import { L, strand } from "liminal"
45
import { common } from "./_common.ts"
56

examples/optimizer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Effect, Schema } from "effect"
1+
import * as Effect from "effect/Effect"
2+
import * as Schema from "effect/Schema"
23
import { L, strand } from "liminal"
34
import { common } from "./_common.ts"
45

0 commit comments

Comments
 (0)