@dxos/assistant 0.8.4-main.67995b8 → 0.8.4-main.a4bbb77

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.
Files changed (166) hide show
  1. package/dist/lib/browser/chunk-ILL2CN3G.mjs +374 -0
  2. package/dist/lib/browser/chunk-ILL2CN3G.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-6WRGDEMH.mjs → chunk-UB26N5UF.mjs} +2 -2
  4. package/dist/lib/browser/chunk-UB26N5UF.mjs.map +7 -0
  5. package/dist/lib/browser/extraction/index.mjs +32 -29
  6. package/dist/lib/browser/extraction/index.mjs.map +4 -4
  7. package/dist/lib/browser/index.mjs +682 -1035
  8. package/dist/lib/browser/index.mjs.map +4 -4
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/{named-entity-recognition-O46UTCLR.mjs → named-entity-recognition-QPYHML66.mjs} +2 -2
  11. package/dist/lib/node-esm/{chunk-3UU5V4FS.mjs → chunk-BCFXTNSK.mjs} +2 -2
  12. package/dist/lib/node-esm/chunk-BCFXTNSK.mjs.map +7 -0
  13. package/dist/lib/node-esm/chunk-GVKA7VL3.mjs +376 -0
  14. package/dist/lib/node-esm/chunk-GVKA7VL3.mjs.map +7 -0
  15. package/dist/lib/node-esm/extraction/index.mjs +32 -29
  16. package/dist/lib/node-esm/extraction/index.mjs.map +4 -4
  17. package/dist/lib/node-esm/index.mjs +682 -1035
  18. package/dist/lib/node-esm/index.mjs.map +4 -4
  19. package/dist/lib/node-esm/meta.json +1 -1
  20. package/dist/lib/node-esm/{named-entity-recognition-W4VMRCH6.mjs → named-entity-recognition-2HDF46YX.mjs} +2 -2
  21. package/dist/types/src/{context/binding.d.ts → conversation/context.d.ts} +45 -3
  22. package/dist/types/src/conversation/context.d.ts.map +1 -0
  23. package/dist/types/src/conversation/conversation.d.ts +24 -21
  24. package/dist/types/src/conversation/conversation.d.ts.map +1 -1
  25. package/dist/types/src/conversation/index.d.ts +1 -0
  26. package/dist/types/src/conversation/index.d.ts.map +1 -1
  27. package/dist/types/src/diff.d.ts +15 -0
  28. package/dist/types/src/diff.d.ts.map +1 -0
  29. package/dist/types/src/diff.test.d.ts +2 -0
  30. package/dist/types/src/diff.test.d.ts.map +1 -0
  31. package/dist/types/src/errors.d.ts +46 -9
  32. package/dist/types/src/errors.d.ts.map +1 -1
  33. package/dist/types/src/execution-graph.d.ts +82 -0
  34. package/dist/types/src/execution-graph.d.ts.map +1 -0
  35. package/dist/types/src/execution-graph.test.d.ts +2 -0
  36. package/dist/types/src/execution-graph.test.d.ts.map +1 -0
  37. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +1 -1
  38. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +1 -1
  39. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +94 -55
  40. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -1
  41. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
  42. package/dist/types/src/extraction/extraction.d.ts +250 -216
  43. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  44. package/dist/types/src/functions/services.d.ts +15 -3
  45. package/dist/types/src/functions/services.d.ts.map +1 -1
  46. package/dist/types/src/index.d.ts +3 -2
  47. package/dist/types/src/index.d.ts.map +1 -1
  48. package/dist/types/src/session/artifact-diff.d.ts +27 -0
  49. package/dist/types/src/session/artifact-diff.d.ts.map +1 -0
  50. package/dist/types/src/session/error-handling.d.ts +4 -0
  51. package/dist/types/src/session/error-handling.d.ts.map +1 -0
  52. package/dist/types/src/session/format.d.ts +184 -0
  53. package/dist/types/src/session/format.d.ts.map +1 -0
  54. package/dist/types/src/session/format.test.d.ts +2 -0
  55. package/dist/types/src/session/format.test.d.ts.map +1 -0
  56. package/dist/types/src/session/index.d.ts +3 -0
  57. package/dist/types/src/session/index.d.ts.map +1 -1
  58. package/dist/types/src/session/observer.d.ts +22 -0
  59. package/dist/types/src/session/observer.d.ts.map +1 -0
  60. package/dist/types/src/session/session.d.ts +23 -236
  61. package/dist/types/src/session/session.d.ts.map +1 -1
  62. package/dist/types/src/session/toolkit.d.ts +14 -0
  63. package/dist/types/src/session/toolkit.d.ts.map +1 -0
  64. package/dist/types/src/session/version-pin.d.ts +2 -2
  65. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  66. package/dist/types/src/templates/index.d.ts +1 -1
  67. package/dist/types/src/templates/system.d.ts +18 -0
  68. package/dist/types/src/templates/system.d.ts.map +1 -0
  69. package/dist/types/src/types.d.ts +3 -0
  70. package/dist/types/src/types.d.ts.map +1 -1
  71. package/dist/types/tsconfig.tsbuildinfo +1 -1
  72. package/package.json +34 -33
  73. package/src/conversation/context.ts +154 -0
  74. package/src/conversation/conversation.ts +76 -53
  75. package/src/conversation/index.ts +1 -0
  76. package/src/diff.test.ts +43 -0
  77. package/src/diff.ts +79 -0
  78. package/src/errors.ts +6 -1
  79. package/src/execution-graph.test.ts +738 -0
  80. package/src/execution-graph.ts +500 -0
  81. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +8 -7
  82. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +12 -10
  83. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +9 -9
  84. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +13 -6
  85. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +2 -1
  86. package/src/extraction/extraction-ner-function/named-entity-recognition.ts +2 -0
  87. package/src/extraction/quotes.test.ts +3 -3
  88. package/src/extraction/quotes.ts +2 -2
  89. package/src/functions/services.ts +97 -43
  90. package/src/index.ts +3 -2
  91. package/src/session/artifact-diff.ts +41 -0
  92. package/src/session/error-handling.ts +40 -0
  93. package/src/session/format.test.ts +60 -0
  94. package/src/session/format.ts +139 -0
  95. package/src/session/index.ts +3 -0
  96. package/src/session/observer.ts +58 -0
  97. package/src/session/session.conversations.json +1 -0
  98. package/src/session/session.test.ts +33 -197
  99. package/src/session/session.ts +119 -249
  100. package/src/session/toolkit.ts +46 -0
  101. package/src/session/version-pin.ts +4 -4
  102. package/src/summarization/summarization.test.ts +9 -7
  103. package/src/templates/format.tpl +60 -0
  104. package/src/templates/index.ts +1 -1
  105. package/src/templates/system.tpl +48 -0
  106. package/src/templates/system.ts +41 -0
  107. package/src/types.ts +10 -5
  108. package/src/typings.d.ts +5 -0
  109. package/dist/lib/browser/chunk-6WRGDEMH.mjs.map +0 -7
  110. package/dist/lib/browser/chunk-SIXTNSGV.mjs +0 -250
  111. package/dist/lib/browser/chunk-SIXTNSGV.mjs.map +0 -7
  112. package/dist/lib/node-esm/chunk-3UU5V4FS.mjs.map +0 -7
  113. package/dist/lib/node-esm/chunk-FD5NXKDP.mjs +0 -252
  114. package/dist/lib/node-esm/chunk-FD5NXKDP.mjs.map +0 -7
  115. package/dist/types/bin/chat.d.ts +0 -2
  116. package/dist/types/bin/chat.d.ts.map +0 -1
  117. package/dist/types/src/context/binder.d.ts +0 -34
  118. package/dist/types/src/context/binder.d.ts.map +0 -1
  119. package/dist/types/src/context/binding.d.ts.map +0 -1
  120. package/dist/types/src/context/index.d.ts +0 -3
  121. package/dist/types/src/context/index.d.ts.map +0 -1
  122. package/dist/types/src/research/exa.d.ts +0 -12
  123. package/dist/types/src/research/exa.d.ts.map +0 -1
  124. package/dist/types/src/research/graph.d.ts +0 -51
  125. package/dist/types/src/research/graph.d.ts.map +0 -1
  126. package/dist/types/src/research/graph.test.d.ts +0 -2
  127. package/dist/types/src/research/graph.test.d.ts.map +0 -1
  128. package/dist/types/src/research/index.d.ts +0 -4
  129. package/dist/types/src/research/index.d.ts.map +0 -1
  130. package/dist/types/src/research/research.d.ts +0 -10
  131. package/dist/types/src/research/research.d.ts.map +0 -1
  132. package/dist/types/src/research/research.test.d.ts +0 -2
  133. package/dist/types/src/research/research.test.d.ts.map +0 -1
  134. package/dist/types/src/session/version-pin.test.d.ts +0 -2
  135. package/dist/types/src/session/version-pin.test.d.ts.map +0 -1
  136. package/dist/types/src/templates/prompt.d.ts +0 -30
  137. package/dist/types/src/templates/prompt.d.ts.map +0 -1
  138. package/dist/types/src/testing/exa-search-1748337321991.d.ts +0 -38
  139. package/dist/types/src/testing/exa-search-1748337321991.d.ts.map +0 -1
  140. package/dist/types/src/testing/exa-search-1748337331526.d.ts +0 -37
  141. package/dist/types/src/testing/exa-search-1748337331526.d.ts.map +0 -1
  142. package/dist/types/src/testing/exa-search-1748337344119.d.ts +0 -58
  143. package/dist/types/src/testing/exa-search-1748337344119.d.ts.map +0 -1
  144. package/dist/types/src/testing/index.d.ts +0 -3
  145. package/dist/types/src/testing/index.d.ts.map +0 -1
  146. package/src/context/binder.ts +0 -103
  147. package/src/context/binding.ts +0 -32
  148. package/src/context/index.ts +0 -6
  149. package/src/research/exa.ts +0 -97
  150. package/src/research/graph.test.ts +0 -64
  151. package/src/research/graph.ts +0 -369
  152. package/src/research/index.ts +0 -7
  153. package/src/research/instructions-research.tpl +0 -98
  154. package/src/research/research.test.ts +0 -190
  155. package/src/research/research.ts +0 -87
  156. package/src/session/__snapshots__/session.test.ts.snap +0 -32
  157. package/src/session/version-pin.test.ts +0 -7
  158. package/src/templates/assistant.tpl +0 -111
  159. package/src/templates/prompt.ts +0 -45
  160. package/src/testing/exa-search-1748337321991.ts +0 -131
  161. package/src/testing/exa-search-1748337331526.ts +0 -144
  162. package/src/testing/exa-search-1748337344119.ts +0 -133
  163. package/src/testing/index.ts +0 -11
  164. package/src/typedefs.d.ts +0 -8
  165. /package/dist/lib/browser/{named-entity-recognition-O46UTCLR.mjs.map → named-entity-recognition-QPYHML66.mjs.map} +0 -0
  166. /package/dist/lib/node-esm/{named-entity-recognition-W4VMRCH6.mjs.map → named-entity-recognition-2HDF46YX.mjs.map} +0 -0
@@ -1,58 +0,0 @@
1
- declare const _default: {
2
- requestId: string;
3
- autopromptString: string;
4
- autoDate: string;
5
- resolvedSearchType: string;
6
- results: ({
7
- id: string;
8
- title: string;
9
- url: string;
10
- publishedDate: string;
11
- author: string;
12
- score: number;
13
- text: string;
14
- favicon: string;
15
- image?: undefined;
16
- } | {
17
- id: string;
18
- title: string;
19
- url: string;
20
- publishedDate: string;
21
- author: string;
22
- score: number;
23
- text: string;
24
- favicon?: undefined;
25
- image?: undefined;
26
- } | {
27
- id: string;
28
- title: string;
29
- url: string;
30
- publishedDate: string;
31
- author: string;
32
- score: number;
33
- text: string;
34
- image: string;
35
- favicon: string;
36
- } | {
37
- id: string;
38
- title: string;
39
- url: string;
40
- author: string;
41
- text: string;
42
- image: string;
43
- favicon: string;
44
- publishedDate?: undefined;
45
- score?: undefined;
46
- })[];
47
- costDollars: {
48
- total: number;
49
- search: {
50
- neural: number;
51
- };
52
- contents: {
53
- text: number;
54
- };
55
- };
56
- };
57
- export default _default;
58
- //# sourceMappingURL=exa-search-1748337344119.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exa-search-1748337344119.d.ts","sourceRoot":"","sources":["../../../../src/testing/exa-search-1748337344119.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAgIE"}
@@ -1,3 +0,0 @@
1
- import type { SearchResponse } from 'exa-js';
2
- export declare const SEARCH_RESULTS: SearchResponse<any>[];
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAM7C,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,GAAG,CAAC,EAAgC,CAAC"}
@@ -1,103 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { computed, type ReadonlySignal } from '@preact/signals-core';
6
- import { Array, pipe } from 'effect';
7
-
8
- import { type Blueprint } from '@dxos/blueprints';
9
- import { Obj, type Type, type Ref, type Relation } from '@dxos/echo';
10
- import { type Queue } from '@dxos/echo-db';
11
- import { ComplexSet } from '@dxos/util';
12
-
13
- import { ContextBinding } from './binding';
14
-
15
- /**
16
- * Manages bindings of blueprints and objects to a conversation.
17
- */
18
- export class ContextBinder {
19
- constructor(private readonly _queue: Queue) {}
20
-
21
- /**
22
- * Reactive query of all bindings.
23
- */
24
- // TODO(burdon): Cache value?
25
- readonly bindings: ReadonlySignal<Bindings> = computed(() => this._reduce(this._queue.objects));
26
-
27
- // TODO(burdon): load refs?
28
- readonly blueprints: ReadonlySignal<Ref.Ref<Blueprint.Blueprint>[]> = computed(() => [
29
- ...this.bindings.value.blueprints,
30
- ]);
31
- readonly objects: ReadonlySignal<Ref.Ref<Type.Expando>[]> = computed(() => [...this.bindings.value.objects]);
32
-
33
- /**
34
- * Asynchronous query of all bindings.
35
- */
36
- async query(): Promise<Bindings> {
37
- const queueItems = await this._queue.queryObjects();
38
- return this._reduce(queueItems);
39
- }
40
-
41
- // TODO(burdon): Pass in Blueprint obj (from registry?) and create reference.
42
- async bind(props: BindingProps): Promise<void> {
43
- if (!props.blueprints?.length && !props.objects?.length) {
44
- return;
45
- }
46
-
47
- await this._queue.append([
48
- Obj.make(ContextBinding, {
49
- blueprints: {
50
- added: props.blueprints ?? [],
51
- removed: [],
52
- },
53
- objects: {
54
- added: props.objects ?? [],
55
- removed: [],
56
- },
57
- }),
58
- ]);
59
- }
60
-
61
- async unbind(props: BindingProps): Promise<void> {
62
- if (!props.blueprints?.length && !props.objects?.length) {
63
- return;
64
- }
65
-
66
- await this._queue.append([
67
- Obj.make(ContextBinding, {
68
- blueprints: {
69
- added: [],
70
- removed: props.blueprints ?? [],
71
- },
72
- objects: {
73
- added: [],
74
- removed: props.objects ?? [],
75
- },
76
- }),
77
- ]);
78
- }
79
-
80
- private _reduce(items: (Obj.Any | Relation.Any)[]): Bindings {
81
- return pipe(
82
- items,
83
- Array.filter(Obj.instanceOf(ContextBinding)),
84
- Array.reduce(new Bindings(), (context, item) => {
85
- item.blueprints.removed.forEach((item) => context.blueprints.delete(item));
86
- item.blueprints.added.forEach((item) => context.blueprints.add(item));
87
- item.objects.removed.forEach((item) => context.objects.delete(item));
88
- item.objects.added.forEach((item) => context.objects.add(item));
89
- return context;
90
- }),
91
- );
92
- }
93
- }
94
-
95
- export type BindingProps = Partial<{
96
- blueprints: Ref.Ref<Blueprint.Blueprint>[];
97
- objects: Ref.Ref<Type.Expando>[];
98
- }>;
99
-
100
- export class Bindings {
101
- blueprints = new ComplexSet<Ref.Ref<Blueprint.Blueprint>>((ref) => ref.dxn.toString());
102
- objects = new ComplexSet<Ref.Ref<Type.Expando>>((ref) => ref.dxn.toString());
103
- }
@@ -1,32 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Schema } from 'effect';
6
-
7
- import { Blueprint } from '@dxos/blueprints';
8
- import { Type } from '@dxos/echo';
9
-
10
- /**
11
- * Thread message that binds or unbinds contextual objects to a conversation.
12
- */
13
- // TODO(burdon): Make ContentBlock.
14
- export const ContextBinding = Schema.Struct({
15
- blueprints: Schema.Struct({
16
- added: Schema.Array(Type.Ref(Blueprint.Blueprint)),
17
- removed: Schema.Array(Type.Ref(Blueprint.Blueprint)),
18
- }),
19
-
20
- // TODO(burdon): Type.Expando => Type.Obj (or Obj.Any?)
21
- objects: Schema.Struct({
22
- added: Schema.Array(Type.Ref(Type.Expando)),
23
- removed: Schema.Array(Type.Ref(Type.Expando)),
24
- }),
25
- }).pipe(
26
- Type.Obj({
27
- typename: 'dxos.org/type/ContextBinding',
28
- version: '0.1.0',
29
- }),
30
- );
31
-
32
- export interface ContextBinding extends Schema.Schema.Type<typeof ContextBinding> {}
@@ -1,6 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- export * from './binder';
6
- export * from './binding';
@@ -1,97 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { AiTool, AiToolkit } from '@effect/ai';
6
- import { Effect, Schema } from 'effect';
7
- import Exa from 'exa-js';
8
-
9
- import { CredentialsService } from '@dxos/functions';
10
- import { log } from '@dxos/log';
11
-
12
- import { SEARCH_RESULTS } from '../testing';
13
-
14
- export class ExaToolkit extends AiToolkit.make(
15
- AiTool.make('exa_search', {
16
- description: 'Search the web for information',
17
- parameters: {
18
- query: Schema.String.annotations({ description: 'The query to search for' }),
19
- },
20
- success: Schema.Unknown,
21
- failure: Schema.Never,
22
- }).addRequirement<CredentialsService>(),
23
- ) {}
24
-
25
- export const LiveExaHandler = ExaToolkit.toLayer({
26
- exa_search: Effect.fn(function* ({ query }) {
27
- const credential = yield* CredentialsService.getCredential({ service: 'exa.ai' });
28
- const exa = new Exa(credential.apiKey);
29
-
30
- const context = yield* Effect.promise(async () =>
31
- exa.searchAndContents(query, {
32
- type: 'auto',
33
- text: {
34
- maxCharacters: 3_000,
35
- },
36
- livecrawl: 'always',
37
- }),
38
- );
39
-
40
- log.info('exa search', { query, costDollars: context.costDollars });
41
-
42
- return context;
43
- }),
44
- });
45
-
46
- export const MockExaHandler = ExaToolkit.toLayer({
47
- exa_search: Effect.fn(function* ({ query }) {
48
- // Find result with closest matching autoprompt using weighted Levenshtein distance
49
- const result = SEARCH_RESULTS.reduce(
50
- (closest, current) => {
51
- if (!current.autopromptString) {
52
- return closest;
53
- }
54
- if (!closest) {
55
- return current;
56
- }
57
-
58
- // Calculate Levenshtein distance
59
- const dist1 = levenshteinDistance(query, current.autopromptString);
60
- const dist2 = levenshteinDistance(query, closest.autopromptString || '');
61
-
62
- // Weight by length of the longer string to normalize
63
- const weight1 = dist1 / Math.max(query.length, current.autopromptString.length);
64
- const weight2 = dist2 / Math.max(query.length, closest.autopromptString?.length || 0);
65
-
66
- return weight1 < weight2 ? current : closest;
67
- },
68
- null as (typeof SEARCH_RESULTS)[0] | null,
69
- );
70
-
71
- return result;
72
- }),
73
- });
74
-
75
- const levenshteinDistance = (str1: string, str2: string): number => {
76
- const m = str1.length;
77
- const n = str2.length;
78
- const dp: number[][] = Array(m + 1)
79
- .fill(null)
80
- .map(() => Array(n + 1).fill(0));
81
-
82
- for (let i = 0; i <= m; i++) {
83
- dp[i][0] = i;
84
- }
85
- for (let j = 0; j <= n; j++) {
86
- dp[0][j] = j;
87
- }
88
-
89
- for (let i = 1; i <= m; i++) {
90
- for (let j = 1; j <= n; j++) {
91
- dp[i][j] =
92
- str1[i - 1] === str2[j - 1] ? dp[i - 1][j - 1] : Math.min(dp[i - 1][j - 1], dp[i - 1][j], dp[i][j - 1]) + 1;
93
- }
94
- }
95
-
96
- return dp[m][n];
97
- };
@@ -1,64 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { AnthropicClient } from '@effect/ai-anthropic';
6
- import { FetchHttpClient } from '@effect/platform';
7
- import { describe, it } from '@effect/vitest';
8
- import { Config, Effect, Layer, pipe } from 'effect';
9
-
10
- import { AiService, AiServiceRouter, ToolExecutionService, ToolResolverService } from '@dxos/ai';
11
- import { tapHttpErrors } from '@dxos/ai/testing';
12
- import { TestHelpers } from '@dxos/effect';
13
- import { DatabaseService } from '@dxos/functions';
14
- import { log } from '@dxos/log';
15
- import { DataType } from '@dxos/schema';
16
-
17
- import { makeGraphWriterHandler, makeGraphWriterToolkit } from './graph';
18
- import { AiSession } from '../session';
19
-
20
- // import { type EchoTestBuilder } from '@dxos/echo-db/testing';
21
-
22
- const TestLayer = pipe(
23
- AiService.model('@anthropic/claude-3-5-sonnet-20241022'),
24
- Layer.provideMerge(DatabaseService.notAvailable),
25
- Layer.provideMerge(ToolResolverService.layerEmpty),
26
- Layer.provideMerge(ToolExecutionService.layerEmpty),
27
- Layer.provide(AiServiceRouter.AiServiceRouter),
28
- Layer.provide(
29
- AnthropicClient.layerConfig({
30
- apiKey: Config.redacted('ANTHROPIC_API_KEY'),
31
- transformClient: tapHttpErrors,
32
- }),
33
- ),
34
- Layer.provide(FetchHttpClient.layer),
35
- );
36
-
37
- describe('graph', () => {
38
- // let builder: EchoTestBuilder;
39
- // test('findRelatedSchema', async () => {
40
- // const db = await createEchoDatabase();
41
- // const relatedSchemas = await findRelatedSchema(db, Schema.Struct({}));
42
- // });
43
-
44
- it.effect.skip(
45
- 'calculator',
46
- Effect.fn(
47
- function* ({ expect }) {
48
- const graphWriteToolkit = makeGraphWriterToolkit({ schema: [DataType.Project] });
49
-
50
- const session = new AiSession();
51
- const response = yield* session
52
- .run({
53
- prompt: 'What is 10 + 20?',
54
- history: [],
55
- toolkit: graphWriteToolkit,
56
- })
57
- .pipe(Effect.provide(makeGraphWriterHandler(graphWriteToolkit)));
58
- log.info('response', { response });
59
- },
60
- Effect.provide(TestLayer),
61
- TestHelpers.runIf(process.env.ANTHROPIC_API_KEY),
62
- ),
63
- );
64
- });