From 81fadb23e20be497e3cfb38a818e5f46f7b62f49 Mon Sep 17 00:00:00 2001 From: Jack Collins <6640905+jackmpcollins@users.noreply.github.com> Date: Sat, 9 Sep 2023 17:58:05 -0700 Subject: [PATCH] Fix object streaming example in README (#10) --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index ef214c98..fef8994c 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,16 @@ Structured outputs can also be streamed from the LLM by using the return type an from collections.abc import Iterable from time import time +from magentic import prompt +from pydantic import BaseModel + + +class Superhero(BaseModel): + name: str + age: int + power: str + enemies: list[str] + @prompt("Create a Superhero team named {name}.") def create_superhero_team(name: str) -> Iterable[Superhero]: