Four task verbs cover ~80% of practical LLM use: summarize, infer, transform, expand. The next four lessons walk through each.
First: summarize. Take longer text, produce shorter text that retains the meaning.
long_text = "Python is a high-level, general-purpose programming language. ... (200 words)"
prompt = f"Summarize this in one sentence:\n\n{long_text}"
result = Agent(model).run_sync(prompt)
print(result.output)Just "summarize this"?
Plus the constraint — "in one sentence". Without it the model picks an arbitrary length. Specify what you want.
The canonical pattern:
result = Agent(model).run_sync(
f"Summarize the following in one sentence:\n\n{long_text}"
)Key design choices:
Create a free account to get started. Paid plans unlock all tracks.
Four task verbs cover ~80% of practical LLM use: summarize, infer, transform, expand. The next four lessons walk through each.
First: summarize. Take longer text, produce shorter text that retains the meaning.
long_text = "Python is a high-level, general-purpose programming language. ... (200 words)"
prompt = f"Summarize this in one sentence:\n\n{long_text}"
result = Agent(model).run_sync(prompt)
print(result.output)Just "summarize this"?
Plus the constraint — "in one sentence". Without it the model picks an arbitrary length. Specify what you want.
The canonical pattern:
result = Agent(model).run_sync(
f"Summarize the following in one sentence:\n\n{long_text}"
)Key design choices: