mirror of
https://github.com/langchain-ai/docs.git
synced 2026-08-27 10:52:15 -04:00
10 lines
264 B
Plaintext
10 lines
264 B
Plaintext
```ts
|
|
import * as fs from "node:fs/promises";
|
|
|
|
const drawableGraph = await agent.getGraphAsync();
|
|
const image = await drawableGraph.drawMermaidPng();
|
|
const imageBuffer = new Uint8Array(await image.arrayBuffer());
|
|
|
|
await fs.writeFile("graph.png", imageBuffer);
|
|
```
|