mirror of
https://github.com/kennethreitz/simplemind.git
synced 2026-06-05 22:50:18 +00:00
18 lines
276 B
Python
18 lines
276 B
Python
import simplemind as sm
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class Poem(BaseModel):
|
|
title: str
|
|
content: str
|
|
|
|
|
|
output = sm.structured_response(
|
|
"Write a poem about love",
|
|
llm_model="gpt-4o-mini",
|
|
llm_provider="openai",
|
|
response_model=Poem,
|
|
)
|
|
|
|
print(output)
|