1/22
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
What do you pass to create_agent to choose a model?
A model identifier string ("provider:model") or an initialized model instance.
What does the system_prompt parameter accept?
A string or a SystemMessage.
What does response_format do?
Lets you specify a pydantic model so the agent returns a validated response in the required format.
What does .invoke() do?
Runs the full ReAct loop from start to end and returns the final result.
What is the washing machine analogy for .invoke()?
You load the laundry (prompt + tools), pick a mode (response_format), and the machine runs the whole cycle until it returns clean laundry (result).
What is structured_response?
The field holding the validated final answer in the requested format.
What do you pass along with a new message to let the agent persist and resume conversation history?
A thread_id.
What practical benefit does State provide?
persisting context/data across multiple steps or turns
What practical benefit does Checkpointing provide?
Multi-turn dialogue across different .invoke() calls.
What should you pass as context for, and alongside what?
To pass per-run configuration (user ID, API keys, feature flags) to tools and middleware, passed alongside config.
What does the config layer store, and for what purpose?
Infrastructure settings, for execution control (thread_id, callbacks, tags).
What does the state layer store?
Conversation history — messages, memory, intermediate results.
What context_schema gives you:
(TVITC) typing validation isolation testability concurrency
What is the difference between what thread_id and context scope?
thread_id scopes the conversation (message history, checkpoints), while context carries per-run data read by tools and middleware at invocation time.
what is streaming
Streaming is the continuous, real-time transmission of data—such as tokens, audio, or video—allowing users to process or consume content immediately as it arrives rather than waiting for the entire payload to download.
Why is streaming needed if an agent makes multiple tool calls?
Because invoke only returns the final response at the end, and users often need progress updates before completion.
What does stream_events() let you do
See intermediate steps in real time.
What is a snapshot in streaming
The agent's state at a given step.
agent = create_agent(model="openai:gpt-5.5", tools=tools, ________=Answer)agent = create_agent(model="openai:gpt-5.5", tools=tools, response_format=Answer)config = {"configurable": {________: str(uuid7())}}config = {"configurable": {"thread_id": str(uuid7())}}agent = create_agent(model="openai:gpt-5.5", tools=[], ________=Context, checkpointer=InMemorySaver())agent = create_agent(model="openai:gpt-5.5", tools=[], context_schema=Context, checkpointer=InMemorySaver())result = agent.invoke({"messages": [{"role": "user", "content": "What's the weather in San Francisco?"}]}, config={"configurable": {"thread_id": str(uuid7())}}, ________=Context(user_id="user-123"))result = agent.invoke({"messages": [{"role": "user", "content": "What's the weather in San Francisco?"}]}, config={"configurable": {"thread_id": str(uuid7())}}, context=Context(user_id="user-123"))stream = agent.________({"messages": [{"role": "user", "content": "Search for AI news and summarize the findings"}]}, version="v3")stream = agent.stream_events({"messages": [{"role": "user", "content": "Search for AI news and summarize the findings"}]}, version="v3")