Grokking Generative AI Fundamentals
Vote

0% completed

​

Your First LLM API Call

from openai import OpenAI client = OpenAI() response = client.chat.completions.create( model="your-chosen-model", messages=[{"role": "user", "content": "Where is my order 4471?"}], ) print(response.choices[0].message.content)

These lines use the OpenAI Python library to send a support question from an online store to a hosted model. They work on a laptop, but they lack four things that real users need. Nothing tells the model its job. The user sees nothing until the whole reply is written. The code never checks whether the reply was cut short

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content