Skip to content

Commit 59bbc2f

Browse files
julien-cWauplin
andauthored
Update README.md
Co-authored-by: Lucain <[email protected]>
1 parent e5de2f2 commit 59bbc2f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,13 @@ const agent = new Agent({
243243

244244

245245
await agent.loadTools();
246-
for await (const chunk of agent.run("Draw a picture of a cat wearing a top hat. Then caption the picture and read it out loud.")) {
247-
console.log(chunk);
246+
for await (const chunk of agent.run("What are the top 5 trending models on Hugging Face?")) {
247+
if ("choices" in chunk) {
248+
const delta = chunk.choices[0]?.delta;
249+
if (delta.content) {
250+
console.log(delta.content);
251+
}
252+
}
248253
}
249254
```
250255

0 commit comments

Comments
 (0)