@anvia/core 0.26.0 → 1.0.0-rc.10
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/README.md +400 -94
- package/dist/agent/index.d.ts +67 -71
- package/dist/agent/index.js +36 -18
- package/dist/agent/interactions/index.d.ts +122 -0
- package/dist/agent/interactions/index.js +20 -0
- package/dist/agent-DWzW9SoH.d.ts +150 -0
- package/dist/chunk-3RM57ZT2.js +31 -0
- package/dist/chunk-3RM57ZT2.js.map +1 -0
- package/dist/chunk-3RWESPUG.js +331 -0
- package/dist/chunk-3RWESPUG.js.map +1 -0
- package/dist/{chunk-NCPN4SJR.js → chunk-3SKZ2BKP.js} +15 -13
- package/dist/chunk-3SKZ2BKP.js.map +1 -0
- package/dist/chunk-3XQGVDU5.js +69 -0
- package/dist/chunk-3XQGVDU5.js.map +1 -0
- package/dist/{chunk-MRQLEK2B.js → chunk-5C6B6ZRH.js} +69 -51
- package/dist/chunk-5C6B6ZRH.js.map +1 -0
- package/dist/chunk-6BBOCFHV.js +323 -0
- package/dist/chunk-6BBOCFHV.js.map +1 -0
- package/dist/chunk-7JLAIN6E.js +15 -0
- package/dist/chunk-7JLAIN6E.js.map +1 -0
- package/dist/chunk-7PHMK7W4.js +1516 -0
- package/dist/chunk-7PHMK7W4.js.map +1 -0
- package/dist/{chunk-CWUJUSOS.js → chunk-AZB6N7P4.js} +94 -65
- package/dist/chunk-AZB6N7P4.js.map +1 -0
- package/dist/chunk-D4PACGPA.js +37 -0
- package/dist/chunk-D4PACGPA.js.map +1 -0
- package/dist/chunk-EFLT7XZD.js +51 -0
- package/dist/chunk-EFLT7XZD.js.map +1 -0
- package/dist/chunk-EMZKPRE6.js +667 -0
- package/dist/chunk-EMZKPRE6.js.map +1 -0
- package/dist/chunk-I3Q7XSBB.js +59 -0
- package/dist/chunk-I3Q7XSBB.js.map +1 -0
- package/dist/chunk-J6LVLV6P.js +13 -0
- package/dist/chunk-J6LVLV6P.js.map +1 -0
- package/dist/chunk-LTXABCOO.js +127 -0
- package/dist/chunk-LTXABCOO.js.map +1 -0
- package/dist/chunk-OJBFDBLG.js +164 -0
- package/dist/chunk-OJBFDBLG.js.map +1 -0
- package/dist/chunk-QGX73TSQ.js +177 -0
- package/dist/chunk-QGX73TSQ.js.map +1 -0
- package/dist/chunk-QOUPWOGW.js +29 -0
- package/dist/chunk-QOUPWOGW.js.map +1 -0
- package/dist/chunk-SJMSS5SI.js +171 -0
- package/dist/chunk-SJMSS5SI.js.map +1 -0
- package/dist/chunk-T2C3CGDQ.js +56 -0
- package/dist/chunk-T2C3CGDQ.js.map +1 -0
- package/dist/chunk-VX3HS6PE.js +4569 -0
- package/dist/chunk-VX3HS6PE.js.map +1 -0
- package/dist/chunk-X4LK4ODN.js +86 -0
- package/dist/chunk-X4LK4ODN.js.map +1 -0
- package/dist/chunk-ZA564323.js +331 -0
- package/dist/chunk-ZA564323.js.map +1 -0
- package/dist/completion/index.d.ts +6 -36
- package/dist/completion/index.js +34 -29
- package/dist/documents/index.d.ts +34 -0
- package/dist/documents/index.js +340 -0
- package/dist/documents/index.js.map +1 -0
- package/dist/dynamic-tools-aIZlg5x1.d.ts +45 -0
- package/dist/embeddings/index.d.ts +11 -9
- package/dist/embeddings/index.js +3 -4
- package/dist/evals/index.d.ts +57 -21
- package/dist/evals/index.js +209 -104
- package/dist/evals/index.js.map +1 -1
- package/dist/extractor/index.d.ts +27 -42
- package/dist/extractor/index.js +9 -22
- package/dist/guardrails/index.d.ts +7 -129
- package/dist/guardrails/index.js +1 -1
- package/dist/image-generation/index.d.ts +23 -23
- package/dist/image-generation/index.js +7 -39
- package/dist/image-generation/index.js.map +1 -1
- package/dist/index.d.ts +24 -22
- package/dist/index.js +85 -68
- package/dist/internal/agent.d.ts +156 -10
- package/dist/internal/agent.js +58 -18
- package/dist/internal/agent.js.map +1 -1
- package/dist/mcp/index.d.ts +7 -15
- package/dist/mcp/index.js +3 -348
- package/dist/mcp/index.js.map +1 -1
- package/dist/memory/index.d.ts +20 -6
- package/dist/memory/index.js +11 -10
- package/dist/middleware-kcF8AusP.d.ts +59 -0
- package/dist/model-call-options-CZkSw_xN.d.ts +6 -0
- package/dist/model-listing/index.d.ts +3 -1
- package/dist/observability/index.d.ts +23 -4
- package/dist/observability/index.js +10 -5
- package/dist/observability/index.js.map +1 -1
- package/dist/pipeline/index.d.ts +111 -73
- package/dist/pipeline/index.js +471 -286
- package/dist/pipeline/index.js.map +1 -1
- package/dist/provider-output-error-BEwDgVv3.d.ts +99 -0
- package/dist/retry-CjvSlKGW.d.ts +16 -0
- package/dist/skills/index.d.ts +5 -4
- package/dist/skills/index.js +8 -8
- package/dist/speech-generation/index.d.ts +37 -0
- package/dist/speech-generation/index.js +10 -0
- package/dist/streaming/index.js +37 -3
- package/dist/streaming/index.js.map +1 -1
- package/dist/text-ZLECpQE7.d.ts +32 -0
- package/dist/think-tool-BwCsJ365.d.ts +40 -0
- package/dist/tool/index.d.ts +11 -6
- package/dist/tool/index.js +21 -21
- package/dist/tool-BpqpoRSE.d.ts +58 -0
- package/dist/transcription/index.d.ts +29 -22
- package/dist/transcription/index.js +7 -57
- package/dist/transcription/index.js.map +1 -1
- package/dist/type-utils-CtHVDRn_.d.ts +6 -0
- package/dist/types-CXNE592e.d.ts +130 -0
- package/dist/types-Cr4uiYo5.d.ts +99 -0
- package/dist/{types-04LqWrmy.d.ts → types-DC1U1XwW.d.ts} +1 -1
- package/dist/types-DKOXVTcq.d.ts +155 -0
- package/dist/types-DgvozfPc.d.ts +349 -0
- package/dist/types-DhkodEft.d.ts +105 -0
- package/dist/types-DjqRHeAi.d.ts +31 -0
- package/dist/types-Sue2hb_L.d.ts +403 -0
- package/dist/vector-store/index.d.ts +34 -34
- package/dist/vector-store/index.js +10 -6
- package/package.json +22 -24
- package/dist/agent-x3YTyv5i.d.ts +0 -222
- package/dist/audio-generation/index.d.ts +0 -33
- package/dist/audio-generation/index.js +0 -42
- package/dist/audio-generation/index.js.map +0 -1
- package/dist/chunk-2ODTMRHP.js +0 -54
- package/dist/chunk-2ODTMRHP.js.map +0 -1
- package/dist/chunk-ADH7NNCS.js +0 -512
- package/dist/chunk-ADH7NNCS.js.map +0 -1
- package/dist/chunk-BALBBVI3.js +0 -2732
- package/dist/chunk-BALBBVI3.js.map +0 -1
- package/dist/chunk-CQNNSZPG.js +0 -9
- package/dist/chunk-CQNNSZPG.js.map +0 -1
- package/dist/chunk-CWUJUSOS.js.map +0 -1
- package/dist/chunk-DALYP4PX.js +0 -225
- package/dist/chunk-DALYP4PX.js.map +0 -1
- package/dist/chunk-HYUYZEAJ.js +0 -223
- package/dist/chunk-HYUYZEAJ.js.map +0 -1
- package/dist/chunk-I6XOQ4LK.js +0 -466
- package/dist/chunk-I6XOQ4LK.js.map +0 -1
- package/dist/chunk-JI5YZWNT.js +0 -220
- package/dist/chunk-JI5YZWNT.js.map +0 -1
- package/dist/chunk-MC3CCKEB.js +0 -221
- package/dist/chunk-MC3CCKEB.js.map +0 -1
- package/dist/chunk-MELYDKWQ.js +0 -337
- package/dist/chunk-MELYDKWQ.js.map +0 -1
- package/dist/chunk-MNWK2USR.js +0 -243
- package/dist/chunk-MNWK2USR.js.map +0 -1
- package/dist/chunk-MRQLEK2B.js.map +0 -1
- package/dist/chunk-NCPN4SJR.js.map +0 -1
- package/dist/chunk-OIMLU4SF.js +0 -20
- package/dist/chunk-OIMLU4SF.js.map +0 -1
- package/dist/chunk-Q25IWLBT.js +0 -138
- package/dist/chunk-Q25IWLBT.js.map +0 -1
- package/dist/chunk-UQX6EXWG.js +0 -33
- package/dist/chunk-UQX6EXWG.js.map +0 -1
- package/dist/chunk-WQKHFADH.js +0 -12
- package/dist/chunk-WQKHFADH.js.map +0 -1
- package/dist/chunk-XUUY2L2D.js +0 -42
- package/dist/chunk-XUUY2L2D.js.map +0 -1
- package/dist/chunk-XWUC7CIT.js +0 -1
- package/dist/chunk-XWUC7CIT.js.map +0 -1
- package/dist/chunk-YLMDBQO4.js +0 -141
- package/dist/chunk-YLMDBQO4.js.map +0 -1
- package/dist/errors-2moLDuuN.d.ts +0 -17
- package/dist/hooks/index.d.ts +0 -12
- package/dist/hooks/index.js +0 -17
- package/dist/index-BxSbmOMr.d.ts +0 -257
- package/dist/json-BVPssigK.d.ts +0 -39
- package/dist/loaders/index.d.ts +0 -91
- package/dist/loaders/index.js +0 -299
- package/dist/loaders/index.js.map +0 -1
- package/dist/middleware-Dp3d_pxi.d.ts +0 -90
- package/dist/request/index.d.ts +0 -28
- package/dist/request/index.js +0 -25
- package/dist/think-tool-DfCMuO8e.d.ts +0 -26
- package/dist/tool-Cohdv5GC.d.ts +0 -65
- package/dist/types-BCTRUGex.d.ts +0 -47
- package/dist/types-BrLbKnEz.d.ts +0 -119
- package/dist/types-D9JpeAPF.d.ts +0 -114
- package/dist/types-G12i56s2.d.ts +0 -354
- package/dist/types-JJCxRnaZ.d.ts +0 -70
- package/dist/types-O-abTIin.d.ts +0 -79
- package/dist/ui/index.d.ts +0 -107
- package/dist/ui/index.js +0 -10
- package/dist/ui/index.js.map +0 -1
- /package/dist/{hooks → agent/interactions}/index.js.map +0 -0
- /package/dist/{request → speech-generation}/index.js.map +0 -0
|
@@ -1,49 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as RetrySetting } from '../retry-CjvSlKGW.js';
|
|
2
|
+
import { c as CompletionModel, J as JsonObject, U as Usage, h as CompletionResult } from '../types-DgvozfPc.js';
|
|
2
3
|
import { Z as ZodSchema } from '../zod-schema-C7F4clpm.js';
|
|
3
|
-
import
|
|
4
|
-
import '../guardrails/index.js';
|
|
5
|
-
import '../types-D9JpeAPF.js';
|
|
6
|
-
import '../types-BrLbKnEz.js';
|
|
7
|
-
import '../index-BxSbmOMr.js';
|
|
8
|
-
import '../tool-Cohdv5GC.js';
|
|
9
|
-
import '../middleware-Dp3d_pxi.js';
|
|
10
|
-
import '../types-BCTRUGex.js';
|
|
11
|
-
import '../types-O-abTIin.js';
|
|
4
|
+
import '../model-call-options-CZkSw_xN.js';
|
|
12
5
|
import 'zod';
|
|
13
6
|
|
|
14
|
-
type
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
type RawResponseOf<Model> = Model extends CompletionModel<infer RawResponse> ? RawResponse : unknown;
|
|
8
|
+
type ExtractOptions<Output, Model extends CompletionModel = CompletionModel> = {
|
|
9
|
+
model: Model;
|
|
10
|
+
text: string;
|
|
11
|
+
outputSchema: ZodSchema<Output>;
|
|
12
|
+
instructions?: string | undefined;
|
|
13
|
+
retries?: RetrySetting | undefined;
|
|
14
|
+
temperature?: number | undefined;
|
|
15
|
+
maxTokens?: number | undefined;
|
|
16
|
+
providerOptions?: JsonObject | undefined;
|
|
17
|
+
abortSignal?: AbortSignal | undefined;
|
|
18
|
+
};
|
|
19
|
+
type ExtractionResult<Output, RawResponse = unknown> = Omit<CompletionResult<string, RawResponse>, "output"> & {
|
|
20
|
+
output: Output;
|
|
18
21
|
};
|
|
19
22
|
declare class ExtractionError extends Error {
|
|
20
|
-
readonly
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
constructor(agent: Agent<M>, schema: ZodSchema<T>, retryCount: number);
|
|
28
|
-
extract(text: string | Message): Promise<T>;
|
|
29
|
-
extractWithUsage(text: string | Message): Promise<ExtractionResponse<T>>;
|
|
30
|
-
extractWithHistory(text: string | Message, history: Message[]): Promise<T>;
|
|
31
|
-
getInner(): Agent<M>;
|
|
32
|
-
private run;
|
|
33
|
-
}
|
|
34
|
-
declare class ExtractorBuilder<T, M extends CompletionModel = CompletionModel> {
|
|
35
|
-
private readonly schema;
|
|
36
|
-
private readonly agentBuilder;
|
|
37
|
-
private retryCount;
|
|
38
|
-
constructor(model: M, schema: ZodSchema<T>);
|
|
39
|
-
instructions(instructions: string): this;
|
|
40
|
-
context(text: string, id?: string): this;
|
|
41
|
-
temperature(temperature: number): this;
|
|
42
|
-
maxTokens(maxTokens: number): this;
|
|
43
|
-
additionalParams(params: JsonValue): this;
|
|
44
|
-
toolChoice(toolChoice: ToolChoice): this;
|
|
45
|
-
retries(retries: number): this;
|
|
46
|
-
build(): Extractor<T, M>;
|
|
23
|
+
readonly attempts: number;
|
|
24
|
+
readonly usage: Usage;
|
|
25
|
+
constructor(message: string, options: {
|
|
26
|
+
cause?: unknown;
|
|
27
|
+
attempts: number;
|
|
28
|
+
usage: Usage;
|
|
29
|
+
});
|
|
47
30
|
}
|
|
31
|
+
/** Extract structured data from text using a required, schema-backed submit tool. */
|
|
32
|
+
declare function extract<Output, Model extends CompletionModel>(options: ExtractOptions<Output, Model>): Promise<ExtractionResult<Output, RawResponseOf<Model>>>;
|
|
48
33
|
|
|
49
|
-
export { ExtractionError, type
|
|
34
|
+
export { type ExtractOptions, ExtractionError, type ExtractionResult, extract };
|
package/dist/extractor/index.js
CHANGED
|
@@ -1,28 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ExtractionError,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-HYUYZEAJ.js";
|
|
12
|
-
import "../chunk-MELYDKWQ.js";
|
|
13
|
-
import "../chunk-2ODTMRHP.js";
|
|
14
|
-
import "../chunk-UQX6EXWG.js";
|
|
15
|
-
import "../chunk-MRQLEK2B.js";
|
|
16
|
-
import "../chunk-MNWK2USR.js";
|
|
17
|
-
import "../chunk-OIMLU4SF.js";
|
|
18
|
-
import "../chunk-Q25IWLBT.js";
|
|
19
|
-
import "../chunk-MC3CCKEB.js";
|
|
20
|
-
import "../chunk-ADH7NNCS.js";
|
|
21
|
-
import "../chunk-WQKHFADH.js";
|
|
22
|
-
import "../chunk-CWUJUSOS.js";
|
|
3
|
+
extract
|
|
4
|
+
} from "../chunk-LTXABCOO.js";
|
|
5
|
+
import "../chunk-D4PACGPA.js";
|
|
6
|
+
import "../chunk-7PHMK7W4.js";
|
|
7
|
+
import "../chunk-7JLAIN6E.js";
|
|
8
|
+
import "../chunk-QGX73TSQ.js";
|
|
9
|
+
import "../chunk-3XQGVDU5.js";
|
|
10
|
+
import "../chunk-3RWESPUG.js";
|
|
23
11
|
export {
|
|
24
12
|
ExtractionError,
|
|
25
|
-
|
|
26
|
-
ExtractorBuilder
|
|
13
|
+
extract
|
|
27
14
|
};
|
|
28
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,133 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
export { a as allow, f as appendGuardrailPolicies, b as block, d as defineGuardrailPolicy, c as defineInputGuardrail, e as defineOutputGuardrail, g as guardrails, h as hasEnforcedOutputGuardrails, n as normalizeGuardrailPolicies } from '../text-ZLECpQE7.js';
|
|
2
|
+
import { c as GuardrailPolicy, g as InputGuardrailContext, j as InputGuardrailRunResult, i as OutputGuardrailContext, k as OutputGuardrailRunResult } from '../types-DhkodEft.js';
|
|
3
|
+
export { l as GuardrailActionBase, m as GuardrailActionName, n as GuardrailAllow, o as GuardrailBlock, G as GuardrailBoundary, p as GuardrailCommonActions, a as GuardrailDecisionRecord, b as GuardrailMode, d as GuardrailPolicyInput, e as GuardrailPolicyOptions, q as GuardrailRunContext, I as InputGuardrail, f as InputGuardrailActions, r as InputGuardrailResult, s as InputGuardrailRewrite, O as OutputGuardrail, h as OutputGuardrailActions, t as OutputGuardrailResult, u as OutputGuardrailRewrite } from '../types-DhkodEft.js';
|
|
4
|
+
import '../types-DgvozfPc.js';
|
|
5
|
+
import '../model-call-options-CZkSw_xN.js';
|
|
6
|
+
import '../type-utils-CtHVDRn_.js';
|
|
2
7
|
|
|
3
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
4
|
-
type GuardrailMode = "enforce" | "observe";
|
|
5
|
-
type GuardrailBoundary = "input" | "output";
|
|
6
|
-
type GuardrailRunContext = {
|
|
7
|
-
agentId: string;
|
|
8
|
-
runId: string;
|
|
9
|
-
sessionId?: string | undefined;
|
|
10
|
-
metadata?: JsonObject | undefined;
|
|
11
|
-
};
|
|
12
|
-
type GuardrailDecisionRecord = {
|
|
13
|
-
policyId: string;
|
|
14
|
-
guardrailId: string;
|
|
15
|
-
boundary: GuardrailBoundary;
|
|
16
|
-
mode: GuardrailMode;
|
|
17
|
-
action: GuardrailActionName;
|
|
18
|
-
applied: boolean;
|
|
19
|
-
reason?: string | undefined;
|
|
20
|
-
message?: string | undefined;
|
|
21
|
-
metadata?: JsonObject | undefined;
|
|
22
|
-
latencyMs: number;
|
|
23
|
-
};
|
|
24
|
-
type GuardrailActionName = "allow" | "block" | "rewrite" | "error";
|
|
25
|
-
type GuardrailActionBase = {
|
|
26
|
-
reason?: string | undefined;
|
|
27
|
-
metadata?: JsonObject | undefined;
|
|
28
|
-
};
|
|
29
|
-
type GuardrailAllow = GuardrailActionBase & {
|
|
30
|
-
action: "allow";
|
|
31
|
-
};
|
|
32
|
-
type GuardrailBlock = GuardrailActionBase & {
|
|
33
|
-
action: "block";
|
|
34
|
-
reason: string;
|
|
35
|
-
message?: string | undefined;
|
|
36
|
-
};
|
|
37
|
-
type InputGuardrailRewrite = GuardrailActionBase & {
|
|
38
|
-
action: "rewrite";
|
|
39
|
-
prompt?: Message | undefined;
|
|
40
|
-
inputText?: string | undefined;
|
|
41
|
-
};
|
|
42
|
-
type OutputGuardrailRewrite = GuardrailActionBase & {
|
|
43
|
-
action: "rewrite";
|
|
44
|
-
outputText: string;
|
|
45
|
-
};
|
|
46
|
-
type InputGuardrailResult = GuardrailAllow | GuardrailBlock | InputGuardrailRewrite;
|
|
47
|
-
type OutputGuardrailResult = GuardrailAllow | GuardrailBlock | OutputGuardrailRewrite;
|
|
48
|
-
type GuardrailCommonActions = {
|
|
49
|
-
allow(options?: GuardrailActionBase): GuardrailAllow;
|
|
50
|
-
block(options: Omit<GuardrailBlock, "action">): GuardrailBlock;
|
|
51
|
-
};
|
|
52
|
-
type InputGuardrailActions = GuardrailCommonActions & {
|
|
53
|
-
rewrite(options: Omit<InputGuardrailRewrite, "action">): InputGuardrailRewrite;
|
|
54
|
-
};
|
|
55
|
-
type OutputGuardrailActions = GuardrailCommonActions & {
|
|
56
|
-
rewrite(options: Omit<OutputGuardrailRewrite, "action">): OutputGuardrailRewrite;
|
|
57
|
-
};
|
|
58
|
-
type InputGuardrailContext = {
|
|
59
|
-
prompt: Message;
|
|
60
|
-
history: Message[];
|
|
61
|
-
inputText: string;
|
|
62
|
-
run: GuardrailRunContext;
|
|
63
|
-
};
|
|
64
|
-
type OutputGuardrailContext = {
|
|
65
|
-
outputText: string;
|
|
66
|
-
messages: Message[];
|
|
67
|
-
usage: Usage;
|
|
68
|
-
run: GuardrailRunContext;
|
|
69
|
-
};
|
|
70
|
-
type InputGuardrail = {
|
|
71
|
-
id: string;
|
|
72
|
-
check(context: InputGuardrailContext, actions: InputGuardrailActions): MaybePromise<InputGuardrailResult | undefined>;
|
|
73
|
-
};
|
|
74
|
-
type OutputGuardrail = {
|
|
75
|
-
id: string;
|
|
76
|
-
check(context: OutputGuardrailContext, actions: OutputGuardrailActions): MaybePromise<OutputGuardrailResult | undefined>;
|
|
77
|
-
};
|
|
78
|
-
type GuardrailPolicy = {
|
|
79
|
-
id: string;
|
|
80
|
-
mode: GuardrailMode;
|
|
81
|
-
input: InputGuardrail[];
|
|
82
|
-
output: OutputGuardrail[];
|
|
83
|
-
};
|
|
84
|
-
type GuardrailPolicyOptions = {
|
|
85
|
-
id: string;
|
|
86
|
-
mode?: GuardrailMode | undefined;
|
|
87
|
-
input?: InputGuardrail[] | undefined;
|
|
88
|
-
output?: OutputGuardrail[] | undefined;
|
|
89
|
-
};
|
|
90
|
-
type GuardrailPolicyInput = GuardrailPolicy | GuardrailPolicy[];
|
|
91
|
-
type InputGuardrailRunResult = {
|
|
92
|
-
prompt: Message;
|
|
93
|
-
inputText: string;
|
|
94
|
-
blocked: boolean;
|
|
95
|
-
message?: string | undefined;
|
|
96
|
-
decisions: GuardrailDecisionRecord[];
|
|
97
|
-
};
|
|
98
|
-
type OutputGuardrailRunResult = {
|
|
99
|
-
outputText: string;
|
|
100
|
-
blocked: boolean;
|
|
101
|
-
message?: string | undefined;
|
|
102
|
-
decisions: GuardrailDecisionRecord[];
|
|
103
|
-
};
|
|
104
|
-
declare function defineGuardrailPolicy(options: GuardrailPolicyOptions): GuardrailPolicy;
|
|
105
|
-
declare function defineInputGuardrail(guardrail: InputGuardrail): InputGuardrail;
|
|
106
|
-
declare function defineOutputGuardrail(guardrail: OutputGuardrail): OutputGuardrail;
|
|
107
|
-
declare function allow(options?: GuardrailActionBase): GuardrailAllow;
|
|
108
|
-
declare function block(options: Omit<GuardrailBlock, "action">): GuardrailBlock;
|
|
109
|
-
declare const guardrails: {
|
|
110
|
-
blockText: typeof blockText;
|
|
111
|
-
redactText: typeof redactText;
|
|
112
|
-
};
|
|
113
|
-
declare function normalizeGuardrailPolicies(policies: GuardrailPolicyInput | undefined): GuardrailPolicy[];
|
|
114
|
-
declare function appendGuardrailPolicies(current: GuardrailPolicy[], next: GuardrailPolicyInput): GuardrailPolicy[];
|
|
115
|
-
declare function hasEnforcedOutputGuardrails(policies: GuardrailPolicy[]): boolean;
|
|
116
8
|
declare function runInputGuardrails(policies: GuardrailPolicy[], context: InputGuardrailContext): Promise<InputGuardrailRunResult>;
|
|
117
9
|
declare function runOutputGuardrails(policies: GuardrailPolicy[], context: OutputGuardrailContext): Promise<OutputGuardrailRunResult>;
|
|
118
|
-
type TextPatternBoundary = "input" | "output";
|
|
119
|
-
type TextPatternGuardrailFor<Boundary extends TextPatternBoundary> = Boundary extends "input" ? InputGuardrail : OutputGuardrail;
|
|
120
|
-
type TextPatternGuardrailOptions<Boundary extends TextPatternBoundary = TextPatternBoundary> = {
|
|
121
|
-
id: string;
|
|
122
|
-
boundary: Boundary;
|
|
123
|
-
patterns: Array<string | RegExp>;
|
|
124
|
-
reason: string;
|
|
125
|
-
message?: string | undefined;
|
|
126
|
-
};
|
|
127
|
-
type TextPatternRedactOptions<Boundary extends TextPatternBoundary = TextPatternBoundary> = TextPatternGuardrailOptions<Boundary> & {
|
|
128
|
-
replacement?: string | undefined;
|
|
129
|
-
};
|
|
130
|
-
declare function blockText<Boundary extends TextPatternBoundary>(options: TextPatternGuardrailOptions<Boundary>): TextPatternGuardrailFor<Boundary>;
|
|
131
|
-
declare function redactText<Boundary extends TextPatternBoundary>(options: TextPatternRedactOptions<Boundary>): TextPatternGuardrailFor<Boundary>;
|
|
132
10
|
|
|
133
|
-
export {
|
|
11
|
+
export { GuardrailPolicy, InputGuardrailContext, InputGuardrailRunResult, OutputGuardrailContext, OutputGuardrailRunResult, runInputGuardrails, runOutputGuardrails };
|
package/dist/guardrails/index.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { M as ModelCallOptions } from '../model-call-options-CZkSw_xN.js';
|
|
2
|
+
import { b as RetrySetting } from '../retry-CjvSlKGW.js';
|
|
3
|
+
export { R as RetryContext, a as RetryOptions } from '../retry-CjvSlKGW.js';
|
|
4
|
+
import { J as JsonObject } from '../types-DgvozfPc.js';
|
|
2
5
|
|
|
3
6
|
type ImageGenerationRequest = {
|
|
4
7
|
prompt: string;
|
|
5
8
|
width: number;
|
|
6
9
|
height: number;
|
|
7
|
-
|
|
10
|
+
providerOptions?: JsonObject | undefined;
|
|
8
11
|
};
|
|
9
12
|
type GeneratedImage = {
|
|
10
13
|
data: Uint8Array;
|
|
11
14
|
mediaType?: string | undefined;
|
|
12
15
|
};
|
|
13
|
-
type
|
|
14
|
-
|
|
15
|
-
images: GeneratedImage[];
|
|
16
|
-
mediaType?: string | undefined;
|
|
16
|
+
type ImageGenerationResult<RawResponse = unknown> = {
|
|
17
|
+
images: readonly [GeneratedImage, ...GeneratedImage[]];
|
|
17
18
|
rawResponse: RawResponse;
|
|
18
19
|
};
|
|
19
|
-
interface ImageGenerationModel<RawResponse = unknown
|
|
20
|
-
readonly provider
|
|
21
|
-
readonly
|
|
22
|
-
imageGeneration(request: ImageGenerationRequest): Promise<
|
|
20
|
+
interface ImageGenerationModel<RawResponse = unknown> {
|
|
21
|
+
readonly provider: string;
|
|
22
|
+
readonly modelId: string | undefined;
|
|
23
|
+
imageGeneration(request: ImageGenerationRequest, options?: ModelCallOptions): Promise<ImageGenerationResult<RawResponse>>;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
declare function imageGenerationRequest<Model extends ImageGenerationModel>(model: Model): ImageGenerationRequestBuilder<Model>;
|
|
26
|
+
type GenerateImageOptions<Model extends ImageGenerationModel = ImageGenerationModel> = {
|
|
27
|
+
model: Model;
|
|
28
|
+
prompt: string;
|
|
29
|
+
width?: number | undefined;
|
|
30
|
+
height?: number | undefined;
|
|
31
|
+
providerOptions?: JsonObject | undefined;
|
|
32
|
+
retries?: RetrySetting | undefined;
|
|
33
|
+
abortSignal?: AbortSignal | undefined;
|
|
34
|
+
};
|
|
35
|
+
type RawResponseOf<Model> = Model extends ImageGenerationModel<infer RawResponse> ? RawResponse : unknown;
|
|
36
|
+
declare function generateImage<Model extends ImageGenerationModel>(options: GenerateImageOptions<Model>): Promise<ImageGenerationResult<RawResponseOf<Model>>>;
|
|
37
37
|
|
|
38
|
-
export { type GeneratedImage, type ImageGenerationModel, type ImageGenerationRequest,
|
|
38
|
+
export { type GenerateImageOptions, type GeneratedImage, type ImageGenerationModel, type ImageGenerationRequest, type ImageGenerationResult, ModelCallOptions, RetrySetting, generateImage };
|
|
@@ -1,42 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
request = {
|
|
8
|
-
prompt: "",
|
|
9
|
-
width: 1024,
|
|
10
|
-
height: 1024
|
|
11
|
-
};
|
|
12
|
-
prompt(prompt) {
|
|
13
|
-
this.request = { ...this.request, prompt };
|
|
14
|
-
return this;
|
|
15
|
-
}
|
|
16
|
-
width(width) {
|
|
17
|
-
this.request = { ...this.request, width };
|
|
18
|
-
return this;
|
|
19
|
-
}
|
|
20
|
-
height(height) {
|
|
21
|
-
this.request = { ...this.request, height };
|
|
22
|
-
return this;
|
|
23
|
-
}
|
|
24
|
-
additionalParams(additionalParams) {
|
|
25
|
-
this.request = { ...this.request, additionalParams };
|
|
26
|
-
return this;
|
|
27
|
-
}
|
|
28
|
-
build() {
|
|
29
|
-
return { ...this.request };
|
|
30
|
-
}
|
|
31
|
-
send() {
|
|
32
|
-
return this.model.imageGeneration(this.build());
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
function imageGenerationRequest(model) {
|
|
36
|
-
return new ImageGenerationRequestBuilder(model);
|
|
37
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
generateImage
|
|
3
|
+
} from "../chunk-I3Q7XSBB.js";
|
|
4
|
+
import "../chunk-7JLAIN6E.js";
|
|
5
|
+
import "../chunk-3XQGVDU5.js";
|
|
6
|
+
import "../chunk-3RWESPUG.js";
|
|
38
7
|
export {
|
|
39
|
-
|
|
40
|
-
imageGenerationRequest
|
|
8
|
+
generateImage
|
|
41
9
|
};
|
|
42
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export { A as
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
1
|
+
export { A as Agent, a as AgentContextInput, b as AgentMemory, c as AgentMemoryOptions, d as AgentOptions, e as AgentToolInput, f as AgentToolOptions, C as CreateHybridVectorContextOptions, g as CreateVectorContextOptions, V as VectorContext, h as VectorContextBaseOptions, i as createVectorContext, j as isVectorContext } from './agent-DWzW9SoH.js';
|
|
2
|
+
export { AgentRunBlockedError, AgentRunCancelledError, AgentStreamClosedError, AgentStructuredOutputError, AgentStructuredOutputFormat, AgentStructuredOutputPhase, AgentToolSuspensionError, MaxTurnsError } from './agent/index.js';
|
|
3
|
+
export { A as AgentBlockedResult, a as AgentChildStreamEvent, b as AgentDeltaEvent, c as AgentErrorEvent, d as AgentErrorStreamEvent, e as AgentFinishEvent, f as AgentInput, g as AgentLifecycle, h as AgentMemoryCompactionEvent, i as AgentPrompt, j as AgentResponse, k as AgentResult, l as AgentRunOptions, m as AgentRunSettings, n as AgentStartEvent, o as AgentSteerInput, p as AgentSteerReceipt, q as AgentStepFinishEvent, r as AgentStream, s as AgentStreamEvent, t as AgentSuspendedResult, u as AgentToolCallDeltaEvent, v as AgentToolFinishEvent, w as AgentToolStartEvent } from './types-Sue2hb_L.js';
|
|
4
|
+
export { M as ModelCallOptions } from './model-call-options-CZkSw_xN.js';
|
|
5
|
+
export { R as RetryContext, a as RetryOptions, b as RetrySetting } from './retry-CjvSlKGW.js';
|
|
6
|
+
export { A as AssistantContentPart, a as AssistantGenerationMetadata, b as AssistantMessage, C as CompletionFinishReason, c as CompletionModel, d as CompletionModelInfo, e as CompletionModelStreamEvent, f as CompletionRequest, g as CompletionResponse, h as CompletionResult, i as CompletionSource, j as CompletionStreamEvent, k as CompletionTool, l as ContextUsage, D as Document, F as FileData, m as FilePart, I as ImageDetail, n as ImagePart, J as JsonObject, o as JsonPrimitive, p as JsonValue, M as Message, q as ModelContextLimits, P as ProviderTool, r as ProviderToolCall, R as ReasoningContentType, s as ReasoningDetail, t as ReasoningPart, S as SystemMessage, T as TextPart, u as ToolCallPart, v as ToolChoice, w as ToolDefinition, x as ToolMessage, y as ToolResultContentPart, z as ToolResultOutput, B as ToolResultPart, U as Usage, E as UserContentPart, G as UserMessage, H as calculateContextUsage, K as getAssistantGenerationMetadata, L as isProviderTool, N as resolveModelContextLimits, O as withContextUsage } from './types-DgvozfPc.js';
|
|
7
|
+
export { C as COMPLETION_PROVIDER_OUTPUT_ERROR_CODE, a as CompletionBaseOptions, b as CompletionInput, c as CompletionProviderOutputError, d as CompletionProviderOutputErrorKind, e as CompletionProviderOutputErrorOptions, f as CompletionStructuredOutputError, g as CompletionStructuredOutputPhase, G as GenerateCompletionOptions, h as GenerateStructuredCompletionOptions, M as MessageMetadataSchema, S as StreamCompletionOptions, i as StreamStructuredCompletionOptions, j as createMessageSchema, k as generateCompletion, l as isJsonValue, m as isMessage, n as messageSchema, o as messagesSchema, p as parseMessage, q as parseMessages, s as streamCompletion } from './provider-output-error-BEwDgVv3.js';
|
|
8
|
+
export { a as allow, b as block, d as defineGuardrailPolicy, c as defineInputGuardrail, e as defineOutputGuardrail, g as guardrails } from './text-ZLECpQE7.js';
|
|
9
|
+
export { G as GuardrailBoundary, a as GuardrailDecisionRecord, b as GuardrailMode, c as GuardrailPolicy, d as GuardrailPolicyInput, e as GuardrailPolicyOptions, I as InputGuardrail, f as InputGuardrailActions, g as InputGuardrailContext, O as OutputGuardrail, h as OutputGuardrailActions, i as OutputGuardrailContext } from './types-DhkodEft.js';
|
|
10
|
+
export { GenerateImageOptions, GeneratedImage, ImageGenerationModel, ImageGenerationRequest, ImageGenerationResult, generateImage } from './image-generation/index.js';
|
|
11
|
+
export { MemoryCompactionConflictError, MemoryCompactionError, createMemoryScopeKey, createSummaryMemoryCompactor, isMemoryCompactionMessage } from './memory/index.js';
|
|
12
|
+
export { C as CreateMemoryScopeKeyOptions, a as CreateSummaryMemoryCompactorOptions, M as MemoryAppendOptions, b as MemoryClearOptions, c as MemoryCompactionCapability, d as MemoryCompactionConflictRetryOptions, e as MemoryCompactionInfo, f as MemoryCompactionMessage, g as MemoryCompactionMetadata, h as MemoryCompactionOptions, i as MemoryCompactionReplacePrefixOptions, j as MemoryCompactionReplacePrefixResult, k as MemoryCompactionSnapshot, l as MemoryCompactionSnapshotOptions, m as MemoryCompactor, n as MemoryCompactorInput, o as MemoryCompactorResult, p as MemoryConversation, q as MemoryConversationGetOptions, r as MemoryConversationListOptions, s as MemoryConversationMessage, t as MemoryConversationSummary, u as MemoryErrorOptions, v as MemoryInspector, w as MemoryLoadOptions, x as MemoryOptions, y as MemorySavePolicy, z as MemoryScope, A as MemoryScopeKeyOptions, B as MemoryScopeKeyResolver, D as MemoryStore } from './types-DKOXVTcq.js';
|
|
11
13
|
export { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
|
|
12
14
|
export { loadSkills, skill } from './skills/index.js';
|
|
13
|
-
export { S as SkillValidationError } from './types-
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export { A as
|
|
17
|
-
export {
|
|
18
|
-
|
|
19
|
-
import './types-
|
|
20
|
-
import '
|
|
21
|
-
import '
|
|
22
|
-
import '
|
|
23
|
-
import './
|
|
24
|
-
import './types-BCTRUGex.js';
|
|
15
|
+
export { S as SkillValidationError } from './types-DC1U1XwW.js';
|
|
16
|
+
export { GenerateSpeechOptions, SpeechGenerationModel, SpeechGenerationRequest, SpeechGenerationResult, generateSpeech } from './speech-generation/index.js';
|
|
17
|
+
export { C as CreateToolOptions, c as createQuestionTool, a as createThinkTool, b as createTool } from './think-tool-BwCsJ365.js';
|
|
18
|
+
export { A as AnyTool, T as Tool, a as ToolApprovalContext, b as ToolApprovalRequirement, c as ToolCallContext, d as ToolCallStreamEvent, e as ToolRequiresApproval } from './tool-BpqpoRSE.js';
|
|
19
|
+
export { A as AgentMiddleware, C as CompletionRequestMiddlewareArgs, a as CompletionRequestMiddlewareResult, b as CompletionResponseMiddlewareArgs, c as CompletionResponseMiddlewareResult, T as ToolInputMiddlewareArgs, d as ToolInputMiddlewareResult, e as ToolOutputMiddlewareArgs, f as ToolOutputMiddlewareResult, g as ToolResultMiddlewareArgs, h as createMiddleware } from './middleware-kcF8AusP.js';
|
|
20
|
+
export { TranscribeOptions, TranscriptionAudio, TranscriptionModel, TranscriptionRequest, TranscriptionResult, transcribe } from './transcription/index.js';
|
|
21
|
+
import './types-DjqRHeAi.js';
|
|
22
|
+
import './dynamic-tools-aIZlg5x1.js';
|
|
23
|
+
import './types-Cr4uiYo5.js';
|
|
24
|
+
import './types-CXNE592e.js';
|
|
25
|
+
import './agent/interactions/index.js';
|
|
25
26
|
import 'zod';
|
|
27
|
+
import './type-utils-CtHVDRn_.js';
|