Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample added: Calling Azure OpenAI API in Stream mode #4509

Merged
merged 3 commits into from
Jan 11, 2024

Conversation

luismanez
Copy link
Contributor

  • Bug fix?
  • New sample?
  • Related issues: fixes #X, partially #Y, mentioned in #Z
  • Needs API permissions?
  • Has other prerequisites? (E.g. requires a list, document library, etc.)

What's in this Pull Request?

Added a new sample: Calling Azure OpenAI API in Stream mode.
This webpart shows how you can call Azure OpenAI API in Streaming mode, so the webpart shows the data coming from the API in chunks, giving a much better user experience, so you are not waiting for the entire response. It also shows how you can cancel the streaming response at any point, which is useful to safe some tokens (hence money), if the generating response does not look good to you (like when getting AI hallucinations).

Node Version

Node version used: v16.18.1

Checklist

  • My pull request affects only ONE sample.
  • My sample does not build with any warnings
  • I have updated the README file.
  • My README has at least one static high-resolution screenshot (i.e. not a GIF)
  • My README contains complete setup instructions, including pre-requisites and permissions required

@hugoabernier hugoabernier merged commit 298f26e into pnp:main Jan 11, 2024
1 check passed
@hugoabernier
Copy link
Collaborator

Thank you @luismanez for your sample!

We'd love to have your sample featured in one of our future community calls.

If you'd be interested on showing this great sample in a public community call, please fill in following form and we'll get you scheduled - aka.ms/community/request/demo

Thank you for sharing your sample with others - highly appreciated 👏🥇👩‍💻

@luismanez
Copy link
Contributor Author

Thanks @hugoabernier
Demo already scheduled (8th Feb) 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants