Skip to content

Commit

Permalink
streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
sharanshirodkar7 committed May 7, 2024
1 parent 74e0666 commit b3e187b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fern/docs/pages/usingllms/streaming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ To use the streaming capability, set the `stream` parameter to `True` in your AP
temperature=0.1,
stream=True
):

print(res["data"]["choices"][0]["delta"]["content"])
# Use 'end' parameter in print function to avoid new lines.
print(res["data"]["choices"][0]["delta"]["content"], end='')
```
</CodeBlock>
<CodeBlock title="cURL">
Expand Down Expand Up @@ -103,3 +103,8 @@ To use the streaming capability, set the `stream` parameter to `True` in your AP
## Streaming Output Example

This animated GIF demonstrates the real-time output of our Streaming API as data is received:

<video width="320" height="240" controls>
<source src="streaming.mov" type="video/mp4">
Your browser does not support the video tag.
</video>
Binary file added fern/docs/pages/usingllms/streaming.mov
Binary file not shown.

0 comments on commit b3e187b

Please sign in to comment.