PromptLayer
PromptLayer is a platform for prompt engineering. It also helps with the LLM observability to visualize requests, version prompts, and track usage.
While
PromptLayer
does have LLMs that integrate directly with LangChain (e.g.PromptLayerOpenAI
), using a callback is the recommended way to integratePromptLayer
with LangChain.
In this guide, we will go over how to setup the PromptLayerCallbackHandler
.
See PromptLayer docs for more information.
Installation and Setup
%pip install --upgrade --quiet langchain-community promptlayer --upgrade
Getting API Credentials
If you do not have a PromptLayer account, create one on promptlayer.com. Then get an API key by clicking on the settings cog in the navbar and
set it as an environment variabled called PROMPTLAYER_API_KEY