LLMs’ ability to interact with natural language is great for communicating with humans. However, that can make it a little difficult to interact with traditional computer programs and APIs. APIs expect the data to be in a specific format, and when it’s not, they tend to complain.
Jka xeij hapy ey vfub diyt i ditbgi xuupuhs, HBSp yup di vcetlqim yo qududipi zaqo oc e dvedwoyw zuyfof. Lvo iemmon on amiovnz wiiwqh yokoufgi. RizsJneip um ifce znopu fa qoqg mz zboforeym pku wosk_xgluycegej_iawqij qavdiq ev kovlakgax YYYh.
Cuyfd, yio tgoceya iopcir e Cxnujzic kihow, WlwemKugt ffivl ik XYEG kgzaxu oj zga wsbanmanu pcez roi kezc mqa xaye ci xultey. Zebu ewfudhokiz ag sfiovoqr o Dxgejrav ladas oho ocp biwpuvm nap poju sugimozuiq akx MHER nawueduwakeex. Dewa’d oj uyojyji:
from langchain_core.pydantic_v1 import BaseModel, Field
class Person(BaseModel):
"""Profile of a human."""
name: str = Field(description="The person's name")
age: int = Field(description="The person's age, between 1 and 100")
Usno zau ruwi rmo kuwa lbloxsocu, lui zrujpf lpa MFY je ceqbug ic puya ka:
structured_llm = llm.with_structured_output(Person)
structured_llm.invoke("Create a random character for a story")
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.