You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/docs/api-reference/ai-stream.mdx
+7-7
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: AIStream
3
3
---
4
4
5
-
import { OptionTable } from'@/components/table'
5
+
import { OptionTable } from'@/components/table';
6
6
7
7
# AIStream
8
8
@@ -32,7 +32,7 @@ This is an optional parameter which is an object that contains callback function
32
32
33
33
```tsx
34
34
interfaceAIStreamParser {
35
-
(data:string):string|void
35
+
(data:string):string|void;
36
36
}
37
37
```
38
38
@@ -45,23 +45,23 @@ This is an object that contains the following properties:
45
45
[
46
46
'onStart',
47
47
'() => Promise<void>',
48
-
'An optional function that is called at the start of the stream processing.'
48
+
'An optional function that is called at the start of the stream processing.',
49
49
],
50
50
[
51
51
'onCompletion',
52
52
'(completion: string) => Promise<void>',
53
-
"An optional function that is called for every completion. It's passed the completion as a string."
53
+
"An optional function that is called for every completion. It's passed the completion as a string.",
54
54
],
55
55
[
56
56
'onFinal',
57
57
'(completion: string) => Promise<void>',
58
-
"An optional function that is called once for every request. It's passed the completion as a string. Differs from onCompletion when function calls are present."
58
+
"An optional function that is called once for every request. It's passed the completion as a string. Differs from onCompletion when function calls are present.",
59
59
],
60
60
[
61
61
'onToken',
62
62
'(token: string) => Promise<void>',
63
-
"An optional function that is called for each token in the stream. It's passed the token as a string."
64
-
]
63
+
"An optional function that is called for each token in the stream. It's passed the token as a string.",
Uses LLama 2 chat tokens (`[INST]`) to create a prompt, learn more in the [Hugging Face Blog on how to prompt Llama 2](https://huggingface.co/blog/llama2#how-to-prompt-llama-2). If a `Message` with an unsupported `role` is passed, an error will be thrown.
0 commit comments