llmjs2 2.0.0 → 2.0.1
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 +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,12 +65,12 @@ Guardrails can be provided to modify requests pre-call or post-call.
|
|
|
65
65
|
- The `Agent` wraps a routing instance, optional `Memory` backend, and optional `tools`. It supports multi-turn flows and tool-calls returned by models.
|
|
66
66
|
|
|
67
67
|
```js
|
|
68
|
-
import { Agent,
|
|
68
|
+
import { Agent, Memory } from 'llmjs2';
|
|
69
69
|
|
|
70
70
|
const agent = new Agent({
|
|
71
71
|
instruction: 'You are a helpful assistant.',
|
|
72
72
|
route: router({ model_list: [{ model_name: 'r', llm_params: { model: 'openai/gpt-4o-mini' } }] }),
|
|
73
|
-
memory: inMemory(),
|
|
73
|
+
memory: Memory.inMemory(),
|
|
74
74
|
tools: [
|
|
75
75
|
{
|
|
76
76
|
name: 'echo',
|
|
@@ -87,8 +87,8 @@ console.log(out);
|
|
|
87
87
|
|
|
88
88
|
**Memory**
|
|
89
89
|
|
|
90
|
-
-
|
|
91
|
-
-
|
|
90
|
+
- Preferred (namespace): `Memory.inMemory()` / `Memory.fileMemory({ path: './memory.json' })`
|
|
91
|
+
- Alternative (named exports): `inMemory()` / `fileMemory({ path })` — both remain available.
|
|
92
92
|
|
|
93
93
|
Both implement: `save(resourceId, threadId, role, content)`, `list(resourceId, threadId, limit)`, `search(resourceId, query)`, `clear(resourceId, threadId)`.
|
|
94
94
|
|
|
@@ -116,7 +116,7 @@ The library reads these from `process.env` or via the `getConfig()` defaults.
|
|
|
116
116
|
- `completion(promptOrOptions)` — single-call completion helper. Accepts a string or a `CompletionOptions` object.
|
|
117
117
|
- `router(configOrPath)` — build a router instance from config object or file path. Returns `{ completion(options) }`.
|
|
118
118
|
- `Agent` / `createAgent(config)` — agent class for multi-turn workflows and tool execution.
|
|
119
|
-
- `inMemory()` / `fileMemory({ path })` — memory backends.
|
|
119
|
+
- `inMemory()` / `fileMemory({ path })` — memory backends. (Or use `Memory.inMemory()` / `Memory.fileMemory()`)
|
|
120
120
|
- `verbose(level)` — set logger verbosity.
|
|
121
121
|
|
|
122
122
|
**Build & Publish Notes**
|