I'm looking to build a simple GPT wrapper that has location-based functionality. Users will need to enable their location and stay within specific parameters to access the site. The aim is to produce recommendations that lead to calls-to-action for local businesses. I have some basic knowledge in vanilla JavaScript and am currently learning React. My initial thought is that I just need to integrate the OpenAI API into a landing page, but I'm wondering if it's more complicated than that?
3 Answers
Just call the API and display the results you get back. It can be that straightforward, but remember to design a user-friendly interface that makes the best use of those results!
It’s also important to think about how to manipulate the LLMs effectively. You might want to use various layers and agents in your application design to get the results you want.
If you're building a chat-style app, keep in mind you'll have to manage token usage and chat history. You'll need to send previous messages to provide context, which can use up a lot of tokens, especially if chats get lengthy. It's a good idea to keep your requests within the maximum input token limit. You might consider stripping out older messages or unnecessary filler words to save on tokens.
Or when the conversation gets too long, create an embedding of their chat to use for context. As the chat grows, just update that embedding.
Could you combine all that chat history into a single request instead?