From the course: Introduction to AI Orchestration with LangChain and LlamaIndex

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Building an app with the OpenAI API

Building an app with the OpenAI API

We're just a few lines of code away from our first AI application. In order to have a clear baseline for future comparisons, we'll start out by talking directly to the OpenAI API. Now for this, you'll need your own API key from OpenAI. If you haven't already, go ahead and create and verify an account on openai.com. Then follow the links like the ones you'll see here to API keys and create an API key. So let's talk about models. If you've played with ChatGPT, you've experienced the chat model optimized for back and forth conversations. Each alternation is what's called a conversational turn. Other models are labeled instruct, and these are optimized for direct responses without multiple turns. You ask something, you get a response, you're done. There are some differences in the training materials fed into these models, and this won't matter for a simple app like the one we're building right now, but the differences will come up in an upcoming chapter. By the way, this back-and-forth…

Contents