@struct-ai/sdk 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/LICENSE +201 -0
- package/README.md +168 -0
- package/dist/commonjs/content-capture.d.ts +10 -0
- package/dist/commonjs/content-capture.js +23 -0
- package/dist/commonjs/context.d.ts +30 -0
- package/dist/commonjs/context.js +94 -0
- package/dist/commonjs/core.d.ts +120 -0
- package/dist/commonjs/core.js +408 -0
- package/dist/commonjs/events.d.ts +12 -0
- package/dist/commonjs/events.js +103 -0
- package/dist/commonjs/index.d.ts +6 -0
- package/dist/commonjs/index.js +10 -0
- package/dist/commonjs/integrations/anthropic-content.d.ts +24 -0
- package/dist/commonjs/integrations/anthropic-content.js +178 -0
- package/dist/commonjs/integrations/anthropic.d.ts +34 -0
- package/dist/commonjs/integrations/anthropic.js +377 -0
- package/dist/commonjs/integrations/index.d.ts +5 -0
- package/dist/commonjs/integrations/index.js +47 -0
- package/dist/commonjs/integrations/langchain-callback.d.ts +134 -0
- package/dist/commonjs/integrations/langchain-callback.js +723 -0
- package/dist/commonjs/integrations/langchain-content.d.ts +35 -0
- package/dist/commonjs/integrations/langchain-content.js +307 -0
- package/dist/commonjs/integrations/langchain.d.ts +11 -0
- package/dist/commonjs/integrations/langchain.js +100 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/semconv.d.ts +54 -0
- package/dist/commonjs/semconv.js +74 -0
- package/dist/commonjs/truncation.d.ts +10 -0
- package/dist/commonjs/truncation.js +103 -0
- package/dist/esm/content-capture.d.ts +10 -0
- package/dist/esm/content-capture.js +17 -0
- package/dist/esm/context.d.ts +30 -0
- package/dist/esm/context.js +80 -0
- package/dist/esm/core.d.ts +120 -0
- package/dist/esm/core.js +403 -0
- package/dist/esm/events.d.ts +12 -0
- package/dist/esm/events.js +99 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/integrations/anthropic-content.d.ts +24 -0
- package/dist/esm/integrations/anthropic-content.js +168 -0
- package/dist/esm/integrations/anthropic.d.ts +34 -0
- package/dist/esm/integrations/anthropic.js +370 -0
- package/dist/esm/integrations/index.d.ts +5 -0
- package/dist/esm/integrations/index.js +42 -0
- package/dist/esm/integrations/langchain-callback.d.ts +134 -0
- package/dist/esm/integrations/langchain-callback.js +719 -0
- package/dist/esm/integrations/langchain-content.d.ts +35 -0
- package/dist/esm/integrations/langchain-content.js +294 -0
- package/dist/esm/integrations/langchain.d.ts +11 -0
- package/dist/esm/integrations/langchain.js +95 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/semconv.d.ts +54 -0
- package/dist/esm/semconv.js +71 -0
- package/dist/esm/truncation.d.ts +10 -0
- package/dist/esm/truncation.js +96 -0
- package/dist/node_modules/@struct-ai/sdk/dist/commonjs/content-capture.d.ts +10 -0
- package/dist/node_modules/@struct-ai/sdk/dist/commonjs/context.d.ts +30 -0
- package/dist/node_modules/@struct-ai/sdk/dist/commonjs/core.d.ts +120 -0
- package/dist/node_modules/@struct-ai/sdk/dist/commonjs/events.d.ts +12 -0
- package/dist/node_modules/@struct-ai/sdk/dist/commonjs/index.d.ts +6 -0
- package/dist/node_modules/@struct-ai/sdk/dist/commonjs/integrations/anthropic-content.d.ts +24 -0
- package/dist/node_modules/@struct-ai/sdk/dist/commonjs/integrations/anthropic.d.ts +34 -0
- package/dist/node_modules/@struct-ai/sdk/dist/commonjs/integrations/index.d.ts +5 -0
- package/dist/node_modules/@struct-ai/sdk/dist/commonjs/integrations/langchain-callback.d.ts +134 -0
- package/dist/node_modules/@struct-ai/sdk/dist/commonjs/integrations/langchain-content.d.ts +35 -0
- package/dist/node_modules/@struct-ai/sdk/dist/commonjs/integrations/langchain.d.ts +11 -0
- package/dist/node_modules/@struct-ai/sdk/dist/commonjs/package.json +3 -0
- package/dist/node_modules/@struct-ai/sdk/dist/commonjs/semconv.d.ts +54 -0
- package/dist/node_modules/@struct-ai/sdk/dist/commonjs/truncation.d.ts +10 -0
- package/dist/node_modules/@struct-ai/sdk/dist/esm/content-capture.d.ts +10 -0
- package/dist/node_modules/@struct-ai/sdk/dist/esm/context.d.ts +30 -0
- package/dist/node_modules/@struct-ai/sdk/dist/esm/core.d.ts +120 -0
- package/dist/node_modules/@struct-ai/sdk/dist/esm/events.d.ts +12 -0
- package/dist/node_modules/@struct-ai/sdk/dist/esm/index.d.ts +6 -0
- package/dist/node_modules/@struct-ai/sdk/dist/esm/integrations/anthropic-content.d.ts +24 -0
- package/dist/node_modules/@struct-ai/sdk/dist/esm/integrations/anthropic.d.ts +34 -0
- package/dist/node_modules/@struct-ai/sdk/dist/esm/integrations/index.d.ts +5 -0
- package/dist/node_modules/@struct-ai/sdk/dist/esm/integrations/langchain-callback.d.ts +134 -0
- package/dist/node_modules/@struct-ai/sdk/dist/esm/integrations/langchain-content.d.ts +35 -0
- package/dist/node_modules/@struct-ai/sdk/dist/esm/integrations/langchain.d.ts +11 -0
- package/dist/node_modules/@struct-ai/sdk/dist/esm/package.json +3 -0
- package/dist/node_modules/@struct-ai/sdk/dist/esm/semconv.d.ts +54 -0
- package/dist/node_modules/@struct-ai/sdk/dist/esm/truncation.d.ts +10 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/dist/commonjs/package.json +3 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/dist/esm/package.json +3 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/package.json +100 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/@anthropic-ai/sdk/package.json +103 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/anthropic/package.json +118 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/package.json +916 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/langgraph/package.json +188 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/api/package.json +96 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/api-logs/package.json +91 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/core/package.json +96 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/exporter-logs-otlp-proto/package.json +108 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/exporter-trace-otlp-proto/package.json +105 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/resources/package.json +100 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/sdk-logs/package.json +109 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/sdk-trace-base/package.json +100 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/sdk-trace-node/package.json +76 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/package.json +140 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/nock/package.json +89 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/tshy/package.json +81 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/typescript/package.json +120 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/node_modules/vitest/package.json +239 -0
- package/dist/node_modules/@struct-ai/sdk/dist/node_modules/@struct-ai/sdk/package.json +100 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@anthropic-ai/sdk/core.d.ts +244 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@anthropic-ai/sdk/error.d.ts +54 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@anthropic-ai/sdk/index.d.ts +188 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@anthropic-ai/sdk/package.json +103 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@anthropic-ai/sdk/pagination.d.ts +26 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@anthropic-ai/sdk/resource.d.ts +6 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@anthropic-ai/sdk/streaming.d.ts +41 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@anthropic-ai/sdk/uploads.d.ts +75 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@anthropic-ai/sdk/version.d.ts +2 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/anthropic/experimental.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/anthropic/index.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/anthropic/package.json +118 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/agents.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/caches.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/chat_history.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/context.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/documents.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/embeddings.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/example_selectors.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/index.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/indexing.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/load.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/memory.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/messages.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/output_parsers.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/outputs.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/package.json +916 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/prompt_values.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/prompts.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/retrievers.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/runnables.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/singletons.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/stores.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/structured_query.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/tools.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/core/vectorstores.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/langgraph/index.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/langgraph/package.json +188 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/langgraph/prebuilt.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/langgraph/pregel.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/langgraph/remote.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/langgraph/web.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@langchain/langgraph/zod.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/api/package.json +96 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/api-logs/package.json +91 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/core/package.json +96 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/exporter-logs-otlp-proto/package.json +108 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/exporter-trace-otlp-proto/package.json +105 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/resources/package.json +100 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/sdk-logs/package.json +109 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/sdk-trace-base/package.json +100 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@opentelemetry/sdk-trace-node/package.json +76 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/assert.d.ts +1062 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/async_hooks.d.ts +605 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/buffer.buffer.d.ts +471 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/buffer.d.ts +1936 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/child_process.d.ts +1475 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/cluster.d.ts +577 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/console.d.ts +452 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/constants.d.ts +21 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/crypto.d.ts +4590 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/dgram.d.ts +597 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/dns.d.ts +871 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/domain.d.ts +170 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/events.d.ts +977 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/fs.d.ts +4375 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/globals.d.ts +172 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/globals.typedarray.d.ts +38 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/http.d.ts +2049 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/http2.d.ts +2631 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/https.d.ts +578 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/index.d.ts +93 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/inspector.generated.d.ts +3966 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/module.d.ts +539 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/net.d.ts +1031 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/os.d.ts +506 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/package.json +140 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/path.d.ts +200 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/perf_hooks.d.ts +961 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/process.d.ts +1961 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/punycode.d.ts +117 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/querystring.d.ts +152 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/readline.d.ts +589 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/repl.d.ts +430 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/sea.d.ts +153 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/stream.d.ts +1698 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/test.d.ts +1787 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/timers.d.ts +286 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/tls.d.ts +1259 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/trace_events.d.ts +197 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/tty.d.ts +208 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/url.d.ts +964 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/util.d.ts +2331 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/v8.d.ts +809 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/vm.d.ts +1001 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/wasi.d.ts +181 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/worker_threads.d.ts +715 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/@types/node/zlib.d.ts +598 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/nock/package.json +89 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/tshy/package.json +81 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/typescript/package.json +120 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/config.d.ts +3 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/coverage.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/environments.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/globals.d.ts +22 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/import-meta.d.ts +5 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/importMeta.d.ts +4 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/jsdom.d.ts +6 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/mocker.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/node.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/optional-runtime-types.d.ts +6 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/optional-types.d.ts +7 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/package.json +239 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/reporters.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/runners.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/snapshot.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/suite.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/node_modules/vitest/worker.d.ts +1 -0
- package/dist/node_modules/@struct-ai/sdk/package.json +100 -0
- package/package.json +100 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type RequestOptions } from "./core.js";
|
|
2
|
+
import { FormData, type Blob, type FilePropertyBag, type FsReadStream } from "./_shims/index.js";
|
|
3
|
+
import { MultipartBody } from "./_shims/MultipartBody.js";
|
|
4
|
+
export { fileFromPath } from "./_shims/index.js";
|
|
5
|
+
type BlobLikePart = string | ArrayBuffer | ArrayBufferView | BlobLike | Uint8Array | DataView;
|
|
6
|
+
export type BlobPart = string | ArrayBuffer | ArrayBufferView | Blob | Uint8Array | DataView;
|
|
7
|
+
/**
|
|
8
|
+
* Typically, this is a native "File" class.
|
|
9
|
+
*
|
|
10
|
+
* We provide the {@link toFile} utility to convert a variety of objects
|
|
11
|
+
* into the File class.
|
|
12
|
+
*
|
|
13
|
+
* For convenience, you can also pass a fetch Response, or in Node,
|
|
14
|
+
* the result of fs.createReadStream().
|
|
15
|
+
*/
|
|
16
|
+
export type Uploadable = FileLike | ResponseLike | FsReadStream;
|
|
17
|
+
/**
|
|
18
|
+
* Intended to match web.Blob, node.Blob, node-fetch.Blob, etc.
|
|
19
|
+
*/
|
|
20
|
+
export interface BlobLike {
|
|
21
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
22
|
+
readonly size: number;
|
|
23
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
24
|
+
readonly type: string;
|
|
25
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
26
|
+
text(): Promise<string>;
|
|
27
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
28
|
+
slice(start?: number, end?: number): BlobLike;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Intended to match web.File, node.File, node-fetch.File, etc.
|
|
32
|
+
*/
|
|
33
|
+
export interface FileLike extends BlobLike {
|
|
34
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
35
|
+
readonly lastModified: number;
|
|
36
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
37
|
+
readonly name: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Intended to match web.Response, node.Response, node-fetch.Response, etc.
|
|
41
|
+
*/
|
|
42
|
+
export interface ResponseLike {
|
|
43
|
+
url: string;
|
|
44
|
+
blob(): Promise<BlobLike>;
|
|
45
|
+
}
|
|
46
|
+
export declare const isResponseLike: (value: any) => value is ResponseLike;
|
|
47
|
+
export declare const isFileLike: (value: any) => value is FileLike;
|
|
48
|
+
/**
|
|
49
|
+
* The BlobLike type omits arrayBuffer() because @types/node-fetch@^2.6.4 lacks it; but this check
|
|
50
|
+
* adds the arrayBuffer() method type because it is available and used at runtime
|
|
51
|
+
*/
|
|
52
|
+
export declare const isBlobLike: (value: any) => value is BlobLike & {
|
|
53
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
54
|
+
};
|
|
55
|
+
export declare const isUploadable: (value: any) => value is Uploadable;
|
|
56
|
+
export type ToFileInput = Uploadable | Exclude<BlobLikePart, string> | AsyncIterable<BlobLikePart>;
|
|
57
|
+
/**
|
|
58
|
+
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
59
|
+
* @param value the raw content of the file. Can be an {@link Uploadable}, {@link BlobLikePart}, or {@link AsyncIterable} of {@link BlobLikePart}s
|
|
60
|
+
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
61
|
+
* @param {Object=} options additional properties
|
|
62
|
+
* @param {string=} options.type the MIME type of the content
|
|
63
|
+
* @param {number=} options.lastModified the last modified timestamp
|
|
64
|
+
* @returns a {@link File} with the given properties
|
|
65
|
+
*/
|
|
66
|
+
export declare function toFile(value: ToFileInput | PromiseLike<ToFileInput>, name?: string | null | undefined, options?: FilePropertyBag | undefined): Promise<FileLike>;
|
|
67
|
+
export declare const isMultipartBody: (body: any) => body is MultipartBody;
|
|
68
|
+
/**
|
|
69
|
+
* Returns a multipart/form-data request if any part of the given request body contains a File / Blob value.
|
|
70
|
+
* Otherwise returns the request as is.
|
|
71
|
+
*/
|
|
72
|
+
export declare const maybeMultipartFormRequestOptions: <T = Record<string, unknown>>(opts: RequestOptions<T>) => Promise<RequestOptions<MultipartBody | T>>;
|
|
73
|
+
export declare const multipartFormRequestOptions: <T = Record<string, unknown>>(opts: RequestOptions<T>) => Promise<RequestOptions<MultipartBody | T>>;
|
|
74
|
+
export declare const createForm: <T = Record<string, unknown>>(body: T | undefined) => Promise<FormData>;
|
|
75
|
+
//# sourceMappingURL=uploads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/experimental/index.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/index.js'
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@langchain/anthropic",
|
|
3
|
+
"version": "0.3.34",
|
|
4
|
+
"description": "Anthropic integrations for LangChain.js",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=18"
|
|
8
|
+
},
|
|
9
|
+
"main": "./index.js",
|
|
10
|
+
"types": "./index.d.ts",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git@github.com:langchain-ai/langchainjs.git"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-anthropic/",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "yarn turbo:command build:internal --filter=@langchain/anthropic",
|
|
18
|
+
"build:internal": "yarn lc_build --create-entrypoints --pre --tree-shaking --gen-maps",
|
|
19
|
+
"lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/",
|
|
20
|
+
"lint:dpdm": "dpdm --skip-dynamic-imports circular --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts",
|
|
21
|
+
"lint": "yarn lint:eslint && yarn lint:dpdm",
|
|
22
|
+
"lint:fix": "yarn lint:eslint --fix && yarn lint:dpdm",
|
|
23
|
+
"clean": "rm -rf .turbo dist/",
|
|
24
|
+
"prepack": "yarn build",
|
|
25
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
|
|
26
|
+
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
|
|
27
|
+
"test:single": "NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000",
|
|
28
|
+
"test:int": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%",
|
|
29
|
+
"test:standard:unit": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.standard\\.test.ts --testTimeout 100000 --maxWorkers=50%",
|
|
30
|
+
"test:standard:int": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.standard\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%",
|
|
31
|
+
"test:standard": "yarn test:standard:unit && yarn test:standard:int",
|
|
32
|
+
"format": "prettier --config .prettierrc --write \"src\"",
|
|
33
|
+
"format:check": "prettier --config .prettierrc --check \"src\""
|
|
34
|
+
},
|
|
35
|
+
"author": "LangChain",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@anthropic-ai/sdk": "^0.65.0",
|
|
39
|
+
"fast-xml-parser": "^4.4.1"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@langchain/core": ">=0.3.58 <0.4.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@anthropic-ai/vertex-sdk": "^0.11.5",
|
|
46
|
+
"@jest/globals": "^29.5.0",
|
|
47
|
+
"@langchain/core": "workspace:*",
|
|
48
|
+
"@langchain/scripts": ">=0.1.0 <0.2.0",
|
|
49
|
+
"@langchain/standard-tests": "0.0.0",
|
|
50
|
+
"@swc/core": "^1.3.90",
|
|
51
|
+
"@swc/jest": "^0.2.29",
|
|
52
|
+
"dpdm": "^3.14.0",
|
|
53
|
+
"eslint": "^8.33.0",
|
|
54
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
55
|
+
"eslint-config-prettier": "^8.6.0",
|
|
56
|
+
"eslint-plugin-import": "^2.27.5",
|
|
57
|
+
"eslint-plugin-jest": "^27.6.0",
|
|
58
|
+
"eslint-plugin-no-instanceof": "^1.0.1",
|
|
59
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
60
|
+
"jest": "^29.5.0",
|
|
61
|
+
"jest-environment-node": "^29.6.4",
|
|
62
|
+
"prettier": "^2.8.3",
|
|
63
|
+
"release-it": "^18.1.2",
|
|
64
|
+
"rimraf": "^5.0.1",
|
|
65
|
+
"ts-jest": "^29.1.0",
|
|
66
|
+
"typescript": "~5.8.3",
|
|
67
|
+
"zod": "^3.25.32"
|
|
68
|
+
},
|
|
69
|
+
"publishConfig": {
|
|
70
|
+
"access": "public"
|
|
71
|
+
},
|
|
72
|
+
"keywords": [
|
|
73
|
+
"llm",
|
|
74
|
+
"ai",
|
|
75
|
+
"gpt3",
|
|
76
|
+
"chain",
|
|
77
|
+
"prompt",
|
|
78
|
+
"prompt engineering",
|
|
79
|
+
"chatgpt",
|
|
80
|
+
"machine learning",
|
|
81
|
+
"ml",
|
|
82
|
+
"anthropic",
|
|
83
|
+
"embeddings",
|
|
84
|
+
"vectorstores"
|
|
85
|
+
],
|
|
86
|
+
"exports": {
|
|
87
|
+
".": {
|
|
88
|
+
"types": {
|
|
89
|
+
"import": "./index.d.ts",
|
|
90
|
+
"require": "./index.d.cts",
|
|
91
|
+
"default": "./index.d.ts"
|
|
92
|
+
},
|
|
93
|
+
"import": "./index.js",
|
|
94
|
+
"require": "./index.cjs"
|
|
95
|
+
},
|
|
96
|
+
"./experimental": {
|
|
97
|
+
"types": {
|
|
98
|
+
"import": "./experimental.d.ts",
|
|
99
|
+
"require": "./experimental.d.cts",
|
|
100
|
+
"default": "./experimental.d.ts"
|
|
101
|
+
},
|
|
102
|
+
"import": "./experimental.js",
|
|
103
|
+
"require": "./experimental.cjs"
|
|
104
|
+
},
|
|
105
|
+
"./package.json": "./package.json"
|
|
106
|
+
},
|
|
107
|
+
"files": [
|
|
108
|
+
"dist/",
|
|
109
|
+
"index.cjs",
|
|
110
|
+
"index.js",
|
|
111
|
+
"index.d.ts",
|
|
112
|
+
"index.d.cts",
|
|
113
|
+
"experimental.cjs",
|
|
114
|
+
"experimental.js",
|
|
115
|
+
"experimental.d.ts",
|
|
116
|
+
"experimental.d.cts"
|
|
117
|
+
]
|
|
118
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/agents.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/caches/base.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/chat_history.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/context.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/documents/index.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/embeddings.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/example_selectors/index.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/index.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/indexing/index.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/load/index.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/memory.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/messages/index.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/output_parsers/index.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/outputs.js'
|