0
0
LangChainframework~10 mins

Why LangGraph handles complex agent flows in LangChain - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the LangGraph class from langchain.

LangChain
from langchain.graph import [1]
Drag options to blanks, or click blank then click option'
AFlowManager
BAgentFlow
CComplexFlow
DLangGraph
Attempts:
3 left
💡 Hint
Common Mistakes
Using AgentFlow instead of LangGraph
Importing from wrong module
Misspelling the class name
2fill in blank
medium

Complete the code to create a LangGraph instance with a name 'agent_flow'.

LangChain
graph = [1](name='agent_flow')
Drag options to blanks, or click blank then click option'
ALangGraph
BAgentFlow
CFlowGraph
DComplexAgent
Attempts:
3 left
💡 Hint
Common Mistakes
Using AgentFlow instead of LangGraph
Forgetting to pass the name parameter
Using incorrect class names
3fill in blank
hard

Fix the error in adding an agent node to the graph using the correct method.

LangChain
graph.[1](agent_node)
Drag options to blanks, or click blank then click option'
Ainsert_agent
Badd_agent
Cadd_node
Dappend_agent
Attempts:
3 left
💡 Hint
Common Mistakes
Using add_node which is generic
Using insert_agent which does not exist
Using append_agent which is invalid
4fill in blank
hard

Fill both blanks to connect two agents with an edge labeled 'next'.

LangChain
graph.[1](from_agent, to_agent, label=[2])
Drag options to blanks, or click blank then click option'
Aadd_edge
Bconnect
C'next'
D'previous'
Attempts:
3 left
💡 Hint
Common Mistakes
Using connect instead of add_edge
Labeling edge as 'previous' instead of 'next'
Omitting the label parameter
5fill in blank
hard

Fill all three blanks to run the LangGraph with input data and get the output.

LangChain
result = graph.[1](input_data=[2], return_output=[3])
Drag options to blanks, or click blank then click option'
Aexecute
Bdata
CTrue
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using execute instead of run
Passing input_data incorrectly
Setting return_output to False or omitting it