@dcp-ai/create-langchain 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/package.json +1 -1
- package/template/README.md +13 -14
package/package.json
CHANGED
package/template/README.md
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
# DCP-AI + LangChain Template
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A walkthrough of the DCP flow around a LangChain call.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> **A walkthrough, not a signer.** The keys and signatures in `index.js` are placeholders (`«generated»`, `«sig»`): the template shows the shape of the DCP v2.0 flow, but it generates no keys, signs nothing, and its bundles do not verify. It reads nothing from `.dcp/`. For real keys and signatures, follow [docs/QUICKSTART_LANGCHAIN.md](https://github.com/dcp-ai-protocol/dcp-ai/blob/main/docs/QUICKSTART_LANGCHAIN.md).
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
```
|
|
7
|
+
The template pins LangChain.js 0.3 (`langchain` and `@langchain/openai` `^0.3.0`); the guide shows the current LangChain.js v1 API.
|
|
8
|
+
|
|
9
|
+
## Quick Start
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
1. Install dependencies:
|
|
13
12
|
```bash
|
|
14
13
|
npm install
|
|
15
14
|
```
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
2. Run it. With `OPENAI_API_KEY` the template calls the OpenAI API (billed by OpenAI). If the call fails for any reason (no key, network, quota, model), it prints a simulated response and still records `outcome: "success"`, so the audit entry does not show that the call succeeded. Set the key in your environment:
|
|
18
17
|
```bash
|
|
19
18
|
node index.js
|
|
20
19
|
```
|
|
21
20
|
|
|
22
21
|
## What this template does
|
|
23
22
|
|
|
24
|
-
-
|
|
25
|
-
- Every action is declared as an Intent
|
|
26
|
-
|
|
27
|
-
-
|
|
23
|
+
- Wraps a LangChain call in the DCP flow
|
|
24
|
+
- Every action is declared as an Intent; the policy step is a stub that always returns `approve` (risk 50), so the
|
|
25
|
+
escalate and block branches show the flow but are not reached
|
|
26
|
+
- Every response gets an audit entry
|
|
27
|
+
- The agent's Citizenship Bundle carries placeholder signatures
|
|
28
28
|
|
|
29
29
|
## Files
|
|
30
30
|
|
|
31
|
-
- `index.js` — LangChain
|
|
32
|
-
- `.dcp/config.json` — DCP configuration (generated by init)
|
|
31
|
+
- `index.js` — LangChain call with the DCP flow
|
|
33
32
|
- `package.json` — Dependencies
|