@effect/ai 0.17.0 → 0.18.1
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/dist/cjs/AiModel.js +17 -29
- package/dist/cjs/AiModel.js.map +1 -1
- package/dist/cjs/index.js +1 -3
- package/dist/dts/AiModel.d.ts +3 -40
- package/dist/dts/AiModel.d.ts.map +1 -1
- package/dist/dts/index.d.ts +0 -4
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/esm/AiModel.js +16 -28
- package/dist/esm/AiModel.js.map +1 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +1 -1
- package/package.json +4 -12
- package/src/AiModel.ts +21 -77
- package/src/index.ts +0 -5
- package/AiPlan/package.json +0 -6
- package/dist/cjs/AiPlan.js +0 -36
- package/dist/cjs/AiPlan.js.map +0 -1
- package/dist/cjs/internal/aiPlan.js +0 -88
- package/dist/cjs/internal/aiPlan.js.map +0 -1
- package/dist/dts/AiPlan.d.ts +0 -190
- package/dist/dts/AiPlan.d.ts.map +0 -1
- package/dist/dts/internal/aiPlan.d.ts +0 -2
- package/dist/dts/internal/aiPlan.d.ts.map +0 -1
- package/dist/esm/AiPlan.js +0 -28
- package/dist/esm/AiPlan.js.map +0 -1
- package/dist/esm/internal/aiPlan.js +0 -80
- package/dist/esm/internal/aiPlan.js.map +0 -1
- package/src/AiPlan.ts +0 -224
- package/src/internal/aiPlan.ts +0 -162
package/dist/cjs/AiModel.js
CHANGED
|
@@ -3,47 +3,35 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.make = exports.TypeId =
|
|
6
|
+
exports.make = exports.TypeId = void 0;
|
|
7
7
|
var Effect = _interopRequireWildcard(require("effect/Effect"));
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var InternalAiPlan = _interopRequireWildcard(require("./internal/aiPlan.js"));
|
|
8
|
+
var _Effectable = require("effect/Effectable");
|
|
9
|
+
var _Function = require("effect/Function");
|
|
10
|
+
var Layer = _interopRequireWildcard(require("effect/Layer"));
|
|
12
11
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
12
|
/**
|
|
14
13
|
* @since 1.0.0
|
|
15
14
|
* @category type ids
|
|
16
15
|
*/
|
|
17
16
|
const TypeId = exports.TypeId = /*#__PURE__*/Symbol.for("@effect/ai/AiModel");
|
|
18
|
-
/**
|
|
19
|
-
* @since 1.0.0
|
|
20
|
-
* @category type ids
|
|
21
|
-
*/
|
|
22
|
-
const PlanTypeId = exports.PlanTypeId = /*#__PURE__*/Symbol.for("@effect/ai/Plan");
|
|
23
17
|
const AiModelProto = {
|
|
24
|
-
...
|
|
25
|
-
[TypeId]: TypeId
|
|
18
|
+
..._Effectable.CommitPrototype,
|
|
19
|
+
[TypeId]: TypeId,
|
|
20
|
+
[Layer.LayerTypeId]: {
|
|
21
|
+
_ROut: _Function.identity,
|
|
22
|
+
_E: _Function.identity,
|
|
23
|
+
_RIn: _Function.identity
|
|
24
|
+
},
|
|
25
|
+
commit() {
|
|
26
|
+
return Effect.contextWith(context => {
|
|
27
|
+
return Layer.provide(this, Layer.succeedContext(context));
|
|
28
|
+
});
|
|
29
|
+
}
|
|
26
30
|
};
|
|
27
|
-
const contextCache = /*#__PURE__*/GlobalValue.globalValue("@effect/ai/AiModel/CachedContexts", () => new Map());
|
|
28
31
|
/**
|
|
29
32
|
* @since 1.0.0
|
|
30
33
|
* @category constructors
|
|
31
34
|
*/
|
|
32
|
-
const make =
|
|
33
|
-
const self = Object.create(AiModelProto);
|
|
34
|
-
self.buildContext = Effect.gen(function* () {
|
|
35
|
-
let context = contextCache.get(options.cacheKey);
|
|
36
|
-
if (Predicate.isUndefined(context)) {
|
|
37
|
-
context = yield* options.cachedContext;
|
|
38
|
-
}
|
|
39
|
-
return yield* options.updateRequestContext(context);
|
|
40
|
-
});
|
|
41
|
-
self.steps = [{
|
|
42
|
-
model: self,
|
|
43
|
-
check: Option.none(),
|
|
44
|
-
schedule: Option.none()
|
|
45
|
-
}];
|
|
46
|
-
return self;
|
|
47
|
-
};
|
|
35
|
+
const make = layer => Object.assign(Object.create(AiModelProto), layer);
|
|
48
36
|
exports.make = make;
|
|
49
37
|
//# sourceMappingURL=AiModel.js.map
|
package/dist/cjs/AiModel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiModel.js","names":["Effect","_interopRequireWildcard","require","
|
|
1
|
+
{"version":3,"file":"AiModel.js","names":["Effect","_interopRequireWildcard","require","_Effectable","_Function","Layer","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TypeId","exports","Symbol","for","AiModelProto","CommitPrototype","LayerTypeId","_ROut","identity","_E","_RIn","commit","contextWith","context","provide","succeedContext","make","layer","assign","create"],"sources":["../../src/AiModel.ts"],"sourcesContent":[null],"mappings":";;;;;;AAIA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAAqC,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK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AAI,EAAElC,KAAK,CAACmC,cAAc,CAACF,OAAO,CAAC,CAAC;IAC3D,CAAC,CAAC;EACJ;CACD;AAED;;;;AAIO,MAAMG,IAAI,GACfC,KAA6C,IACbpB,MAAM,CAACqB,MAAM,CAACrB,MAAM,CAACsB,MAAM,CAACf,YAAY,CAAC,EAAEa,KAAK,CAAC;AAAAhB,OAAA,CAAAe,IAAA,GAAAA,IAAA","ignoreList":[]}
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.Tokenizer = exports.AiToolkit = exports.AiTool = exports.AiTelemetry = exports.AiResponse = exports.
|
|
6
|
+
exports.Tokenizer = exports.AiToolkit = exports.AiTool = exports.AiTelemetry = exports.AiResponse = exports.AiModel = exports.AiLanguageModel = exports.AiInput = exports.AiError = exports.AiEmbeddingModel = exports.AiChat = void 0;
|
|
7
7
|
var _AiChat = _interopRequireWildcard(require("./AiChat.js"));
|
|
8
8
|
exports.AiChat = _AiChat;
|
|
9
9
|
var _AiEmbeddingModel = _interopRequireWildcard(require("./AiEmbeddingModel.js"));
|
|
@@ -16,8 +16,6 @@ var _AiLanguageModel = _interopRequireWildcard(require("./AiLanguageModel.js"));
|
|
|
16
16
|
exports.AiLanguageModel = _AiLanguageModel;
|
|
17
17
|
var _AiModel = _interopRequireWildcard(require("./AiModel.js"));
|
|
18
18
|
exports.AiModel = _AiModel;
|
|
19
|
-
var _AiPlan = _interopRequireWildcard(require("./AiPlan.js"));
|
|
20
|
-
exports.AiPlan = _AiPlan;
|
|
21
19
|
var _AiResponse = _interopRequireWildcard(require("./AiResponse.js"));
|
|
22
20
|
exports.AiResponse = _AiResponse;
|
|
23
21
|
var _AiTelemetry = _interopRequireWildcard(require("./AiTelemetry.js"));
|
package/dist/dts/AiModel.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @since 1.0.0
|
|
3
|
-
*/
|
|
4
|
-
import type * as Context from "effect/Context";
|
|
5
1
|
import * as Effect from "effect/Effect";
|
|
6
|
-
import
|
|
7
|
-
import type * as AiPlan from "./AiPlan.js";
|
|
2
|
+
import * as Layer from "effect/Layer";
|
|
8
3
|
/**
|
|
9
4
|
* @since 1.0.0
|
|
10
5
|
* @category type ids
|
|
@@ -15,48 +10,16 @@ export declare const TypeId: unique symbol;
|
|
|
15
10
|
* @category type ids
|
|
16
11
|
*/
|
|
17
12
|
export type TypeId = typeof TypeId;
|
|
18
|
-
/**
|
|
19
|
-
* @since 1.0.0
|
|
20
|
-
* @category type ids
|
|
21
|
-
*/
|
|
22
|
-
export declare const PlanTypeId: unique symbol;
|
|
23
|
-
/**
|
|
24
|
-
* @since 1.0.0
|
|
25
|
-
* @category type ids
|
|
26
|
-
*/
|
|
27
|
-
export type PlanTypeId = typeof TypeId;
|
|
28
13
|
/**
|
|
29
14
|
* @since 1.0.0
|
|
30
15
|
* @category models
|
|
31
16
|
*/
|
|
32
|
-
export interface AiModel<in out Provides, in out Requires> extends
|
|
17
|
+
export interface AiModel<in out Provides, in out Requires> extends Layer.Layer<Provides, never, Requires>, Effect.Effect<Layer.Layer<Provides>, never, Requires> {
|
|
33
18
|
readonly [TypeId]: TypeId;
|
|
34
|
-
readonly buildContext: ContextBuilder<Provides, Requires>;
|
|
35
19
|
}
|
|
36
|
-
/**
|
|
37
|
-
* @since 1.0.0
|
|
38
|
-
* @category AiModel
|
|
39
|
-
*/
|
|
40
|
-
export type ContextBuilder<Provides, Requires> = Effect.Effect<Context.Context<Provides>, never, Requires | Scope.Scope>;
|
|
41
20
|
/**
|
|
42
21
|
* @since 1.0.0
|
|
43
22
|
* @category constructors
|
|
44
23
|
*/
|
|
45
|
-
export declare const make: <
|
|
46
|
-
/**
|
|
47
|
-
* A unique key used to cache the `Context` built from the `cachedContext`
|
|
48
|
-
* effect.
|
|
49
|
-
*/
|
|
50
|
-
readonly cacheKey: string;
|
|
51
|
-
/**
|
|
52
|
-
* An effect used to build a `Context` that will be cached after creation
|
|
53
|
-
* and used for all provider requests.
|
|
54
|
-
*/
|
|
55
|
-
readonly cachedContext: Effect.Effect<Context.Context<Cached>, never, CachedRequires | Scope.Scope>;
|
|
56
|
-
/**
|
|
57
|
-
* A method that can be used to update the `Context` on a per-request basis
|
|
58
|
-
* for all provider requests.
|
|
59
|
-
*/
|
|
60
|
-
readonly updateRequestContext: (context: Context.Context<Cached>) => Effect.Effect<Context.Context<PerRequest>, never, PerRequestRequires>;
|
|
61
|
-
}) => AiModel<Cached | PerRequest, CachedRequires | PerRequestRequires>;
|
|
24
|
+
export declare const make: <Provides, Requires>(layer: Layer.Layer<Provides, never, Requires>) => AiModel<Provides, Requires>;
|
|
62
25
|
//# sourceMappingURL=AiModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiModel.d.ts","sourceRoot":"","sources":["../../src/AiModel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AiModel.d.ts","sourceRoot":"","sources":["../../src/AiModel.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,OAAO,MAAyC,CAAA;AAErE;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAA;AAElC;;;GAGG;AACH,MAAM,WAAW,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CACvD,SAAQ,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC;IAErG,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAC1B;AAiBD;;;GAGG;AACH,eAAO,MAAM,IAAI,GAAI,QAAQ,EAAE,QAAQ,EACrC,OAAO,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,KAC5C,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAsD,CAAA"}
|
package/dist/dts/index.d.ts
CHANGED
package/dist/dts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC;;GAEG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD;;GAEG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;GAEG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;GAEG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AAEvD;;GAEG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;GAEG;AACH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC;;GAEG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD;;GAEG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;GAEG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;GAEG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AAEvD;;GAEG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;GAEG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;GAEG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC;;GAEG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;GAEG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA"}
|
package/dist/esm/AiModel.js
CHANGED
|
@@ -1,41 +1,29 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import * as
|
|
5
|
-
import * as InternalAiPlan from "./internal/aiPlan.js";
|
|
2
|
+
import { CommitPrototype } from "effect/Effectable";
|
|
3
|
+
import { identity } from "effect/Function";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
6
5
|
/**
|
|
7
6
|
* @since 1.0.0
|
|
8
7
|
* @category type ids
|
|
9
8
|
*/
|
|
10
9
|
export const TypeId = /*#__PURE__*/Symbol.for("@effect/ai/AiModel");
|
|
11
|
-
/**
|
|
12
|
-
* @since 1.0.0
|
|
13
|
-
* @category type ids
|
|
14
|
-
*/
|
|
15
|
-
export const PlanTypeId = /*#__PURE__*/Symbol.for("@effect/ai/Plan");
|
|
16
10
|
const AiModelProto = {
|
|
17
|
-
...
|
|
18
|
-
[TypeId]: TypeId
|
|
11
|
+
...CommitPrototype,
|
|
12
|
+
[TypeId]: TypeId,
|
|
13
|
+
[Layer.LayerTypeId]: {
|
|
14
|
+
_ROut: identity,
|
|
15
|
+
_E: identity,
|
|
16
|
+
_RIn: identity
|
|
17
|
+
},
|
|
18
|
+
commit() {
|
|
19
|
+
return Effect.contextWith(context => {
|
|
20
|
+
return Layer.provide(this, Layer.succeedContext(context));
|
|
21
|
+
});
|
|
22
|
+
}
|
|
19
23
|
};
|
|
20
|
-
const contextCache = /*#__PURE__*/GlobalValue.globalValue("@effect/ai/AiModel/CachedContexts", () => new Map());
|
|
21
24
|
/**
|
|
22
25
|
* @since 1.0.0
|
|
23
26
|
* @category constructors
|
|
24
27
|
*/
|
|
25
|
-
export const make =
|
|
26
|
-
const self = Object.create(AiModelProto);
|
|
27
|
-
self.buildContext = Effect.gen(function* () {
|
|
28
|
-
let context = contextCache.get(options.cacheKey);
|
|
29
|
-
if (Predicate.isUndefined(context)) {
|
|
30
|
-
context = yield* options.cachedContext;
|
|
31
|
-
}
|
|
32
|
-
return yield* options.updateRequestContext(context);
|
|
33
|
-
});
|
|
34
|
-
self.steps = [{
|
|
35
|
-
model: self,
|
|
36
|
-
check: Option.none(),
|
|
37
|
-
schedule: Option.none()
|
|
38
|
-
}];
|
|
39
|
-
return self;
|
|
40
|
-
};
|
|
28
|
+
export const make = layer => Object.assign(Object.create(AiModelProto), layer);
|
|
41
29
|
//# sourceMappingURL=AiModel.js.map
|
package/dist/esm/AiModel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiModel.js","names":["Effect","
|
|
1
|
+
{"version":3,"file":"AiModel.js","names":["Effect","CommitPrototype","identity","Layer","TypeId","Symbol","for","AiModelProto","LayerTypeId","_ROut","_E","_RIn","commit","contextWith","context","provide","succeedContext","make","layer","Object","assign","create"],"sources":["../../src/AiModel.ts"],"sourcesContent":[null],"mappings":"AAIA,OAAO,KAAKA,MAAM,MAAM,eAAe;AACvC,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAO,KAAKC,KAAK,MAAM,cAAc;AAErC;;;;AAIA,OAAO,MAAMC,MAAM,gBAAkBC,MAAM,CAACC,GAAG,CAAC,oBAAoB,CAAC;AAkBrE,MAAMC,YAAY,GAAG;EACnB,GAAGN,eAAe;EAClB,CAACG,MAAM,GAAGA,MAAM;EAChB,CAACD,KAAK,CAACK,WAAW,GAAG;IACnBC,KAAK,EAAEP,QAAQ;IACfQ,EAAE,EAAER,QAAQ;IACZS,IAAI,EAAET;GACP;EACDU,MAAMA,CAAA;IACJ,OAAOZ,MAAM,CAACa,WAAW,CAAEC,OAA+B,IAAI;MAC5D,OAAOX,KAAK,CAACY,OAAO,CAAC,IAAI,EAAEZ,KAAK,CAACa,cAAc,CAACF,OAAO,CAAC,CAAC;IAC3D,CAAC,CAAC;EACJ;CACD;AAED;;;;AAIA,OAAO,MAAMG,IAAI,GACfC,KAA6C,IACbC,MAAM,CAACC,MAAM,CAACD,MAAM,CAACE,MAAM,CAACd,YAAY,CAAC,EAAEW,KAAK,CAAC","ignoreList":[]}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["AiChat","AiEmbeddingModel","AiError","AiInput","AiLanguageModel","AiModel","
|
|
1
|
+
{"version":3,"file":"index.js","names":["AiChat","AiEmbeddingModel","AiError","AiInput","AiLanguageModel","AiModel","AiResponse","AiTelemetry","AiTool","AiToolkit","Tokenizer"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,MAAM,MAAM,aAAa;AAErC;;;AAGA,OAAO,KAAKC,gBAAgB,MAAM,uBAAuB;AAEzD;;;AAGA,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;;;AAGA,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;;;AAGA,OAAO,KAAKC,eAAe,MAAM,sBAAsB;AAEvD;;;AAGA,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;;;AAGA,OAAO,KAAKC,UAAU,MAAM,iBAAiB;AAE7C;;;AAGA,OAAO,KAAKC,WAAW,MAAM,kBAAkB;AAE/C;;;AAGA,OAAO,KAAKC,MAAM,MAAM,aAAa;AAErC;;;AAGA,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;AAGA,OAAO,KAAKC,SAAS,MAAM,gBAAgB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "Effect modules for working with AI apis",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"homepage": "https://effect.website",
|
|
13
13
|
"dependencies": {},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@effect/experimental": "^0.
|
|
16
|
-
"@effect/platform": "^0.
|
|
17
|
-
"effect": "^3.
|
|
15
|
+
"@effect/experimental": "^0.48.1",
|
|
16
|
+
"@effect/platform": "^0.84.1",
|
|
17
|
+
"effect": "^3.16.1"
|
|
18
18
|
},
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"provenance": true
|
|
@@ -59,11 +59,6 @@
|
|
|
59
59
|
"import": "./dist/esm/AiModel.js",
|
|
60
60
|
"default": "./dist/cjs/AiModel.js"
|
|
61
61
|
},
|
|
62
|
-
"./AiPlan": {
|
|
63
|
-
"types": "./dist/dts/AiPlan.d.ts",
|
|
64
|
-
"import": "./dist/esm/AiPlan.js",
|
|
65
|
-
"default": "./dist/cjs/AiPlan.js"
|
|
66
|
-
},
|
|
67
62
|
"./AiResponse": {
|
|
68
63
|
"types": "./dist/dts/AiResponse.d.ts",
|
|
69
64
|
"import": "./dist/esm/AiResponse.js",
|
|
@@ -115,9 +110,6 @@
|
|
|
115
110
|
"AiModel": [
|
|
116
111
|
"./dist/dts/AiModel.d.ts"
|
|
117
112
|
],
|
|
118
|
-
"AiPlan": [
|
|
119
|
-
"./dist/dts/AiPlan.d.ts"
|
|
120
|
-
],
|
|
121
113
|
"AiResponse": [
|
|
122
114
|
"./dist/dts/AiResponse.d.ts"
|
|
123
115
|
],
|
package/src/AiModel.ts
CHANGED
|
@@ -3,12 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type * as Context from "effect/Context"
|
|
5
5
|
import * as Effect from "effect/Effect"
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import * as
|
|
9
|
-
import type * as Scope from "effect/Scope"
|
|
10
|
-
import type * as AiPlan from "./AiPlan.js"
|
|
11
|
-
import * as InternalAiPlan from "./internal/aiPlan.js"
|
|
6
|
+
import { CommitPrototype } from "effect/Effectable"
|
|
7
|
+
import { identity } from "effect/Function"
|
|
8
|
+
import * as Layer from "effect/Layer"
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
* @since 1.0.0
|
|
@@ -22,88 +19,35 @@ export const TypeId: unique symbol = Symbol.for("@effect/ai/AiModel")
|
|
|
22
19
|
*/
|
|
23
20
|
export type TypeId = typeof TypeId
|
|
24
21
|
|
|
25
|
-
/**
|
|
26
|
-
* @since 1.0.0
|
|
27
|
-
* @category type ids
|
|
28
|
-
*/
|
|
29
|
-
export const PlanTypeId: unique symbol = Symbol.for("@effect/ai/Plan")
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @since 1.0.0
|
|
33
|
-
* @category type ids
|
|
34
|
-
*/
|
|
35
|
-
export type PlanTypeId = typeof TypeId
|
|
36
|
-
|
|
37
22
|
/**
|
|
38
23
|
* @since 1.0.0
|
|
39
24
|
* @category models
|
|
40
25
|
*/
|
|
41
|
-
export interface AiModel<in out Provides, in out Requires>
|
|
26
|
+
export interface AiModel<in out Provides, in out Requires>
|
|
27
|
+
extends Layer.Layer<Provides, never, Requires>, Effect.Effect<Layer.Layer<Provides>, never, Requires>
|
|
28
|
+
{
|
|
42
29
|
readonly [TypeId]: TypeId
|
|
43
|
-
readonly buildContext: ContextBuilder<Provides, Requires>
|
|
44
30
|
}
|
|
45
31
|
|
|
46
|
-
/**
|
|
47
|
-
* @since 1.0.0
|
|
48
|
-
* @category AiModel
|
|
49
|
-
*/
|
|
50
|
-
export type ContextBuilder<Provides, Requires> = Effect.Effect<
|
|
51
|
-
Context.Context<Provides>,
|
|
52
|
-
never,
|
|
53
|
-
Requires | Scope.Scope
|
|
54
|
-
>
|
|
55
|
-
|
|
56
32
|
const AiModelProto = {
|
|
57
|
-
...
|
|
58
|
-
[TypeId]: TypeId
|
|
33
|
+
...CommitPrototype,
|
|
34
|
+
[TypeId]: TypeId,
|
|
35
|
+
[Layer.LayerTypeId]: {
|
|
36
|
+
_ROut: identity,
|
|
37
|
+
_E: identity,
|
|
38
|
+
_RIn: identity
|
|
39
|
+
},
|
|
40
|
+
commit(this: AiModel<any, any>) {
|
|
41
|
+
return Effect.contextWith((context: Context.Context<never>) => {
|
|
42
|
+
return Layer.provide(this, Layer.succeedContext(context))
|
|
43
|
+
})
|
|
44
|
+
}
|
|
59
45
|
}
|
|
60
46
|
|
|
61
|
-
const contextCache = GlobalValue.globalValue(
|
|
62
|
-
"@effect/ai/AiModel/CachedContexts",
|
|
63
|
-
() => new Map<string, any>()
|
|
64
|
-
)
|
|
65
|
-
|
|
66
47
|
/**
|
|
67
48
|
* @since 1.0.0
|
|
68
49
|
* @category constructors
|
|
69
50
|
*/
|
|
70
|
-
export const make = <
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
* effect.
|
|
74
|
-
*/
|
|
75
|
-
readonly cacheKey: string
|
|
76
|
-
/**
|
|
77
|
-
* An effect used to build a `Context` that will be cached after creation
|
|
78
|
-
* and used for all provider requests.
|
|
79
|
-
*/
|
|
80
|
-
readonly cachedContext: Effect.Effect<
|
|
81
|
-
Context.Context<Cached>,
|
|
82
|
-
never,
|
|
83
|
-
CachedRequires | Scope.Scope
|
|
84
|
-
>
|
|
85
|
-
/**
|
|
86
|
-
* A method that can be used to update the `Context` on a per-request basis
|
|
87
|
-
* for all provider requests.
|
|
88
|
-
*/
|
|
89
|
-
readonly updateRequestContext: (context: Context.Context<Cached>) => Effect.Effect<
|
|
90
|
-
Context.Context<PerRequest>,
|
|
91
|
-
never,
|
|
92
|
-
PerRequestRequires
|
|
93
|
-
>
|
|
94
|
-
}): AiModel<Cached | PerRequest, CachedRequires | PerRequestRequires> => {
|
|
95
|
-
const self = Object.create(AiModelProto)
|
|
96
|
-
self.buildContext = Effect.gen(function*() {
|
|
97
|
-
let context = contextCache.get(options.cacheKey)
|
|
98
|
-
if (Predicate.isUndefined(context)) {
|
|
99
|
-
context = yield* options.cachedContext
|
|
100
|
-
}
|
|
101
|
-
return yield* options.updateRequestContext(context)
|
|
102
|
-
})
|
|
103
|
-
self.steps = [{
|
|
104
|
-
model: self,
|
|
105
|
-
check: Option.none(),
|
|
106
|
-
schedule: Option.none()
|
|
107
|
-
}]
|
|
108
|
-
return self
|
|
109
|
-
}
|
|
51
|
+
export const make = <Provides, Requires>(
|
|
52
|
+
layer: Layer.Layer<Provides, never, Requires>
|
|
53
|
+
): AiModel<Provides, Requires> => Object.assign(Object.create(AiModelProto), layer)
|
package/src/index.ts
CHANGED
package/AiPlan/package.json
DELETED
package/dist/cjs/AiPlan.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.withFallback = exports.make = exports.concatSteps = exports.TypeId = void 0;
|
|
7
|
-
var Internal = _interopRequireWildcard(require("./internal/aiPlan.js"));
|
|
8
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
9
|
-
/**
|
|
10
|
-
* @since 1.0.0
|
|
11
|
-
* @category Type Ids
|
|
12
|
-
*/
|
|
13
|
-
const TypeId = exports.TypeId = Internal.TypeId;
|
|
14
|
-
/**
|
|
15
|
-
* @since 1.0.0
|
|
16
|
-
* @category constructors
|
|
17
|
-
*/
|
|
18
|
-
const make = function () {
|
|
19
|
-
let plan = Internal.make(arguments[0]);
|
|
20
|
-
for (let i = 1; i < arguments.length; i++) {
|
|
21
|
-
plan = withFallback(plan, arguments[i]);
|
|
22
|
-
}
|
|
23
|
-
return plan;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* @since 1.0.0
|
|
27
|
-
* @category error handling
|
|
28
|
-
*/
|
|
29
|
-
exports.make = make;
|
|
30
|
-
const withFallback = exports.withFallback = Internal.withFallback;
|
|
31
|
-
/**
|
|
32
|
-
* @since 1.0.0
|
|
33
|
-
* @category combination
|
|
34
|
-
*/
|
|
35
|
-
const concatSteps = exports.concatSteps = Internal.concatSteps;
|
|
36
|
-
//# sourceMappingURL=AiPlan.js.map
|
package/dist/cjs/AiPlan.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AiPlan.js","names":["Internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TypeId","exports","make","plan","arguments","length","withFallback","concatSteps"],"sources":["../../src/AiPlan.ts"],"sourcesContent":[null],"mappings":";;;;;;AAWA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,C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|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.withFallback = exports.make = exports.concatSteps = exports.TypeId = exports.PlanPrototype = void 0;
|
|
7
|
-
var Effect = _interopRequireWildcard(require("effect/Effect"));
|
|
8
|
-
var _Effectable = require("effect/Effectable");
|
|
9
|
-
var Either = _interopRequireWildcard(require("effect/Either"));
|
|
10
|
-
var _Function = require("effect/Function");
|
|
11
|
-
var Option = _interopRequireWildcard(require("effect/Option"));
|
|
12
|
-
var _Pipeable = require("effect/Pipeable");
|
|
13
|
-
var Predicate = _interopRequireWildcard(require("effect/Predicate"));
|
|
14
|
-
var Schedule = _interopRequireWildcard(require("effect/Schedule"));
|
|
15
|
-
var Scope = _interopRequireWildcard(require("effect/Scope"));
|
|
16
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
17
|
-
/** @internal */
|
|
18
|
-
const TypeId = exports.TypeId = /*#__PURE__*/Symbol.for("@effect/ai/AiPlan");
|
|
19
|
-
/** @internal */
|
|
20
|
-
const PlanPrototype = exports.PlanPrototype = {
|
|
21
|
-
..._Effectable.CommitPrototype,
|
|
22
|
-
[TypeId]: TypeId,
|
|
23
|
-
commit() {
|
|
24
|
-
return buildPlan(this);
|
|
25
|
-
},
|
|
26
|
-
pipe() {
|
|
27
|
-
return (0, _Pipeable.pipeArguments)(this, arguments);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const makePlan = steps => {
|
|
31
|
-
const self = Object.create(PlanPrototype);
|
|
32
|
-
self.steps = steps;
|
|
33
|
-
return self;
|
|
34
|
-
};
|
|
35
|
-
const buildPlan = plan => Effect.map(Effect.context(), context => {
|
|
36
|
-
return {
|
|
37
|
-
use: Effect.fnUntraced(function* (effect) {
|
|
38
|
-
let result = undefined;
|
|
39
|
-
for (const step of plan.steps) {
|
|
40
|
-
if (result !== undefined && Either.isLeft(result) && Option.isSome(step.check)) {
|
|
41
|
-
const check = step.check.value(result.left);
|
|
42
|
-
const isFatalError = !(Effect.isEffect(check) ? yield* check : check);
|
|
43
|
-
if (isFatalError) break;
|
|
44
|
-
}
|
|
45
|
-
const retryOptions = getRetryOptions(step);
|
|
46
|
-
result = yield* Effect.scopedWith(scope => step.model.buildContext.pipe(Scope.extend(scope), Effect.flatMap(context => effect.pipe(Option.isSome(retryOptions) ? Effect.retry(retryOptions.value) : _Function.identity, Effect.provide(context))), Effect.provide(context), Effect.either));
|
|
47
|
-
if (Either.isRight(result)) break;
|
|
48
|
-
}
|
|
49
|
-
return yield* result;
|
|
50
|
-
})
|
|
51
|
-
};
|
|
52
|
-
});
|
|
53
|
-
const getRetryOptions = step => {
|
|
54
|
-
if (Option.isNone(step.schedule) && Option.isNone(step.check)) {
|
|
55
|
-
return Option.none();
|
|
56
|
-
}
|
|
57
|
-
return Option.some({
|
|
58
|
-
schedule: Option.getOrUndefined(step.schedule),
|
|
59
|
-
while: Option.getOrUndefined(step.check)
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
/** @internal */
|
|
63
|
-
const make = options => makePlan([{
|
|
64
|
-
model: options.model,
|
|
65
|
-
check: Option.fromNullable(options?.while),
|
|
66
|
-
schedule: resolveSchedule(options ?? {})
|
|
67
|
-
}]);
|
|
68
|
-
/** @internal */
|
|
69
|
-
exports.make = make;
|
|
70
|
-
const withFallback = exports.withFallback = /*#__PURE__*/(0, _Function.dual)(2, (self, options) => makePlan([...self.steps, {
|
|
71
|
-
model: options.model,
|
|
72
|
-
check: Option.fromNullable(options.while),
|
|
73
|
-
schedule: resolveSchedule(options)
|
|
74
|
-
}]));
|
|
75
|
-
const resolveSchedule = options => {
|
|
76
|
-
if (Predicate.isUndefined(options.attempts) && Predicate.isUndefined(options.schedule)) return Option.none();
|
|
77
|
-
let schedule = options.schedule ?? Schedule.forever;
|
|
78
|
-
if (Predicate.isNotUndefined(options.attempts)) {
|
|
79
|
-
// In an `AiPlan`, the `attempts` represents the total number of times to
|
|
80
|
-
// attempt the call, not the number of retries, thus we subtract one from
|
|
81
|
-
// the total number of recurrences
|
|
82
|
-
schedule = Schedule.intersect(schedule, Schedule.recurs(options.attempts - 1));
|
|
83
|
-
}
|
|
84
|
-
return Option.some(schedule);
|
|
85
|
-
};
|
|
86
|
-
/** @internal */
|
|
87
|
-
const concatSteps = exports.concatSteps = /*#__PURE__*/(0, _Function.dual)(2, (self, other) => makePlan([...self.steps, ...other.steps]));
|
|
88
|
-
//# sourceMappingURL=aiPlan.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aiPlan.js","names":["Effect","_interopRequireWildcard","require","_Effectable","Either","_Function","Option","_Pipeable","Predicate","Schedule","Scope","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TypeId","exports","Symbol","for","PlanPrototype","CommitPrototype","commit","buildPlan","pipe","pipeArguments","arguments","makePlan","steps","self","create","plan","map","context","use","fnUntraced","effect","result","undefined","step","isLeft","isSome","check","value","left","isFatalError","isEffect","retryOptions","getRetryOptions","scopedWith","scope","model","buildContext","extend","flatMap","retry","identity","provide","either","isRight","isNone","schedule","none","some","getOrUndefined","while","make","options","fromNullable","resolveSchedule","withFallback","dual","isUndefined","attempts","forever","isNotUndefined","intersect","recurs","concatSteps","other"],"sources":["../../../src/internal/aiPlan.ts"],"sourcesContent":[null],"mappings":";;;;;;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