@anvia/core 0.1.0
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 +101 -0
- package/dist/agent/index.d.ts +70 -0
- package/dist/agent/index.js +31 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent-C6h6YrRU.d.ts +218 -0
- package/dist/audio-generation/index.d.ts +32 -0
- package/dist/audio-generation/index.js +9 -0
- package/dist/audio-generation/index.js.map +1 -0
- package/dist/chunk-7QI6ZAFI.js +61 -0
- package/dist/chunk-7QI6ZAFI.js.map +1 -0
- package/dist/chunk-A7VDIZQN.js +145 -0
- package/dist/chunk-A7VDIZQN.js.map +1 -0
- package/dist/chunk-B24Q2ZYM.js +43 -0
- package/dist/chunk-B24Q2ZYM.js.map +1 -0
- package/dist/chunk-B4QHQN5K.js +37 -0
- package/dist/chunk-B4QHQN5K.js.map +1 -0
- package/dist/chunk-CP47FBJV.js +324 -0
- package/dist/chunk-CP47FBJV.js.map +1 -0
- package/dist/chunk-FI2BTRT5.js +86 -0
- package/dist/chunk-FI2BTRT5.js.map +1 -0
- package/dist/chunk-GNWMOSNR.js +113 -0
- package/dist/chunk-GNWMOSNR.js.map +1 -0
- package/dist/chunk-I77SDTFE.js +43 -0
- package/dist/chunk-I77SDTFE.js.map +1 -0
- package/dist/chunk-IA76K5UX.js +142 -0
- package/dist/chunk-IA76K5UX.js.map +1 -0
- package/dist/chunk-IQBY2GCF.js +1207 -0
- package/dist/chunk-IQBY2GCF.js.map +1 -0
- package/dist/chunk-KSIY7KJA.js +387 -0
- package/dist/chunk-KSIY7KJA.js.map +1 -0
- package/dist/chunk-LMBOJMNB.js +304 -0
- package/dist/chunk-LMBOJMNB.js.map +1 -0
- package/dist/chunk-S55WOHX5.js +9 -0
- package/dist/chunk-S55WOHX5.js.map +1 -0
- package/dist/chunk-SRGJPXKT.js +256 -0
- package/dist/chunk-SRGJPXKT.js.map +1 -0
- package/dist/chunk-WZTPK5HV.js +125 -0
- package/dist/chunk-WZTPK5HV.js.map +1 -0
- package/dist/chunk-X6FBOU2P.js +96 -0
- package/dist/chunk-X6FBOU2P.js.map +1 -0
- package/dist/chunk-XUUY2L2D.js +42 -0
- package/dist/chunk-XUUY2L2D.js.map +1 -0
- package/dist/completion/index.d.ts +36 -0
- package/dist/completion/index.js +29 -0
- package/dist/completion/index.js.map +1 -0
- package/dist/embeddings/index.d.ts +34 -0
- package/dist/embeddings/index.js +23 -0
- package/dist/embeddings/index.js.map +1 -0
- package/dist/evals/index.d.ts +153 -0
- package/dist/evals/index.js +30 -0
- package/dist/evals/index.js.map +1 -0
- package/dist/extractor/index.d.ts +45 -0
- package/dist/extractor/index.js +19 -0
- package/dist/extractor/index.js.map +1 -0
- package/dist/image-generation/index.d.ts +37 -0
- package/dist/image-generation/index.js +9 -0
- package/dist/image-generation/index.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +183 -0
- package/dist/index.js.map +1 -0
- package/dist/loaders/index.d.ts +82 -0
- package/dist/loaders/index.js +287 -0
- package/dist/loaders/index.js.map +1 -0
- package/dist/mcp/index.d.ts +15 -0
- package/dist/mcp/index.js +9 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/observability/index.d.ts +93 -0
- package/dist/observability/index.js +7 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/pipeline/index.d.ts +51 -0
- package/dist/pipeline/index.js +9 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/skills/index.d.ts +12 -0
- package/dist/skills/index.js +16 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/streaming/index.d.ts +6 -0
- package/dist/streaming/index.js +7 -0
- package/dist/streaming/index.js.map +1 -0
- package/dist/tool/index.d.ts +42 -0
- package/dist/tool/index.js +33 -0
- package/dist/tool/index.js.map +1 -0
- package/dist/tool-DhuBQ3yb.d.ts +35 -0
- package/dist/transcription/index.d.ts +35 -0
- package/dist/transcription/index.js +9 -0
- package/dist/transcription/index.js.map +1 -0
- package/dist/types-B5B8Sdl4.d.ts +64 -0
- package/dist/types-BrxLd7ay.d.ts +250 -0
- package/dist/types-HvopERm0.d.ts +30 -0
- package/dist/vector-store/index.d.ts +111 -0
- package/dist/vector-store/index.js +15 -0
- package/dist/vector-store/index.js.map +1 -0
- package/dist/zod-schema-DJTEgQBq.d.ts +40 -0
- package/package.json +102 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EvalOutcome,
|
|
3
|
+
agentEvalTarget,
|
|
4
|
+
contains,
|
|
5
|
+
exactMatch,
|
|
6
|
+
llmJudge,
|
|
7
|
+
llmScore,
|
|
8
|
+
runEvalSuite,
|
|
9
|
+
semanticSimilarity
|
|
10
|
+
} from "../chunk-LMBOJMNB.js";
|
|
11
|
+
import "../chunk-IA76K5UX.js";
|
|
12
|
+
import "../chunk-X6FBOU2P.js";
|
|
13
|
+
import "../chunk-SRGJPXKT.js";
|
|
14
|
+
import "../chunk-IQBY2GCF.js";
|
|
15
|
+
import "../chunk-XUUY2L2D.js";
|
|
16
|
+
import "../chunk-GNWMOSNR.js";
|
|
17
|
+
import "../chunk-B4QHQN5K.js";
|
|
18
|
+
import "../chunk-CP47FBJV.js";
|
|
19
|
+
import "../chunk-A7VDIZQN.js";
|
|
20
|
+
export {
|
|
21
|
+
EvalOutcome,
|
|
22
|
+
agentEvalTarget,
|
|
23
|
+
contains,
|
|
24
|
+
exactMatch,
|
|
25
|
+
llmJudge,
|
|
26
|
+
llmScore,
|
|
27
|
+
runEvalSuite,
|
|
28
|
+
semanticSimilarity
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { A as Agent } from '../agent-C6h6YrRU.js';
|
|
2
|
+
import { U as Usage, M as Message, b as CompletionModel, j as JsonValue, o as ToolChoice } from '../types-BrxLd7ay.js';
|
|
3
|
+
import { Z as ZodSchema } from '../zod-schema-DJTEgQBq.js';
|
|
4
|
+
import '../observability/index.js';
|
|
5
|
+
import '../tool-DhuBQ3yb.js';
|
|
6
|
+
import '../vector-store/index.js';
|
|
7
|
+
import '../embeddings/index.js';
|
|
8
|
+
import 'zod';
|
|
9
|
+
|
|
10
|
+
type ExtractionResponse<T> = {
|
|
11
|
+
data: T;
|
|
12
|
+
usage: Usage;
|
|
13
|
+
messages: Message[];
|
|
14
|
+
};
|
|
15
|
+
declare class ExtractionError extends Error {
|
|
16
|
+
readonly cause?: unknown | undefined;
|
|
17
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
18
|
+
}
|
|
19
|
+
declare class Extractor<T, M extends CompletionModel = CompletionModel> {
|
|
20
|
+
private readonly agent;
|
|
21
|
+
private readonly schema;
|
|
22
|
+
private readonly retryCount;
|
|
23
|
+
constructor(agent: Agent<M>, schema: ZodSchema<T>, retryCount: number);
|
|
24
|
+
extract(text: string | Message): Promise<T>;
|
|
25
|
+
extractWithUsage(text: string | Message): Promise<ExtractionResponse<T>>;
|
|
26
|
+
extractWithHistory(text: string | Message, history: Message[]): Promise<T>;
|
|
27
|
+
getInner(): Agent<M>;
|
|
28
|
+
private run;
|
|
29
|
+
}
|
|
30
|
+
declare class ExtractorBuilder<T, M extends CompletionModel = CompletionModel> {
|
|
31
|
+
private readonly schema;
|
|
32
|
+
private readonly agentBuilder;
|
|
33
|
+
private retryCount;
|
|
34
|
+
constructor(model: M, schema: ZodSchema<T>);
|
|
35
|
+
instructions(instructions: string): this;
|
|
36
|
+
context(text: string, id?: string): this;
|
|
37
|
+
temperature(temperature: number): this;
|
|
38
|
+
maxTokens(maxTokens: number): this;
|
|
39
|
+
additionalParams(params: JsonValue): this;
|
|
40
|
+
toolChoice(toolChoice: ToolChoice): this;
|
|
41
|
+
retries(retries: number): this;
|
|
42
|
+
build(): Extractor<T, M>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { ExtractionError, type ExtractionResponse, Extractor, ExtractorBuilder };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ExtractionError,
|
|
3
|
+
Extractor,
|
|
4
|
+
ExtractorBuilder
|
|
5
|
+
} from "../chunk-IA76K5UX.js";
|
|
6
|
+
import "../chunk-X6FBOU2P.js";
|
|
7
|
+
import "../chunk-SRGJPXKT.js";
|
|
8
|
+
import "../chunk-IQBY2GCF.js";
|
|
9
|
+
import "../chunk-XUUY2L2D.js";
|
|
10
|
+
import "../chunk-GNWMOSNR.js";
|
|
11
|
+
import "../chunk-B4QHQN5K.js";
|
|
12
|
+
import "../chunk-CP47FBJV.js";
|
|
13
|
+
import "../chunk-A7VDIZQN.js";
|
|
14
|
+
export {
|
|
15
|
+
ExtractionError,
|
|
16
|
+
Extractor,
|
|
17
|
+
ExtractorBuilder
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { j as JsonValue } from '../types-BrxLd7ay.js';
|
|
2
|
+
|
|
3
|
+
type ImageGenerationRequest = {
|
|
4
|
+
prompt: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
additionalParams?: JsonValue | undefined;
|
|
8
|
+
};
|
|
9
|
+
type GeneratedImage = {
|
|
10
|
+
data: Uint8Array;
|
|
11
|
+
mediaType?: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
type ImageGenerationResponse<RawResponse = unknown> = {
|
|
14
|
+
image: Uint8Array;
|
|
15
|
+
images: GeneratedImage[];
|
|
16
|
+
mediaType?: string | undefined;
|
|
17
|
+
rawResponse: RawResponse;
|
|
18
|
+
};
|
|
19
|
+
interface ImageGenerationModel<RawResponse = unknown> {
|
|
20
|
+
readonly provider?: string | undefined;
|
|
21
|
+
readonly defaultModel?: string | undefined;
|
|
22
|
+
imageGeneration(request: ImageGenerationRequest): Promise<ImageGenerationResponse<RawResponse>>;
|
|
23
|
+
}
|
|
24
|
+
declare class ImageGenerationRequestBuilder<Model extends ImageGenerationModel = ImageGenerationModel> {
|
|
25
|
+
private readonly model;
|
|
26
|
+
private request;
|
|
27
|
+
constructor(model: Model);
|
|
28
|
+
prompt(prompt: string): this;
|
|
29
|
+
width(width: number): this;
|
|
30
|
+
height(height: number): this;
|
|
31
|
+
additionalParams(additionalParams: JsonValue): this;
|
|
32
|
+
build(): ImageGenerationRequest;
|
|
33
|
+
send(): Promise<Awaited<ReturnType<Model["imageGeneration"]>>>;
|
|
34
|
+
}
|
|
35
|
+
declare function imageGenerationRequest<Model extends ImageGenerationModel>(model: Model): ImageGenerationRequestBuilder<Model>;
|
|
36
|
+
|
|
37
|
+
export { type GeneratedImage, type ImageGenerationModel, type ImageGenerationRequest, ImageGenerationRequestBuilder, type ImageGenerationResponse, imageGenerationRequest };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { A as Agent, a as AgentOptions, b as AgentStreamEvent, c as AgentToolOptions, C as CompletionCallHookArgs, d as CompletionResponseHookArgs, D as DEFAULT_MAX_TURNS, e as DynamicContextOptions, f as DynamicContextRegistration, g as DynamicToolOptions, h as DynamicToolRegistration, H as HookAction, i as HookResult, P as PromptHook, j as PromptRequest, k as PromptResponse, R as RunControl, T as ToolCallControl, l as ToolCallHookAction, m as ToolCallHookArgs, n as ToolCallHookResult, o as ToolHookArgs, p as ToolResultHookArgs, q as cancelPrompt, r as createHook, s as runControl, t as skipTool, u as toolCallControl } from './agent-C6h6YrRU.js';
|
|
2
|
+
export { AgentBuilder, MaxTurnsError, PromptCancelledError } from './agent/index.js';
|
|
3
|
+
export { AudioGenerationModel, AudioGenerationRequest, AudioGenerationRequestBuilder, AudioGenerationResponse, audioGenerationRequest } from './audio-generation/index.js';
|
|
4
|
+
export { CompletionRequestBuilder, formatDocument, normalizeDocuments } from './completion/index.js';
|
|
5
|
+
export { A as AssistantContent, a as AssistantMessage, C as CompletionCapabilityError, b as CompletionModel, c as CompletionModelCapabilities, d as CompletionRequest, e as CompletionResponse, f as CompletionStreamEvent, D as Document, g as DocumentContent, I as ImageContent, h as ImageDetail, J as JsonObject, i as JsonPrimitive, j as JsonValue, M as Message, R as Reasoning, k as ReasoningContent, l as ReasoningContentType, S as StreamingCompletionModel, m as SystemMessage, T as Text, n as ToolCall, o as ToolChoice, p as ToolContent, q as ToolDefinition, r as ToolFunction, s as ToolMessage, t as ToolResult, u as ToolResultContent, U as Usage, v as UserContent, w as UserMessage, x as assertCompletionRequestSupported, y as reasoningDisplayText, z as textFromAssistantContent } from './types-BrxLd7ay.js';
|
|
6
|
+
export { EmbedDocumentsOptions, EmbeddedDocument, Embedding, EmbeddingModel, VectorMetadata, VectorMetadataValue, angularDistance, chebyshevDistance, cosineSimilarity, dotProduct, embedDocuments, embedText, embedTexts, euclideanDistance, manhattanDistance } from './embeddings/index.js';
|
|
7
|
+
export { AgentEvalTargetOptions, ContainsOptions, EvalCase, EvalCaseResult, EvalMetadata, EvalMetric, EvalMetricArgs, EvalMetricResult, EvalOutcome, EvalOutcomeStatus, EvalReportArgs, EvalReporter, EvalSuiteResult, EvalTarget, ExactMatchOptions, LlmJudgeOptions, LlmScoreMetricScore, LlmScoreOptions, RunEvalSuiteOptions, SelectorOrValue, SemanticSimilarityOptions, ValueSelector, agentEvalTarget, contains, exactMatch, llmJudge, llmScore, runEvalSuite, semanticSimilarity } from './evals/index.js';
|
|
8
|
+
export { ExtractionError, ExtractionResponse, Extractor, ExtractorBuilder } from './extractor/index.js';
|
|
9
|
+
export { GeneratedImage, ImageGenerationModel, ImageGenerationRequest, ImageGenerationRequestBuilder, ImageGenerationResponse, imageGenerationRequest } from './image-generation/index.js';
|
|
10
|
+
export { connectMcp, mcp } from './mcp/index.js';
|
|
11
|
+
export { M as McpClient, a as McpConnection, b as McpHttpOptions, c as McpServer, d as McpStdioOptions, e as McpToolCallContent, f as McpToolCallResult, g as McpToolDefinition } from './types-B5B8Sdl4.js';
|
|
12
|
+
export { AgentGenerationEndArgs, AgentGenerationErrorArgs, AgentGenerationObserver, AgentGenerationStartArgs, AgentObserver, AgentObserverRegistration, AgentRunEndArgs, AgentRunErrorArgs, AgentRunObserver, AgentRunStartArgs, AgentToolEndArgs, AgentToolErrorArgs, AgentToolObserver, AgentToolStartArgs, AgentTraceInfo, AgentTraceOptions, ObserveOptions, createObserver } from './observability/index.js';
|
|
13
|
+
export { Pipeline, PipelineBatchOptions, PipelineBuilder, PipelineOp } from './pipeline/index.js';
|
|
14
|
+
export { D as DynamicToolIndex, E as EmbedToolsOptions, T as ToolSearchDocument, a as ToolSet, Z as ZodSchema, c as createToolIndex, e as embedTools, i as isDynamicToolIndex } from './zod-schema-DJTEgQBq.js';
|
|
15
|
+
export { loadSkills, skill } from './skills/index.js';
|
|
16
|
+
export { S as Skill, a as SkillLoader, b as SkillSet, c as SkillValidationError, d as SkillValidationIssue } from './types-HvopERm0.js';
|
|
17
|
+
export { ReadableStreamOptions, toReadableStream } from './streaming/index.js';
|
|
18
|
+
export { CreateThinkToolOptions, CreateToolOptions, ToolCallError, ToolJsonError, ToolNotFoundError, createThinkTool, createTool } from './tool/index.js';
|
|
19
|
+
export { A as AnyTool, T as Tool, a as ToolApprovalContext, b as ToolApprovalPolicy, c as ToolApprovalRunContext, p as parseToolArgs, s as serializeToolOutput } from './tool-DhuBQ3yb.js';
|
|
20
|
+
export { TranscriptionModel, TranscriptionRequest, TranscriptionRequestBuilder, TranscriptionResponse, transcriptionRequest } from './transcription/index.js';
|
|
21
|
+
export { InMemoryVectorIndex, InMemoryVectorStore, IndexStrategy, VectorFilter, VectorSearchIndex, VectorSearchRequest, VectorSearchResult, VectorSearchToolOptions, createVectorSearchTool, vectorFilter } from './vector-store/index.js';
|
|
22
|
+
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
23
|
+
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
24
|
+
import 'zod';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import {
|
|
2
|
+
connectMcp,
|
|
3
|
+
mcp
|
|
4
|
+
} from "./chunk-WZTPK5HV.js";
|
|
5
|
+
import {
|
|
6
|
+
createObserver
|
|
7
|
+
} from "./chunk-S55WOHX5.js";
|
|
8
|
+
import {
|
|
9
|
+
Pipeline,
|
|
10
|
+
PipelineBuilder
|
|
11
|
+
} from "./chunk-FI2BTRT5.js";
|
|
12
|
+
import {
|
|
13
|
+
SkillValidationError,
|
|
14
|
+
loadSkills,
|
|
15
|
+
skill
|
|
16
|
+
} from "./chunk-KSIY7KJA.js";
|
|
17
|
+
import {
|
|
18
|
+
TranscriptionRequestBuilder,
|
|
19
|
+
transcriptionRequest
|
|
20
|
+
} from "./chunk-7QI6ZAFI.js";
|
|
21
|
+
import {
|
|
22
|
+
AudioGenerationRequestBuilder,
|
|
23
|
+
audioGenerationRequest
|
|
24
|
+
} from "./chunk-I77SDTFE.js";
|
|
25
|
+
import {
|
|
26
|
+
EvalOutcome,
|
|
27
|
+
agentEvalTarget,
|
|
28
|
+
contains,
|
|
29
|
+
exactMatch,
|
|
30
|
+
llmJudge,
|
|
31
|
+
llmScore,
|
|
32
|
+
runEvalSuite,
|
|
33
|
+
semanticSimilarity
|
|
34
|
+
} from "./chunk-LMBOJMNB.js";
|
|
35
|
+
import {
|
|
36
|
+
ExtractionError,
|
|
37
|
+
Extractor,
|
|
38
|
+
ExtractorBuilder
|
|
39
|
+
} from "./chunk-IA76K5UX.js";
|
|
40
|
+
import {
|
|
41
|
+
createThinkTool,
|
|
42
|
+
createToolIndex,
|
|
43
|
+
embedTools,
|
|
44
|
+
isDynamicToolIndex
|
|
45
|
+
} from "./chunk-X6FBOU2P.js";
|
|
46
|
+
import {
|
|
47
|
+
InMemoryVectorIndex,
|
|
48
|
+
InMemoryVectorStore,
|
|
49
|
+
createVectorSearchTool,
|
|
50
|
+
vectorFilter
|
|
51
|
+
} from "./chunk-SRGJPXKT.js";
|
|
52
|
+
import {
|
|
53
|
+
Agent,
|
|
54
|
+
AgentBuilder,
|
|
55
|
+
DEFAULT_MAX_TURNS,
|
|
56
|
+
MaxTurnsError,
|
|
57
|
+
PromptCancelledError,
|
|
58
|
+
PromptRequest,
|
|
59
|
+
cancelPrompt,
|
|
60
|
+
createHook,
|
|
61
|
+
runControl,
|
|
62
|
+
skipTool,
|
|
63
|
+
toolCallControl
|
|
64
|
+
} from "./chunk-IQBY2GCF.js";
|
|
65
|
+
import {
|
|
66
|
+
toReadableStream
|
|
67
|
+
} from "./chunk-XUUY2L2D.js";
|
|
68
|
+
import {
|
|
69
|
+
ToolCallError,
|
|
70
|
+
ToolJsonError,
|
|
71
|
+
ToolNotFoundError,
|
|
72
|
+
ToolSet,
|
|
73
|
+
parseToolArgs,
|
|
74
|
+
serializeToolOutput
|
|
75
|
+
} from "./chunk-GNWMOSNR.js";
|
|
76
|
+
import {
|
|
77
|
+
createTool
|
|
78
|
+
} from "./chunk-B4QHQN5K.js";
|
|
79
|
+
import {
|
|
80
|
+
AssistantContent,
|
|
81
|
+
CompletionCapabilityError,
|
|
82
|
+
CompletionRequestBuilder,
|
|
83
|
+
Message,
|
|
84
|
+
ToolContent,
|
|
85
|
+
Usage,
|
|
86
|
+
UserContent,
|
|
87
|
+
assertCompletionRequestSupported,
|
|
88
|
+
formatDocument,
|
|
89
|
+
normalizeDocuments,
|
|
90
|
+
reasoningDisplayText,
|
|
91
|
+
textFromAssistantContent
|
|
92
|
+
} from "./chunk-CP47FBJV.js";
|
|
93
|
+
import {
|
|
94
|
+
angularDistance,
|
|
95
|
+
chebyshevDistance,
|
|
96
|
+
cosineSimilarity,
|
|
97
|
+
dotProduct,
|
|
98
|
+
embedDocuments,
|
|
99
|
+
embedText,
|
|
100
|
+
embedTexts,
|
|
101
|
+
euclideanDistance,
|
|
102
|
+
manhattanDistance
|
|
103
|
+
} from "./chunk-A7VDIZQN.js";
|
|
104
|
+
import {
|
|
105
|
+
ImageGenerationRequestBuilder,
|
|
106
|
+
imageGenerationRequest
|
|
107
|
+
} from "./chunk-B24Q2ZYM.js";
|
|
108
|
+
export {
|
|
109
|
+
Agent,
|
|
110
|
+
AgentBuilder,
|
|
111
|
+
AssistantContent,
|
|
112
|
+
AudioGenerationRequestBuilder,
|
|
113
|
+
CompletionCapabilityError,
|
|
114
|
+
CompletionRequestBuilder,
|
|
115
|
+
DEFAULT_MAX_TURNS,
|
|
116
|
+
EvalOutcome,
|
|
117
|
+
ExtractionError,
|
|
118
|
+
Extractor,
|
|
119
|
+
ExtractorBuilder,
|
|
120
|
+
ImageGenerationRequestBuilder,
|
|
121
|
+
InMemoryVectorIndex,
|
|
122
|
+
InMemoryVectorStore,
|
|
123
|
+
MaxTurnsError,
|
|
124
|
+
Message,
|
|
125
|
+
Pipeline,
|
|
126
|
+
PipelineBuilder,
|
|
127
|
+
PromptCancelledError,
|
|
128
|
+
PromptRequest,
|
|
129
|
+
SkillValidationError,
|
|
130
|
+
ToolCallError,
|
|
131
|
+
ToolContent,
|
|
132
|
+
ToolJsonError,
|
|
133
|
+
ToolNotFoundError,
|
|
134
|
+
ToolSet,
|
|
135
|
+
TranscriptionRequestBuilder,
|
|
136
|
+
Usage,
|
|
137
|
+
UserContent,
|
|
138
|
+
agentEvalTarget,
|
|
139
|
+
angularDistance,
|
|
140
|
+
assertCompletionRequestSupported,
|
|
141
|
+
audioGenerationRequest,
|
|
142
|
+
cancelPrompt,
|
|
143
|
+
chebyshevDistance,
|
|
144
|
+
connectMcp,
|
|
145
|
+
contains,
|
|
146
|
+
cosineSimilarity,
|
|
147
|
+
createHook,
|
|
148
|
+
createObserver,
|
|
149
|
+
createThinkTool,
|
|
150
|
+
createTool,
|
|
151
|
+
createToolIndex,
|
|
152
|
+
createVectorSearchTool,
|
|
153
|
+
dotProduct,
|
|
154
|
+
embedDocuments,
|
|
155
|
+
embedText,
|
|
156
|
+
embedTexts,
|
|
157
|
+
embedTools,
|
|
158
|
+
euclideanDistance,
|
|
159
|
+
exactMatch,
|
|
160
|
+
formatDocument,
|
|
161
|
+
imageGenerationRequest,
|
|
162
|
+
isDynamicToolIndex,
|
|
163
|
+
llmJudge,
|
|
164
|
+
llmScore,
|
|
165
|
+
loadSkills,
|
|
166
|
+
manhattanDistance,
|
|
167
|
+
mcp,
|
|
168
|
+
normalizeDocuments,
|
|
169
|
+
parseToolArgs,
|
|
170
|
+
reasoningDisplayText,
|
|
171
|
+
runControl,
|
|
172
|
+
runEvalSuite,
|
|
173
|
+
semanticSimilarity,
|
|
174
|
+
serializeToolOutput,
|
|
175
|
+
skill,
|
|
176
|
+
skipTool,
|
|
177
|
+
textFromAssistantContent,
|
|
178
|
+
toReadableStream,
|
|
179
|
+
toolCallControl,
|
|
180
|
+
transcriptionRequest,
|
|
181
|
+
vectorFilter
|
|
182
|
+
};
|
|
183
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { D as Document } from '../types-BrxLd7ay.js';
|
|
2
|
+
|
|
3
|
+
type LoaderResult<T> = {
|
|
4
|
+
ok: true;
|
|
5
|
+
value: T;
|
|
6
|
+
} | {
|
|
7
|
+
ok: false;
|
|
8
|
+
error: unknown;
|
|
9
|
+
};
|
|
10
|
+
type FileSource = {
|
|
11
|
+
path: string;
|
|
12
|
+
} | {
|
|
13
|
+
path: "<memory>";
|
|
14
|
+
bytes: Uint8Array;
|
|
15
|
+
};
|
|
16
|
+
type FileReadWithPath = {
|
|
17
|
+
path: string;
|
|
18
|
+
text: string;
|
|
19
|
+
};
|
|
20
|
+
type PdfSource = {
|
|
21
|
+
path: string;
|
|
22
|
+
} | {
|
|
23
|
+
path: "<memory>";
|
|
24
|
+
bytes: Uint8Array;
|
|
25
|
+
};
|
|
26
|
+
type PdfReadWithPath = {
|
|
27
|
+
path: string;
|
|
28
|
+
text: string;
|
|
29
|
+
};
|
|
30
|
+
type PdfPage = {
|
|
31
|
+
pageNumber: number;
|
|
32
|
+
text: string;
|
|
33
|
+
};
|
|
34
|
+
type PdfPageWithPath = {
|
|
35
|
+
path: string;
|
|
36
|
+
pageNumber: number;
|
|
37
|
+
text: string;
|
|
38
|
+
};
|
|
39
|
+
declare class FileLoader<T = LoaderResult<FileSource>> implements AsyncIterable<T> {
|
|
40
|
+
private readonly source;
|
|
41
|
+
private readonly mode;
|
|
42
|
+
private readonly skipErrors;
|
|
43
|
+
private constructor();
|
|
44
|
+
static withGlob(pattern: string): FileLoader<LoaderResult<FileSource>>;
|
|
45
|
+
static withDir(directory: string): FileLoader<LoaderResult<FileSource>>;
|
|
46
|
+
static fromBytes(bytes: Uint8Array | ArrayBuffer): FileLoader<LoaderResult<FileSource>>;
|
|
47
|
+
static fromBytesMany(bytes: Array<Uint8Array | ArrayBuffer>): FileLoader<LoaderResult<FileSource>>;
|
|
48
|
+
read(): FileLoader<LoaderResult<string>>;
|
|
49
|
+
readWithPath(): FileLoader<LoaderResult<FileReadWithPath>>;
|
|
50
|
+
ignoreErrors(): FileLoader<UnwrapLoaderResult<T>>;
|
|
51
|
+
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
52
|
+
}
|
|
53
|
+
declare class PdfFileLoader<T = LoaderResult<PdfSource>> implements AsyncIterable<T> {
|
|
54
|
+
private readonly source;
|
|
55
|
+
private readonly mode;
|
|
56
|
+
private readonly skipErrors;
|
|
57
|
+
private constructor();
|
|
58
|
+
static withGlob(pattern: string): PdfFileLoader<LoaderResult<PdfSource>>;
|
|
59
|
+
static withDir(directory: string): PdfFileLoader<LoaderResult<PdfSource>>;
|
|
60
|
+
static fromBytes(bytes: Uint8Array | ArrayBuffer): PdfFileLoader<LoaderResult<PdfSource>>;
|
|
61
|
+
static fromBytesMany(bytes: Array<Uint8Array | ArrayBuffer>): PdfFileLoader<LoaderResult<PdfSource>>;
|
|
62
|
+
read(): PdfFileLoader<LoaderResult<string>>;
|
|
63
|
+
readWithPath(): PdfFileLoader<LoaderResult<PdfReadWithPath>>;
|
|
64
|
+
byPage(this: PdfFileLoader<LoaderResult<PdfReadWithPath>>): PdfFileLoader<LoaderResult<PdfPageWithPath>>;
|
|
65
|
+
byPage(this: PdfFileLoader<PdfReadWithPath>): PdfFileLoader<PdfPageWithPath>;
|
|
66
|
+
byPage(): PdfFileLoader<LoaderResult<PdfPage>>;
|
|
67
|
+
ignoreErrors(): PdfFileLoader<UnwrapLoaderResult<T>>;
|
|
68
|
+
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
69
|
+
}
|
|
70
|
+
declare function fileToDocument(file: FileReadWithPath): Document;
|
|
71
|
+
declare function fileLoaderToDocuments(loader: AsyncIterable<FileReadWithPath>): Promise<Document[]>;
|
|
72
|
+
declare function pdfToDocument(pdf: PdfReadWithPath): Document;
|
|
73
|
+
declare function pdfLoaderToDocuments(loader: AsyncIterable<PdfReadWithPath>): Promise<Document[]>;
|
|
74
|
+
declare function pdfPageToDocument(page: PdfPageWithPath): Document;
|
|
75
|
+
declare function pdfPageLoaderToDocuments(loader: AsyncIterable<PdfPageWithPath>): Promise<Document[]>;
|
|
76
|
+
type LoaderValue<T> = T extends {
|
|
77
|
+
ok: true;
|
|
78
|
+
value: infer Value;
|
|
79
|
+
} ? Value : never;
|
|
80
|
+
type UnwrapLoaderResult<T> = [LoaderValue<T>] extends [never] ? T : LoaderValue<T>;
|
|
81
|
+
|
|
82
|
+
export { FileLoader, type FileReadWithPath, type FileSource, type LoaderResult, PdfFileLoader, type PdfPage, type PdfPageWithPath, type PdfReadWithPath, type PdfSource, fileLoaderToDocuments, fileToDocument, pdfLoaderToDocuments, pdfPageLoaderToDocuments, pdfPageToDocument, pdfToDocument };
|