1. Learn
  2. /
  3. Courses
  4. /
  5. Graph RAG with LangChain and Neo4j

Connected

Exercise

Providing few-shot examples

While structured outputs describe how you would like the data to be returned, it still leaves a lot open to interpretation when it comes to what should be returned.

The Field class allows you to provide example values that give the LLM information on what a good extraction looks like. This is an example of few-shot prompting for structured outputs.

You'll extend the Character class to contain an id field for uniquely identifying characters. You want to provide the model with two examples for it to draw from: "romeo-montague" and "lady-capulet".

Instructions

100 XP
  • Specify the keyword to provide example values for the id property.