@reminix/langchain 0.0.6 → 0.0.8
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 +10 -24
- package/dist/{adapter.d.ts → agent-adapter.d.ts} +16 -31
- package/dist/agent-adapter.d.ts.map +1 -0
- package/dist/{adapter.js → agent-adapter.js} +27 -84
- package/dist/agent-adapter.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/adapter.d.ts.map +0 -1
- package/dist/adapter.js.map +0 -1
package/README.md
CHANGED
|
@@ -35,8 +35,7 @@ serve({ agents: [agent], port: 8080 });
|
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
Your agent is now available at:
|
|
38
|
-
- `POST /agents/my-chatbot/
|
|
39
|
-
- `POST /agents/my-chatbot/chat` - Conversational chat
|
|
38
|
+
- `POST /agents/my-chatbot/execute` - Execute the agent
|
|
40
39
|
|
|
41
40
|
## API Reference
|
|
42
41
|
|
|
@@ -60,7 +59,7 @@ Wrap a LangChain runnable for use with Reminix Runtime. Use this with `serve` fr
|
|
|
60
59
|
| `runnable` | `Runnable` | required | Any LangChain runnable (LLM, chain, agent, etc.) |
|
|
61
60
|
| `name` | `string` | `"langchain-agent"` | Name for the agent (used in URL path) |
|
|
62
61
|
|
|
63
|
-
**Returns:** `
|
|
62
|
+
**Returns:** `LangChainAgentAdapter` - A Reminix adapter instance
|
|
64
63
|
|
|
65
64
|
### Example with a Chain
|
|
66
65
|
|
|
@@ -85,16 +84,14 @@ serve({ agents: [agent], port: 8080 });
|
|
|
85
84
|
|
|
86
85
|
## Endpoint Input/Output Formats
|
|
87
86
|
|
|
88
|
-
### POST /agents/{name}/
|
|
87
|
+
### POST /agents/{name}/execute
|
|
89
88
|
|
|
90
|
-
|
|
89
|
+
Execute the agent. Input keys are passed directly to the LangChain runnable.
|
|
91
90
|
|
|
92
91
|
**Request:**
|
|
93
92
|
```json
|
|
94
93
|
{
|
|
95
|
-
"input":
|
|
96
|
-
"input": "Hello, how are you?"
|
|
97
|
-
}
|
|
94
|
+
"input": "Hello, how are you?"
|
|
98
95
|
}
|
|
99
96
|
```
|
|
100
97
|
|
|
@@ -105,29 +102,18 @@ Stateless invocation. Input is passed directly to the LangChain runnable.
|
|
|
105
102
|
}
|
|
106
103
|
```
|
|
107
104
|
|
|
108
|
-
###
|
|
105
|
+
### Streaming
|
|
109
106
|
|
|
110
|
-
|
|
107
|
+
For streaming responses, set `stream: true` in the request:
|
|
111
108
|
|
|
112
|
-
**Request:**
|
|
113
109
|
```json
|
|
114
110
|
{
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
]
|
|
111
|
+
"input": "Tell me a story",
|
|
112
|
+
"stream": true
|
|
118
113
|
}
|
|
119
114
|
```
|
|
120
115
|
|
|
121
|
-
|
|
122
|
-
```json
|
|
123
|
-
{
|
|
124
|
-
"output": "The capital of France is Paris.",
|
|
125
|
-
"messages": [
|
|
126
|
-
{"role": "user", "content": "What is the capital of France?"},
|
|
127
|
-
{"role": "assistant", "content": "The capital of France is Paris."}
|
|
128
|
-
]
|
|
129
|
-
}
|
|
130
|
-
```
|
|
116
|
+
The response will be sent as Server-Sent Events (SSE).
|
|
131
117
|
|
|
132
118
|
## Runtime Documentation
|
|
133
119
|
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* LangChain adapter for Reminix Runtime.
|
|
3
3
|
*/
|
|
4
4
|
import type { Runnable } from '@langchain/core/runnables';
|
|
5
|
-
import {
|
|
5
|
+
import { AgentAdapter, type ServeOptions, type ExecuteRequest, type ExecuteResponse } from '@reminix/runtime';
|
|
6
6
|
/**
|
|
7
7
|
* Adapter for LangChain agents and runnables.
|
|
8
8
|
*/
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class LangChainAgentAdapter extends AgentAdapter {
|
|
10
10
|
static adapterName: string;
|
|
11
11
|
private agent;
|
|
12
12
|
private _name;
|
|
@@ -23,48 +23,33 @@ export declare class LangChainAdapter extends AdapterBase {
|
|
|
23
23
|
*/
|
|
24
24
|
private toLangChainMessage;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Build LangChain input from execute request.
|
|
27
27
|
*/
|
|
28
|
-
private
|
|
28
|
+
private buildLangChainInput;
|
|
29
29
|
/**
|
|
30
|
-
* Handle an
|
|
30
|
+
* Handle an execute request.
|
|
31
31
|
*
|
|
32
|
-
* For task-oriented operations.
|
|
32
|
+
* For both task-oriented and chat-style operations. Expects input with 'messages' key
|
|
33
|
+
* or a 'prompt' key for simple text generation.
|
|
33
34
|
*
|
|
34
|
-
* @param request - The
|
|
35
|
-
* @returns The
|
|
35
|
+
* @param request - The execute request with input data.
|
|
36
|
+
* @returns The execute response with the output.
|
|
36
37
|
*/
|
|
37
|
-
|
|
38
|
+
execute(request: ExecuteRequest): Promise<ExecuteResponse>;
|
|
38
39
|
/**
|
|
39
|
-
* Handle a
|
|
40
|
+
* Handle a streaming execute request.
|
|
40
41
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* @param request - The chat request with messages.
|
|
44
|
-
* @returns The chat response with output and messages.
|
|
45
|
-
*/
|
|
46
|
-
chat(request: ChatRequest): Promise<ChatResponse>;
|
|
47
|
-
/**
|
|
48
|
-
* Handle a streaming invoke request.
|
|
49
|
-
*
|
|
50
|
-
* @param request - The invoke request with input data.
|
|
51
|
-
* @yields JSON-encoded chunks from the stream.
|
|
52
|
-
*/
|
|
53
|
-
invokeStream(request: InvokeRequest): AsyncGenerator<string, void, unknown>;
|
|
54
|
-
/**
|
|
55
|
-
* Handle a streaming chat request.
|
|
56
|
-
*
|
|
57
|
-
* @param request - The chat request with messages.
|
|
42
|
+
* @param request - The execute request with input data.
|
|
58
43
|
* @yields JSON-encoded chunks from the stream.
|
|
59
44
|
*/
|
|
60
|
-
|
|
45
|
+
executeStream(request: ExecuteRequest): AsyncGenerator<string, void, unknown>;
|
|
61
46
|
}
|
|
62
47
|
/**
|
|
63
48
|
* Wrap a LangChain agent for use with Reminix Runtime.
|
|
64
49
|
*
|
|
65
50
|
* @param agent - A LangChain runnable (e.g., ChatModel, chain, agent).
|
|
66
51
|
* @param name - Name for the agent.
|
|
67
|
-
* @returns A
|
|
52
|
+
* @returns A LangChainAgentAdapter instance.
|
|
68
53
|
*
|
|
69
54
|
* @example
|
|
70
55
|
* ```typescript
|
|
@@ -77,7 +62,7 @@ export declare class LangChainAdapter extends AdapterBase {
|
|
|
77
62
|
* serve({ agents: [agent], port: 8080 });
|
|
78
63
|
* ```
|
|
79
64
|
*/
|
|
80
|
-
export declare function wrapAgent(agent: Runnable, name?: string):
|
|
65
|
+
export declare function wrapAgent(agent: Runnable, name?: string): LangChainAgentAdapter;
|
|
81
66
|
/**
|
|
82
67
|
* Options for wrapping and serving a LangChain runnable.
|
|
83
68
|
*/
|
|
@@ -102,4 +87,4 @@ export interface WrapAndServeOptions extends ServeOptions {
|
|
|
102
87
|
* ```
|
|
103
88
|
*/
|
|
104
89
|
export declare function serveAgent(agent: Runnable, options?: WrapAndServeOptions): void;
|
|
105
|
-
//# sourceMappingURL=adapter.d.ts.map
|
|
90
|
+
//# sourceMappingURL=agent-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-adapter.d.ts","sourceRoot":"","sources":["../src/agent-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EACL,YAAY,EAEZ,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,eAAe,EAErB,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,YAAY;IACrD,MAAM,CAAC,WAAW,SAAe;IAEjC,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,KAAK,CAAS;IAEtB;;;;;OAKG;gBACS,KAAK,EAAE,QAAQ,EAAE,IAAI,GAAE,MAA0B;IAM7D,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAqB1B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAa3B;;;;;;;;OAQG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IAkBhE;;;;;OAKG;IACI,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC;CAgBrF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,QAAQ,EACf,IAAI,GAAE,MAA0B,GAC/B,qBAAqB,CAEvB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,GAAE,mBAAwB,GAAG,IAAI,CAInF"}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* LangChain adapter for Reminix Runtime.
|
|
3
3
|
*/
|
|
4
4
|
import { HumanMessage, AIMessage, SystemMessage, ToolMessage, } from '@langchain/core/messages';
|
|
5
|
-
import {
|
|
5
|
+
import { AgentAdapter, serve, } from '@reminix/runtime';
|
|
6
6
|
/**
|
|
7
7
|
* Adapter for LangChain agents and runnables.
|
|
8
8
|
*/
|
|
9
|
-
export class
|
|
9
|
+
export class LangChainAgentAdapter extends AgentAdapter {
|
|
10
10
|
static adapterName = 'langchain';
|
|
11
11
|
agent;
|
|
12
12
|
_name;
|
|
@@ -47,39 +47,33 @@ export class LangChainAdapter extends AdapterBase {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* Build LangChain input from execute request.
|
|
51
51
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (
|
|
55
|
-
|
|
52
|
+
buildLangChainInput(request) {
|
|
53
|
+
const input = request.input;
|
|
54
|
+
if ('messages' in input) {
|
|
55
|
+
const messages = input.messages;
|
|
56
|
+
return messages.map((m) => this.toLangChainMessage(m));
|
|
56
57
|
}
|
|
57
|
-
else if (
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
else if (message instanceof SystemMessage) {
|
|
61
|
-
role = 'system';
|
|
62
|
-
}
|
|
63
|
-
else if (message instanceof ToolMessage) {
|
|
64
|
-
role = 'tool';
|
|
58
|
+
else if ('prompt' in input) {
|
|
59
|
+
return input.prompt;
|
|
65
60
|
}
|
|
66
61
|
else {
|
|
67
|
-
|
|
62
|
+
return input;
|
|
68
63
|
}
|
|
69
|
-
const content = typeof message.content === 'string' ? message.content : String(message.content);
|
|
70
|
-
return { role, content };
|
|
71
64
|
}
|
|
72
65
|
/**
|
|
73
|
-
* Handle an
|
|
66
|
+
* Handle an execute request.
|
|
74
67
|
*
|
|
75
|
-
* For task-oriented operations.
|
|
68
|
+
* For both task-oriented and chat-style operations. Expects input with 'messages' key
|
|
69
|
+
* or a 'prompt' key for simple text generation.
|
|
76
70
|
*
|
|
77
|
-
* @param request - The
|
|
78
|
-
* @returns The
|
|
71
|
+
* @param request - The execute request with input data.
|
|
72
|
+
* @returns The execute response with the output.
|
|
79
73
|
*/
|
|
80
|
-
async
|
|
81
|
-
|
|
82
|
-
const response = await this.agent.invoke(
|
|
74
|
+
async execute(request) {
|
|
75
|
+
const invokeInput = this.buildLangChainInput(request);
|
|
76
|
+
const response = await this.agent.invoke(invokeInput);
|
|
83
77
|
// Extract output from response
|
|
84
78
|
let output;
|
|
85
79
|
if (response && typeof response === 'object' && 'content' in response) {
|
|
@@ -94,66 +88,15 @@ export class LangChainAdapter extends AdapterBase {
|
|
|
94
88
|
return { output };
|
|
95
89
|
}
|
|
96
90
|
/**
|
|
97
|
-
* Handle a
|
|
98
|
-
*
|
|
99
|
-
* For conversational interactions. Converts messages to LangChain format.
|
|
100
|
-
*
|
|
101
|
-
* @param request - The chat request with messages.
|
|
102
|
-
* @returns The chat response with output and messages.
|
|
103
|
-
*/
|
|
104
|
-
async chat(request) {
|
|
105
|
-
// Convert messages to LangChain format
|
|
106
|
-
const lcMessages = request.messages.map((m) => this.toLangChainMessage(m));
|
|
107
|
-
// Call the runnable
|
|
108
|
-
const response = await this.agent.invoke(lcMessages);
|
|
109
|
-
// Extract content from response
|
|
110
|
-
let output;
|
|
111
|
-
let responseMessage;
|
|
112
|
-
if (response && typeof response === 'object' && 'content' in response) {
|
|
113
|
-
output = typeof response.content === 'string' ? response.content : String(response.content);
|
|
114
|
-
responseMessage = this.toReminixMessage(response);
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
output = String(response);
|
|
118
|
-
responseMessage = { role: 'assistant', content: output };
|
|
119
|
-
}
|
|
120
|
-
// Build response messages (original + assistant response)
|
|
121
|
-
const responseMessages = [...request.messages, responseMessage];
|
|
122
|
-
return { output, messages: responseMessages };
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Handle a streaming invoke request.
|
|
126
|
-
*
|
|
127
|
-
* @param request - The invoke request with input data.
|
|
128
|
-
* @yields JSON-encoded chunks from the stream.
|
|
129
|
-
*/
|
|
130
|
-
async *invokeStream(request) {
|
|
131
|
-
// Stream from the runnable
|
|
132
|
-
for await (const chunk of await this.agent.stream(request.input)) {
|
|
133
|
-
let content;
|
|
134
|
-
if (chunk && typeof chunk === 'object' && 'content' in chunk) {
|
|
135
|
-
content = typeof chunk.content === 'string' ? chunk.content : String(chunk.content);
|
|
136
|
-
}
|
|
137
|
-
else if (typeof chunk === 'object') {
|
|
138
|
-
content = JSON.stringify(chunk);
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
content = String(chunk);
|
|
142
|
-
}
|
|
143
|
-
yield JSON.stringify({ chunk: content });
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Handle a streaming chat request.
|
|
91
|
+
* Handle a streaming execute request.
|
|
148
92
|
*
|
|
149
|
-
* @param request - The
|
|
93
|
+
* @param request - The execute request with input data.
|
|
150
94
|
* @yields JSON-encoded chunks from the stream.
|
|
151
95
|
*/
|
|
152
|
-
async *
|
|
153
|
-
|
|
154
|
-
const lcMessages = request.messages.map((m) => this.toLangChainMessage(m));
|
|
96
|
+
async *executeStream(request) {
|
|
97
|
+
const streamInput = this.buildLangChainInput(request);
|
|
155
98
|
// Stream from the runnable
|
|
156
|
-
for await (const chunk of await this.agent.stream(
|
|
99
|
+
for await (const chunk of await this.agent.stream(streamInput)) {
|
|
157
100
|
let content;
|
|
158
101
|
if (chunk && typeof chunk === 'object' && 'content' in chunk) {
|
|
159
102
|
content = typeof chunk.content === 'string' ? chunk.content : String(chunk.content);
|
|
@@ -173,7 +116,7 @@ export class LangChainAdapter extends AdapterBase {
|
|
|
173
116
|
*
|
|
174
117
|
* @param agent - A LangChain runnable (e.g., ChatModel, chain, agent).
|
|
175
118
|
* @param name - Name for the agent.
|
|
176
|
-
* @returns A
|
|
119
|
+
* @returns A LangChainAgentAdapter instance.
|
|
177
120
|
*
|
|
178
121
|
* @example
|
|
179
122
|
* ```typescript
|
|
@@ -187,7 +130,7 @@ export class LangChainAdapter extends AdapterBase {
|
|
|
187
130
|
* ```
|
|
188
131
|
*/
|
|
189
132
|
export function wrapAgent(agent, name = 'langchain-agent') {
|
|
190
|
-
return new
|
|
133
|
+
return new LangChainAgentAdapter(agent, name);
|
|
191
134
|
}
|
|
192
135
|
/**
|
|
193
136
|
* Wrap a LangChain runnable and serve it immediately.
|
|
@@ -211,4 +154,4 @@ export function serveAgent(agent, options = {}) {
|
|
|
211
154
|
const wrappedAgent = wrapAgent(agent, name);
|
|
212
155
|
serve({ agents: [wrappedAgent], port, hostname });
|
|
213
156
|
}
|
|
214
|
-
//# sourceMappingURL=adapter.js.map
|
|
157
|
+
//# sourceMappingURL=agent-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-adapter.js","sourceRoot":"","sources":["../src/agent-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,YAAY,EACZ,SAAS,EACT,aAAa,EACb,WAAW,GAEZ,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,YAAY,EACZ,KAAK,GAKN,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,YAAY;IACrD,MAAM,CAAC,WAAW,GAAG,WAAW,CAAC;IAEzB,KAAK,CAAW;IAChB,KAAK,CAAS;IAEtB;;;;;OAKG;IACH,YAAY,KAAe,EAAE,OAAe,iBAAiB;QAC3D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACK,kBAAkB,CAAC,OAAgB;QACzC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAClC,MAAM,UAAU,GAAG,OAAO,IAAI,EAAE,CAAC;QAEjC,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,MAAM;gBACT,OAAO,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;YACnD,KAAK,WAAW;gBACd,OAAO,IAAI,SAAS,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;YAChD,KAAK,QAAQ;gBACX,OAAO,IAAI,aAAa,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;YACpD,KAAK,MAAM;gBACT,OAAO,IAAI,WAAW,CAAC;oBACrB,OAAO,EAAE,UAAU;oBACnB,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,SA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O,CAAC;IACzC,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { WrapAndServeOptions } from './adapter.js';
|
|
1
|
+
export { LangChainAgentAdapter, wrapAgent, serveAgent } from './agent-adapter.js';
|
|
2
|
+
export type { WrapAndServeOptions } from './agent-adapter.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAClF,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { LangChainAgentAdapter, wrapAgent, serveAgent } from './agent-adapter.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reminix/langchain",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Reminix adapter for LangChain - serve agents as REST APIs",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"LICENSE"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@reminix/runtime": "^0.0.
|
|
48
|
+
"@reminix/runtime": "^0.0.8"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@langchain/core": ">=1.1.0"
|
package/dist/adapter.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EACL,WAAW,EAEX,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,YAAY,EAElB,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,MAAM,CAAC,WAAW,SAAe;IAEjC,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,KAAK,CAAS;IAEtB;;;;;OAKG;gBACS,KAAK,EAAE,QAAQ,EAAE,IAAI,GAAE,MAA0B;IAM7D,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAqB1B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAoBxB;;;;;;;OAOG;IACG,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAiB7D;;;;;;;OAOG;IACG,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OA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