Skip to content

Commit

Permalink
docs(README): prompt.stream()
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Sep 4, 2024
1 parent f8eec8f commit 828b6e3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,22 @@ await prompt({
});
```
#### `prompt.stream(message, options)`
Works the same way as `prompt()`, but returns an async iterator instead of a promise.
```js
import { prompt } from "@copilot-extensions/preview-sdk";

const { iterator } = prompt.stream("What is the capital of France?", {
token: process.env.TOKEN,
});

for await (const result of iterator) {
console.log(result.message.content);
}
```
### `getFunctionCalls()`
Convenience metthod if a result from a `prompt()` call includes function calls.
Expand Down

0 comments on commit 828b6e3

Please sign in to comment.