@latchway/langchain 0.0.0-bootstrap.0 → 1.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/NOTICE +7 -0
- package/README.md +99 -3
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +143 -0
- package/dist/index.js.map +1 -0
- package/package.json +28 -6
package/NOTICE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Latchway JavaScript SDK
|
|
2
|
+
Copyright 2026 Latchway contributors
|
|
3
|
+
|
|
4
|
+
This product includes software developed by Latchway contributors.
|
|
5
|
+
|
|
6
|
+
The Code of Conduct is adapted from Contributor Covenant version 2.1,
|
|
7
|
+
licensed under the Creative Commons Attribution 4.0 International License.
|
package/README.md
CHANGED
|
@@ -1,5 +1,101 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@latchway/langchain`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The LangChain.js adapter configures `ChatOpenAI` and `OpenAIEmbeddings` through
|
|
4
|
+
their underlying OpenAI client options. It does not introduce chains, agents,
|
|
5
|
+
graphs, memory, retrieval, or tool execution.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
```ts
|
|
8
|
+
import { createLatchwayChatOpenAI } from "@latchway/langchain";
|
|
9
|
+
|
|
10
|
+
const model = createLatchwayChatOpenAI({
|
|
11
|
+
latchway,
|
|
12
|
+
feature: "habit-assistant",
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const message = await model.invoke("Summarize today");
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The generated OpenAI-compatible model value is `latchway`; it is not a
|
|
19
|
+
physical model selection. Streaming, batching, tools, structured output,
|
|
20
|
+
cancellation and callbacks remain LangChain behavior over the authenticated
|
|
21
|
+
transport. As of 1.1.0, chat and embeddings default to zero framework retries;
|
|
22
|
+
explicitly opt in with `maxRetries` only when your dispatch/billing policy permits.
|
|
23
|
+
Latchway correlation IDs are mirrored to the underlying OpenAI client's
|
|
24
|
+
conventional request-ID header without buffering the response.
|
|
25
|
+
|
|
26
|
+
## Stateless Responses (1.1.0)
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import {
|
|
30
|
+
createLatchwayResponsesModel, bindLatchwayTools, toLatchwayReplayMessage,
|
|
31
|
+
} from '@latchway/langchain';
|
|
32
|
+
|
|
33
|
+
const model = createLatchwayResponsesModel({
|
|
34
|
+
latchway,
|
|
35
|
+
feature: 'assistant', // gateway 1.0.2+, configured openai_responses feature
|
|
36
|
+
reasoning: {effort: 'none'}, // only if the server-selected model supports it
|
|
37
|
+
chatOptions: {maxTokens: 1024},
|
|
38
|
+
});
|
|
39
|
+
const modelWithTools = bindLatchwayTools(model, [weatherTool]);
|
|
40
|
+
const answer = await modelWithTools.invoke(messages, {signal});
|
|
41
|
+
messages.push(toLatchwayReplayMessage(answer));
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Omit `reasoning` for routes that do not accept it. The adapter cannot infer
|
|
45
|
+
capabilities from the server-owned model alias. This opt-in factory selects the
|
|
46
|
+
Responses API with `store:false` and local history, disables stored-response
|
|
47
|
+
reuse, and rejects `include`, `previous_response_id`, `conversation` and
|
|
48
|
+
conflicting storage/reasoning kwargs. It does not promise provider-wide zero
|
|
49
|
+
retention. Existing `createLatchwayChatOpenAI` still defaults to Chat Completions.
|
|
50
|
+
|
|
51
|
+
`bindLatchwayTools` wraps ordinary LangChain `bindTools` with `strict:true` and
|
|
52
|
+
`parallel_tool_calls:false`. These are overridable boolean defaults, not a tool
|
|
53
|
+
executor. Tools need strict-compatible schemas; callers own validation,
|
|
54
|
+
allowlists, timeouts, loop limits, cancellation and correlated ToolMessages.
|
|
55
|
+
|
|
56
|
+
`toLatchwayReplayMessage` accepts a completed AIMessage or fully aggregated
|
|
57
|
+
AIMessageChunk. It copies local text/function calls, preserves tool-call IDs,
|
|
58
|
+
and removes provider item IDs and observational metadata. Keep the original
|
|
59
|
+
for usage/callback information. Unsupported non-text/opaque reasoning/refusal,
|
|
60
|
+
invalid calls and duplicate/missing call IDs throw rather than silently losing
|
|
61
|
+
context. Partial/failed stream chunks must not enter conversation history.
|
|
62
|
+
|
|
63
|
+
Use ordinary `model.stream(messages, {signal})` and
|
|
64
|
+
`model.withStructuredOutput(schema, {method:'jsonSchema', strict:true})` when the
|
|
65
|
+
configured gateway route/model supports the schema. No chains, memory, tools,
|
|
66
|
+
agents or persistence are created by the adapter.
|
|
67
|
+
|
|
68
|
+
## React Native
|
|
69
|
+
|
|
70
|
+
Install npm packages, not repository links:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
npm install --save-exact @latchway/react-native@1.1.0 @latchway/langchain@1.1.0 \
|
|
74
|
+
@latchway/client@1.0.0 @langchain/core@1.2.9 @langchain/openai@1.5.10 openai@7.8.0
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
For React Native 0.82 / New Architecture, put this **first** in `index.js`:
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
import '@latchway/react-native/polyfills';
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
In `babel.config.js`:
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
const {withLatchwayBabel} = require('@latchway/react-native/babel');
|
|
87
|
+
module.exports = withLatchwayBabel({
|
|
88
|
+
presets: ['module:@react-native/babel-preset'],
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Use standard Metro and pass the React Native `LatchwayClient` directly as
|
|
93
|
+
`latchway`. Rebuild native hosts after installation. Authentication, signing,
|
|
94
|
+
attestation and credentials remain native; the adapter never accepts a provider
|
|
95
|
+
key. Native framework attribution remains `react-native-fetch`.
|
|
96
|
+
|
|
97
|
+
See the [complete React Native guide](https://github.com/Latchway/latchway-react-native-sdk/blob/main/docs/langchain.md)
|
|
98
|
+
and [npm-only LatchwayChat example](https://github.com/Latchway/latchway-react-native-sdk/tree/main/Examples/LatchwayChat)
|
|
99
|
+
for Firebase authentication, weather tools, streaming and device-evidence limits.
|
|
100
|
+
The supported dependency versions are intentionally exact; other versions are
|
|
101
|
+
not implied by these tests. [LangChain reference](https://docs.langchain.com/oss/javascript/integrations/chat/openai).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ChatOpenAI, type ChatOpenAIFields, OpenAIEmbeddings, type OpenAIEmbeddingsParams } from "@langchain/openai";
|
|
2
|
+
import { AIMessage, type AIMessageChunk } from "@langchain/core/messages";
|
|
3
|
+
export interface AuthenticatedTransport {
|
|
4
|
+
readonly gatewayURL: string;
|
|
5
|
+
fetchFor(feature: string, framework: Readonly<{
|
|
6
|
+
id: "langchain-js";
|
|
7
|
+
version: string;
|
|
8
|
+
}>): (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
9
|
+
}
|
|
10
|
+
export type LatchwayChatOpenAIOptions = Omit<ChatOpenAIFields, "apiKey" | "configuration" | "model" | "modelName" | "openAIApiKey">;
|
|
11
|
+
export interface CreateLatchwayChatOpenAIOptions {
|
|
12
|
+
latchway: AuthenticatedTransport;
|
|
13
|
+
feature: string;
|
|
14
|
+
chatOptions?: LatchwayChatOpenAIOptions;
|
|
15
|
+
}
|
|
16
|
+
export type LatchwayEmbeddingsOptions = Omit<Partial<OpenAIEmbeddingsParams>, "model" | "modelName">;
|
|
17
|
+
export interface CreateLatchwayEmbeddingsOptions {
|
|
18
|
+
latchway: AuthenticatedTransport;
|
|
19
|
+
feature: string;
|
|
20
|
+
embeddingsOptions?: LatchwayEmbeddingsOptions;
|
|
21
|
+
}
|
|
22
|
+
export declare function createLatchwayChatOpenAI(options: CreateLatchwayChatOpenAIOptions): ChatOpenAI;
|
|
23
|
+
export declare function createLatchwayEmbeddings(options: CreateLatchwayEmbeddingsOptions): OpenAIEmbeddings;
|
|
24
|
+
export declare const LANGCHAIN_OPENAI_VERSION: string;
|
|
25
|
+
export interface CreateLatchwayResponsesModelOptions extends Omit<CreateLatchwayChatOpenAIOptions, "chatOptions"> {
|
|
26
|
+
/** Explicit route/model capability: the non-authoritative model alias cannot infer it. */
|
|
27
|
+
reasoning?: ChatOpenAIFields["reasoning"];
|
|
28
|
+
chatOptions?: Omit<LatchwayChatOpenAIOptions, "useResponsesApi" | "zdrEnabled" | "reasoning" | "reasoningEffort">;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Opt-in stateless text/function-tool Responses profile (gateway 1.0.2+).
|
|
32
|
+
* Own history locally; provider storage/references and opaque reasoning are not
|
|
33
|
+
* enabled. No reasoning setting is guessed from the server-owned model alias.
|
|
34
|
+
*/
|
|
35
|
+
export declare function createLatchwayResponsesModel(options: CreateLatchwayResponsesModelOptions): ChatOpenAI;
|
|
36
|
+
/** Bind ordinary LangChain tools with explicit boolean strict and serial defaults. */
|
|
37
|
+
export declare function bindLatchwayTools(model: ChatOpenAI, tools: Parameters<ChatOpenAI["bindTools"]>[0], options?: NonNullable<Parameters<ChatOpenAI["bindTools"]>[1]>): ReturnType<ChatOpenAI["bindTools"]>;
|
|
38
|
+
/**
|
|
39
|
+
* Make an explicit text/function-call replay message after a complete response.
|
|
40
|
+
* Removes provider item IDs and observational metadata, preserves tool-call IDs,
|
|
41
|
+
* and refuses opaque/unsupported content instead of silently dropping it.
|
|
42
|
+
* Do not call on partial/failed streams; retain the original for usage metadata.
|
|
43
|
+
*/
|
|
44
|
+
export declare function toLatchwayReplayMessage(message: AIMessage | AIMessageChunk): AIMessage;
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,KAAK,sBAAsB,EAC5B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AA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AAG,WAAW,GAAG,iBAAiB,CAAC,CAAC;CACnH;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,mCAAmC,GAAG,UAAU,CAyBrG;AAED,sFAAsF;AACtF,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAC7C,OAAO,GAAE,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAM,GAChE,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAUrC;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,SAAS,GAAG,cAAc,GAAG,SAAS,CA2BtF"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { ChatOpenAI, OpenAIEmbeddings, } from "@langchain/openai";
|
|
2
|
+
import langchainOpenAIPackage from "@langchain/openai/package.json" with { type: "json" };
|
|
3
|
+
import { AIMessage } from "@langchain/core/messages";
|
|
4
|
+
const frameworkVersion = langchainOpenAIPackage.version;
|
|
5
|
+
const placeholder = "latchway-managed-not-a-provider-secret";
|
|
6
|
+
export function createLatchwayChatOpenAI(options) {
|
|
7
|
+
const authenticatedFetch = options.latchway.fetchFor(options.feature, {
|
|
8
|
+
id: "langchain-js",
|
|
9
|
+
version: frameworkVersion,
|
|
10
|
+
});
|
|
11
|
+
return new ChatOpenAI({
|
|
12
|
+
...options.chatOptions,
|
|
13
|
+
maxRetries: options.chatOptions?.maxRetries ?? 0,
|
|
14
|
+
apiKey: placeholder,
|
|
15
|
+
model: "latchway",
|
|
16
|
+
configuration: {
|
|
17
|
+
baseURL: `${options.latchway.gatewayURL}/v1`,
|
|
18
|
+
fetch: withProviderRequestID(authenticatedFetch),
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export function createLatchwayEmbeddings(options) {
|
|
23
|
+
const authenticatedFetch = options.latchway.fetchFor(options.feature, {
|
|
24
|
+
id: "langchain-js",
|
|
25
|
+
version: frameworkVersion,
|
|
26
|
+
});
|
|
27
|
+
return new OpenAIEmbeddings({
|
|
28
|
+
...options.embeddingsOptions,
|
|
29
|
+
maxRetries: options.embeddingsOptions?.maxRetries ?? 0,
|
|
30
|
+
apiKey: placeholder,
|
|
31
|
+
encodingFormat: "float",
|
|
32
|
+
model: "latchway",
|
|
33
|
+
configuration: {
|
|
34
|
+
baseURL: `${options.latchway.gatewayURL}/v1`,
|
|
35
|
+
fetch: withProviderRequestID(authenticatedFetch),
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export const LANGCHAIN_OPENAI_VERSION = frameworkVersion;
|
|
40
|
+
/**
|
|
41
|
+
* Opt-in stateless text/function-tool Responses profile (gateway 1.0.2+).
|
|
42
|
+
* Own history locally; provider storage/references and opaque reasoning are not
|
|
43
|
+
* enabled. No reasoning setting is guessed from the server-owned model alias.
|
|
44
|
+
*/
|
|
45
|
+
export function createLatchwayResponsesModel(options) {
|
|
46
|
+
const chatOptions = options.chatOptions ?? {};
|
|
47
|
+
const kwargs = chatOptions.modelKwargs ?? {};
|
|
48
|
+
for (const key of ["include", "previous_response_id", "conversation", "reasoning", "reasoning_effort"]) {
|
|
49
|
+
if (kwargs[key] !== undefined) {
|
|
50
|
+
throw new Error(`The stateless Latchway Responses profile does not accept modelKwargs.${key}. Use explicit reasoning options and local message history.`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (kwargs.store !== undefined && kwargs.store !== false) {
|
|
54
|
+
throw new Error("The stateless Latchway Responses profile requires store:false.");
|
|
55
|
+
}
|
|
56
|
+
return createLatchwayChatOpenAI({
|
|
57
|
+
latchway: options.latchway,
|
|
58
|
+
feature: options.feature,
|
|
59
|
+
chatOptions: {
|
|
60
|
+
...chatOptions,
|
|
61
|
+
useResponsesApi: true,
|
|
62
|
+
zdrEnabled: true,
|
|
63
|
+
modelKwargs: {
|
|
64
|
+
...kwargs,
|
|
65
|
+
store: false,
|
|
66
|
+
...(options.reasoning === undefined ? {} : { reasoning: options.reasoning }),
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/** Bind ordinary LangChain tools with explicit boolean strict and serial defaults. */
|
|
72
|
+
export function bindLatchwayTools(model, tools, options = {}) {
|
|
73
|
+
if (options.strict !== undefined && typeof options.strict !== "boolean") {
|
|
74
|
+
throw new Error("Latchway tool strict must be a boolean.");
|
|
75
|
+
}
|
|
76
|
+
if (options.parallel_tool_calls !== undefined && typeof options.parallel_tool_calls !== "boolean") {
|
|
77
|
+
throw new Error("Latchway parallel_tool_calls must be a boolean.");
|
|
78
|
+
}
|
|
79
|
+
return model.bindTools(tools, { ...options,
|
|
80
|
+
parallel_tool_calls: options.parallel_tool_calls ?? false, strict: options.strict ?? true,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Make an explicit text/function-call replay message after a complete response.
|
|
85
|
+
* Removes provider item IDs and observational metadata, preserves tool-call IDs,
|
|
86
|
+
* and refuses opaque/unsupported content instead of silently dropping it.
|
|
87
|
+
* Do not call on partial/failed streams; retain the original for usage metadata.
|
|
88
|
+
*/
|
|
89
|
+
export function toLatchwayReplayMessage(message) {
|
|
90
|
+
if (message.invalid_tool_calls?.length)
|
|
91
|
+
throw new Error("Cannot replay invalid tool calls.");
|
|
92
|
+
for (const key of ["reasoning", "refusal", "audio", "function_call"]) {
|
|
93
|
+
if (message.additional_kwargs[key] != null) {
|
|
94
|
+
throw new Error(`Cannot replay unsupported ${key} content on the stateless text/tool profile.`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
let content;
|
|
98
|
+
if (typeof message.content === "string") {
|
|
99
|
+
content = message.content;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
content = message.content.map((part) => {
|
|
103
|
+
if (part.type !== "text" || typeof part.text !== "string") {
|
|
104
|
+
throw new Error("Only text and function-tool calls can be replayed on this profile.");
|
|
105
|
+
}
|
|
106
|
+
return part.text;
|
|
107
|
+
}).join("");
|
|
108
|
+
}
|
|
109
|
+
const ids = new Set();
|
|
110
|
+
const toolCalls = (message.tool_calls ?? []).map((call) => {
|
|
111
|
+
if (!call.id || !call.name || ids.has(call.id)) {
|
|
112
|
+
throw new Error("Replay requires unique, non-empty tool-call IDs and names.");
|
|
113
|
+
}
|
|
114
|
+
ids.add(call.id);
|
|
115
|
+
return { ...call, args: { ...call.args } };
|
|
116
|
+
});
|
|
117
|
+
return new AIMessage({ content, tool_calls: toolCalls });
|
|
118
|
+
}
|
|
119
|
+
function withProviderRequestID(fetch) {
|
|
120
|
+
return async (input, init) => aliasRequestID(await fetch(input, init));
|
|
121
|
+
}
|
|
122
|
+
function aliasRequestID(response) {
|
|
123
|
+
const requestID = response.headers.get("X-Latchway-Request-ID");
|
|
124
|
+
if (requestID === null || response.headers.has("X-Request-ID"))
|
|
125
|
+
return response;
|
|
126
|
+
const headers = new Headers(response.headers);
|
|
127
|
+
headers.set("X-Request-ID", requestID);
|
|
128
|
+
const aliased = new Response(response.body, {
|
|
129
|
+
status: response.status,
|
|
130
|
+
statusText: response.statusText,
|
|
131
|
+
headers,
|
|
132
|
+
});
|
|
133
|
+
preserveResponseLocation(aliased, response);
|
|
134
|
+
return aliased;
|
|
135
|
+
}
|
|
136
|
+
function preserveResponseLocation(target, source) {
|
|
137
|
+
Object.defineProperties(target, {
|
|
138
|
+
redirected: { value: source.redirected },
|
|
139
|
+
type: { value: source.type },
|
|
140
|
+
url: { value: source.url },
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,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AE,OAAO,QAAQ,CAAC;IAChF,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE;QAC1C,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,OAAO;KACR,CAAC,CAAC;IACH,wBAAwB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC5C,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,wBAAwB,CAAC,MAAgB,EAAE,MAAgB;IAClE,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE;QAC9B,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,UAAU,EAAE;QACxC,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE;QAC5B,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,EAAE;KAC3B,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@latchway/langchain",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Feature-bound Latchway transport adapter for LangChain.js OpenAI integrations",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=24.19.0"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
6
13
|
"files": [
|
|
14
|
+
"dist",
|
|
7
15
|
"LICENSE",
|
|
16
|
+
"NOTICE",
|
|
8
17
|
"README.md"
|
|
9
18
|
],
|
|
10
19
|
"repository": {
|
|
@@ -13,8 +22,21 @@
|
|
|
13
22
|
"directory": "packages/langchain"
|
|
14
23
|
},
|
|
15
24
|
"publishConfig": {
|
|
16
|
-
"access": "public"
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@langchain/core": "1.2.9",
|
|
35
|
+
"@langchain/openai": "1.5.10",
|
|
36
|
+
"@latchway/client": "^1.0.0"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsc -p tsconfig.build.json",
|
|
40
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
19
41
|
}
|
|
20
|
-
}
|
|
42
|
+
}
|