Grokking Generative AI Fundamentals
Vote

0% completed

​

Structured Output and Tool Calling

model reply: Sure, here is the JSON: {"city": "Lahore"}
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

A travel app logged this error in production. A user had asked whether she needed an umbrella in Lahore today. The app asked a model to return the city as JSON, so that code could pass the city to a weather service. Most replies were plain JSON, but this one began with a friendly sentence. Python's JSON parser, the function that turns that text into data, raised the error at the first character, the "S" of "Sure."

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content