Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the LangSmith client correctly.
LangChain
from langchain.[1] import LangSmithClient
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing LangSmithClient from langgraph or langserve modules.
Using incorrect module names like 'core'.
✗ Incorrect
The LangSmith client is imported from the langsmith module in LangChain.
2fill in blank
mediumComplete the code to create a LangGraph client instance.
LangChain
client = [1]() Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using LangSmithClient or LangServeClient instead of LangGraphClient.
Trying to instantiate a non-existent LangChainClient.
✗ Incorrect
The LangGraph client is created by calling LangGraphClient().
3fill in blank
hardFix the error in this LangServe server start code by filling the blank.
LangChain
from langchain.[1] import start_server start_server()
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing start_server from langsmith or langgraph modules.
Forgetting to import start_server before calling it.
✗ Incorrect
The start_server function is imported from the langserve module to run the LangServe server.
4fill in blank
hardFill both blanks to create a LangSmith client and log a run.
LangChain
client = [1]() run = client.[2](name="test_run")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using LangGraphClient instead of LangSmithClient.
Calling start_server instead of log_run on the client.
✗ Incorrect
We create a LangSmithClient instance and call its log_run method to log a run.
5fill in blank
hardFill all three blanks to import LangGraphClient, create it, and visualize a graph.
LangChain
from langchain.[1] import [2] client = [2]() client.[3]()
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing from langsmith or using LangSmithClient here.
Calling wrong methods like start_server instead of visualize.
✗ Incorrect
We import LangGraphClient from langgraph, create an instance, and call its visualize method to show the graph.