Trace with Instructor
(Python only)
We provide a convenient integration with Instructor, a popular open-source library for generating structured outputs with LLMs.
In order to use, you first need to set your LangSmith API key.
langsmith.wrappers.wrap_openai
instructor
:
instructor
as you normally would, but now everything is logged to LangSmith!
instructor
inside of other functions.
You can get nested traces by using this wrapped client and decorating those functions with @traceable
.
Please see this guide for more information on how to annotate your code for tracing with the @traceable
decorator.