Stream GPT Responses from OpenAI ChatGPT API | Swift

preview_player
Показать описание
In this highly requested tutorial, I'll walk you through the process of integrating the "Stream" functionality into your ChatGPT-powered iOS app using Swift. Learn how to display data incrementally, significantly improving user experience and making your app more efficient.

I'll be uploading the source code to my Patreon, and sharing updates through my newsletter.

Socials:
Рекомендации по теме
Комментарии
Автор

Hi Mazen! Hope that you will be fine. I am having an error in duration 11:00 to 11:30. where you started creating existing message index. My error is (Referencing operator function '==' on 'StringProtocol' requires that 'UUID' conform to 'StringProtocol'). Please let me know how to resolve this issue.

babarmughal
Автор

More OpenAI videos please! 😅
Eid Mubarak ❤🎉

DDSTV
Автор

2 errors. The first being,  
#1 -- Referencing operator function '==' on 'StringProtocol' requires that 'UUID' conform to 'StringProtocol' 
#2 -- Cannot convert value of type 'String' to expected argument type 'UUID'

DDSTV
Автор

I am having trouble saving the messages between the AI and the user any help?

dslkgjsdlkfjd
Автор

Oh, man! you just save me a lot! Thanks dude!

laureal
Автор

Super buper videos!! I'm waiting for your next video tutorial. And can you also add how to handle response to make words as a button. Like chatgpt will teach children via word game^^

sherzodmahmudov
Автор

Great videos Mazen! Keep going!

You mentioned in the previous video that you will create a more comprehensive series with more GPT functionalities like storing chat histories etc. When are you gonna upload this? Looking forward!

Kevin-gxkq
Автор

Great Videoooo as alwaysss, keep up the great work broo💪🔥, just a quick questions: in 10:23 what was the thing that you renamed to "newMessageResponse"?

yousefahmed
Автор

How to stop the stream in between? Let's user clicked on cancel button or went onto another screen of the app.

arnavodkaa
Автор

Thanks for the video. I am wondering how can you segment users, in say Firebase, so that they can use the same API, but their conversations are stored separately from each other?

mikaelreijonen
Автор

Hi, I have a problem, when I press return on my keyboard all chats disappear. Is there a way to fix this?

rudolfsrijkuris
Автор

Hey Mazen! Amazing video. I had onr query tho, how can i use MaxTokens, temperature, top p etc. in my code? To set a limit on the maximum number of tokens and what is the default number of tokens in your implementation?

infonity_yt
Автор

Also, I think we have an official openai swift library now

ArnavMazumder
Автор

Can you make a video showing how we can store multiple chats? Does it need to send all previous responses as context to continue a specific chat? Also how can we make it send a message when hitting the return key on the keyboard?

james.a
Автор

which one costs more tokens, stream or normal? how much more

kunniu
Автор

The problem with your approach of splitting the response string by “data:” is that if a user sends in any message containing “data:” in the content, That’ll create a false-positive split and result in your Json string getting broken. What do you do in that case? This is the stupidest response format I’ve seen from an established company so far.

ArnavMazumder