Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
OurBuilding Ambient Agents with LangGraph course is now available on LangChain Academy!
Open on GitHub

PromptLayer

PromptLayer is a platform for prompt engineering.It also helps with the LLM observability to visualize requests, version prompts, and track usage.

WhilePromptLayer does have LLMs that integrate directly with LangChain (e.g.PromptLayerOpenAI),using a callback is the recommended way to integratePromptLayer with LangChain.

Installation and Setup

To work withPromptLayer, we have to:

  • Create aPromptLayer account
  • Create an api token and set it as an environment variable (PROMPTLAYER_API_KEY)

Install a Python package:

pip install promptlayer

Callback

See ausage example.

import promptlayer# Don't forget this import!
from langchain.callbacksimport PromptLayerCallbackHandler

LLM

See ausage example.

from langchain_community.llmsimport PromptLayerOpenAI
API Reference:PromptLayerOpenAI

Chat Models

See ausage example.

from langchain_community.chat_modelsimport PromptLayerChatOpenAI
API Reference:PromptLayerChatOpenAI

[8]ページ先頭

©2009-2025 Movatter.jp