0
0
LangChainframework~10 mins

Setting up LangSmith tracing in LangChain - Interactive Practice

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

Complete the code to import the LangSmith tracer.

LangChain
from langchain.tracing import [1]
Drag options to blanks, or click blank then click option'
ALangSmithTracer
BTracer
CLangTracer
DSmithTracer
Attempts:
3 left
💡 Hint
Common Mistakes
Importing a non-existent class like 'LangTracer' or 'SmithTracer'.
Using a generic name like 'Tracer' which is not the correct class.
2fill in blank
medium

Complete the code to enable LangSmith tracing in LangChain.

LangChain
import [1]

[1].tracing_enabled = True
Drag options to blanks, or click blank then click option'
Atracing
Blangsmith
CLangSmithTracer
Dlangchain
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to set tracing on langsmith or tracing modules.
Using the tracer class name instead of the module name.
3fill in blank
hard

Fix the error in initializing the LangSmith tracer with the API key.

LangChain
tracer = LangSmithTracer(api_key=[1])
Drag options to blanks, or click blank then click option'
ANone
B'YOUR_API_KEY'
Capi_key
DYOUR_API_KEY
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the API key without quotes causing a NameError.
Passing None or a wrong variable name.
4fill in blank
hard

Fill both blanks to set the tracer and enable tracing in LangChain.

LangChain
import [1]
from langchain.tracing import [2]

[1].tracer = [2](api_key='YOUR_API_KEY')
[1].tracing_enabled = True
Drag options to blanks, or click blank then click option'
Alangchain
BLangSmithTracer
Ctracing
DTracer
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up module and class names.
Forgetting to enable tracing after setting the tracer.
5fill in blank
hard

Fill all three blanks to create a LangChain client with LangSmith tracing enabled.

LangChain
import [1]
from langchain.tracing import [2]

[1].tracer = [2](api_key='YOUR_API_KEY')
[1].tracing_enabled = True
client = [1].Client()
Drag options to blanks, or click blank then click option'
Alangchain
BLangSmithTracer
CLangChainTracer
DTracer
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong tracer class names like LangChainTracer.
Not enabling tracing before creating the client.