Answers.Body: <p>That is achieved usually via web-socket, however <a href="https://community.openai.com/t/need-some-assistance-around-websockets-on-open-ai-api/119851/2" rel="nofollow noreferrer">it is not available yet</a></p>
  <p>I see some workaround like <a href="https://github.com/cookeem/chatgpt-service" rel="nofollow noreferrer">https://github.com/cookeem/chatgpt-service</a>, which just get's the full answer and then streams word by word via websocket, so it's even slower</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-03T13:05:31.083Z
Answers.Text: Please, refrain from answering questions that are off-topic. Instead, you should vote to close them. Programming questions and questions about specific products, tools or APIs are generally off-topic here.
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-09-26T23:50:02.110Z
Answers.LastActivityDate: 2023-09-26T23:50:02.110Z
Answers.UserDisplayName: Alberto
Body: <p>I am using the get_completion function to generate response to a question. Since generating response takes a long time (~5 seconds) I would like to display the response text as it's generated (dynamically, similar to chatgpt or <a href="https://www.perplexity.ai/" rel="nofollow noreferrer">https://www.perplexity.ai/</a>). Does openAI's API make this possible? I couldn't find a code/example anywhere online</p>
  
Tags: <open-ai><chatgpt><question-answering><text-generation>
Title: Dynamic text completion
UserDisplayName: afshi7n
ThreadText: # Dynamic text completion
  
  (Asked by: username_0 on 2023-09-26)
  
  I am using the get\_completion function to generate response to a question. Since generating response takes a long time (~5 seconds) I would like to display the response text as it's generated (dynamically, similar to chatgpt or <https://www.perplexity.ai/>). Does openAI's API make this possible? I couldn't find a code/example anywhere online
  
  **Tags:** open-ai, chatgpt, question-answering, text-generation
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-09-26. Score: 1
  
  That is achieved usually via web-socket, however [it is not available yet](https://community.openai.com/t/need-some-assistance-around-websockets-on-open-ai-api/119851/2)
  
  I see some workaround like <https://github.com/cookeem/chatgpt-service>, which just get's the full answer and then streams word by word via websocket, so it's even slower
  
  > **Comments:**
  > **username_2**: Please, refrain from answering questions that are off-topic. Instead, you should vote to close them. Programming questions and questions about specific products, tools or APIs are generally off-topic here.  
  
  ---
  
  