# OpenAI GPT Streaming Functionality

**URL:** <https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645>\
**Category:** Need help\
**Created:** [March 8, 2023, 5:49am UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645 "2023-03-08T05:49:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stackapp](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@Stackapp](https://forum.bubble.io/u/Stackapp)\
**Post date:** [March 8, 2023, 5:49am UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/1 "2023-03-08T05:49:30Z")

</div>

Has anyone successfully setup the realtime streaming for OpenAI’s GPT API’s? Not to be confused with implementing the API call. Specifically, I am seeking how to setup the real-time streaming functionality.

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [March 8, 2023, 6:25am UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/2 "2023-03-08T06:25:47Z")

</div>

Yes yea.

---

<div class="post-metadata">

**Author:** ![bkerryk](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/bkerryk/32/184126_2.png) [@bkerryk](https://forum.bubble.io/u/bkerryk)\
**Post date:** [March 8, 2023, 6:40am UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/3 "2023-03-08T06:40:15Z")

</div>

Prove it 😆

---

<div class="post-metadata">

**Author:** ![bkerryk](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/bkerryk/32/184126_2.png) [@bkerryk](https://forum.bubble.io/u/bkerryk)\
**Post date:** [March 8, 2023, 6:40am UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/4 "2023-03-08T06:40:56Z")

</div>

Nah in all seriousness, you got it running in bubble by creating a plugin right?

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [March 8, 2023, 6:41am UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/5 "2023-03-08T06:41:41Z")

</div>

![image](https://us1.discourse-cdn.com/bubble/original/3X/d/e/de1d6e7f9c8e98246de6e008f4e71f0634b2b495.jpeg)

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [March 8, 2023, 6:46am UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/6 "2023-03-08T06:46:23Z")

</div>

If you’re seriously stuck on implementing the OpenAI APIs (which are as simple as they come), then you need to go back to the Bubble tuts about Spotify. Same difference.

---

<div class="post-metadata">

**Author:** ![bkerryk](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/bkerryk/32/184126_2.png) [@bkerryk](https://forum.bubble.io/u/bkerryk)\
**Post date:** [March 8, 2023, 7:19am UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/7 "2023-03-08T07:19:10Z")

</div>

I’ve got the API working. Very easy. I assumed the streaming function was not possible through the API connector.

My problem that is different to OP is that my big 2000 word request cause the response to take too long and seems to time out bubbles api connector…

But I guess where this connects with OP is that if i had streaming working then my problem dissolves.

---

<div class="post-metadata">

**Author:** ![Stackapp](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@Stackapp](https://forum.bubble.io/u/Stackapp)\
**Post date:** [March 8, 2023, 2:33pm UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/8 "2023-03-08T14:33:28Z")

</div>

@Keith Can you demonstrate and expand on how you got it to work

---

<div class="post-metadata">

**Author:** ![Stackapp](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@Stackapp](https://forum.bubble.io/u/Stackapp)\
**Post date:** [March 8, 2023, 4:11pm UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/9 "2023-03-08T16:11:58Z")

</div>

I believe there was some confusion regarding what streaming the OpenAI GPT call meant. So I wanted to post this video to demonstrate it. If anyone has been able to accomplish this in Bubble, any direction would be greatly appreciated.

[![](https://img.youtube.com/vi/GiDdWVsvvJ8/hqdefault.jpg "Streaming completions from GPT 3 API. Chat gpt like streaming text with Streamlit web app UI") ](https://www.youtube.com/watch?v=GiDdWVsvvJ8)

---

<div class="post-metadata">

**Author:** ![cmarchan](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cmarchan/32/253062_2.png) [@cmarchan](https://forum.bubble.io/u/cmarchan)\
**Post date:** [March 8, 2023, 4:32pm UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/10 "2023-03-08T16:32:28Z")

</div>

@Stackapp

Second @keith comments as calling OpenAI’s endpoints is very straightforward.

The OpenAI API endpoints have a capacity number of tokens of 4096. Think of this as a means to see a big universe through a telescope., The 4096 tokens are what the telescope allows us to be able to access the more than hundreds of thousands of tokens that their LLMs (large languagee models) currently handle.

The arquitecture to build a memory to an AI app that is built conventionally or in any other way … i.e. … one of them being a Bubble app … requires the use of embeddings. These are actually vector embeddings (numbers that represent a semantic meaning) that can be handled by conventional databases but for best performance via vector databases such as Pinecone (that house the vectors which represent the combination of tokened-embeddings along with their text metadata).

Here a few resources that may prove useful:

[https://twitter.com/johnjnay/status/1603779835238748162?s=61&t=4L9ClA18krHTHFPEl0YPmg](https://twitter.com/johnjnay/status/1603779835238748162?s=61&t=4L9ClA18krHTHFPEl0YPmg)

[![](https://img.youtube.com/vi/ocxq84ocYi0/maxresdefault.jpg "OpenAI's New GPT 3.5 Embedding Model for Semantic Search") ](https://www.youtube.com/watch?v=ocxq84ocYi0&t=216s)

[![](https://img.youtube.com/vi/rrAChpbwygE/maxresdefault.jpg "Generative AI and Long-Term Memory for LLMs (OpenAI, Cohere, OS, Pinecone)") ](https://www.youtube.com/watch?v=rrAChpbwygE)

In all, what I meant to suggest is that to build expanded functionality into an AI app one requires an arquitecture that includes most of the above components in order to function adequately.

---

<div class="post-metadata">

**Author:** ![Stackapp](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@Stackapp](https://forum.bubble.io/u/Stackapp)\
**Post date:** [March 8, 2023, 4:42pm UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/11 "2023-03-08T16:42:50Z")

</div>

Hi @cmarchan can you tell me which part of your response speaks specifically on how to implement the streaming functionality in Bubble?

If anyone is able to demonstrate the streaming functionality in Bubble, reach out to me. I will pay you for your time in consulting on how to implement it.

---

<div class="post-metadata">

**Author:** ![cmarchan](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cmarchan/32/253062_2.png) [@cmarchan](https://forum.bubble.io/u/cmarchan)\
**Post date:** [March 8, 2023, 4:44pm UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/12 "2023-03-08T16:44:53Z")

</div>

Hello @Stackapp !

I have not yet dealt with it. Just wanted to contribute with further information.

I did not mean any ill. 😉

---

<div class="post-metadata">

**Author:** ![Stackapp](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@Stackapp](https://forum.bubble.io/u/Stackapp)\
**Post date:** [March 13, 2023, 1:45am UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/14 "2023-03-13T01:45:37Z")

</div>

Has anyone been able to implement the streaming functionality in Bubble?

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [March 13, 2023, 2:57am UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/15 "2023-03-13T02:57:54Z")

</div>

Yes. Everyone. Cue FOMO.

---

<div class="post-metadata">

**Author:** ![Stackapp](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@Stackapp](https://forum.bubble.io/u/Stackapp)\
**Post date:** [March 13, 2023, 7:48pm UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/16 "2023-03-13T19:48:10Z")

</div>

@keith Please list some links with Bubble apps that are currently utilizing the streaming functionality. Tons of GPT plugins but not one is using streaming functionality. If you can point one out that uses the streaming, I will close the thread and put this topic to rest.

---

<div class="post-metadata">

**Author:** ![Atomily](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/atomily/32/162570_2.png) [@Atomily](https://forum.bubble.io/u/Atomily)\
**Post date:** [March 21, 2023, 2:26pm UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/17 "2023-03-21T14:26:23Z")

</div>

This is the thread I’ve been searching for! @keith taking your lead here please 🙏

---

<div class="post-metadata">

**Author:** ![Atomily](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/atomily/32/162570_2.png) [@Atomily](https://forum.bubble.io/u/Atomily)\
**Post date:** [March 23, 2023, 9:11am UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/18 "2023-03-23T09:11:07Z")

</div>

Has anyone been able to integrate langchain with [bubble.io](http://bubble.io). Seems like this could be the missing piece

---

<div class="post-metadata">

**Author:** ![rorydwyer14](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@rorydwyer14](https://forum.bubble.io/u/rorydwyer14)\
**Post date:** [March 28, 2023, 8:55pm UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/19 "2023-03-28T20:55:19Z")

</div>

Hi, was anyone able to achieve the streaming element of the api in bubble? I’ve set up the api for completions but can’t get it working when adding the stream = true parameter.  
I don’t have extensive experience with APIs some of the vids provided have gone over my head a little/lot.

---

<div class="post-metadata">

**Author:** ![lollib](https://avatars.discourse-cdn.com/v4/letter/l/eada6e/32.png) [@lollib](https://forum.bubble.io/u/lollib)\
**Post date:** [April 14, 2023, 10:58pm UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/21 "2023-04-14T22:58:12Z")

</div>

> [@rorydwyer14](#):
>
> ve the streaming element of the api in bubble? I’ve set up the api for completions but can’t get it working when adding the stream = true parameter.  
> I don’t have extensive experience with APIs some of the vi

Hack - call the API as you are, use typewriter effect to make it look streaming. a little lag but oh well.

---

<div class="post-metadata">

**Author:** ![launchable](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/launchable/32/91733_2.png) [@launchable](https://forum.bubble.io/u/launchable)\
**Post date:** [April 15, 2023, 12:45am UTC](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645/22 "2023-04-15T00:45:40Z")

</div>

I’ve recently published a plugin that does it. Not linking here b/c I don’t think I’m allowed to, but you can find it under “ChatGPT with Real-Time Streaming”.

[Next page](https://forum.bubble.io/t/openai-gpt-streaming-functionality/250645.md?page=2)
